Removing an Esxi host in a cluster from vCenter using REST API Host.delete removes the host & parent cluster.
search cancel

Removing an Esxi host in a cluster from vCenter using REST API Host.delete removes the host & parent cluster.

book

Article ID: 338841

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Corresponding vSphere API HostSystem.destroy cannot be used to remove a standalone host as the documentation states "A standalone HostSystem can be destroyed only by invoking destroy on its parent ComputeResource.". So the current REST API Host.delete implementation just gets the parent of the host and then calls vSphere API destroy on the parent. If a host is in a cluster, the parent of the host is the cluster. Calling destroy on the parent will destroy the cluster in this case.


Environment

VMware vCenter Server 6.7.x
VMware vCenter Server 6.5.x

Resolution

This is expected as Host.delete API is only for a Standalone host in vCenter. VMware Engineering is aware of this behaviour and it will be changed in a future release. In order to utilise the API call as intended, move out the host from the cluster first to the datacenter level and then invoke the API call.