1 Reply Latest reply on Feb 27, 2019 6:45 AM by briandoody

    Rest Call to remove a host, inexplicably is also removing the cluster even if other connected hosts

    briandoody Lurker

      Vsphere Version Build 8815520


      Trying to Delete a host using the rest api deletes the whole cluster regardless of whether there are multiple hosts connected or disconnected.

      Tool being used: Postman

      Rest Json calls: https://raw.githubusercontent.com/vmware/vsphere-automation-sdk-rest/master/samples/postman/vSphere-Automation-Rest-API-… 



      To recreate Autenticate against vsphere using the following command

      POST: https://{{vc}}/rest/com/vmware/cis/session

      Result: {

          "value": XXXXXXXXX



      Get list of all hosts

      GET https://{{vc}}/rest/vcenter/host




      Delete one of the hosts (doesn’t matter if the host is connected or disconnected) or if the cluster it resides has other hosts or not

      DELETE: https://{{vc}}/rest/vcenter/host/host-1225462

      Output: Empty (Result: 200)



      Host and Cluster it belongs to are completed deleted. Confirmed via logs in vcenter despite the intention being just to delete the host.

      This cluster delete happens even if the other hosts in the cluster and if they are connected and the final state is that all hosts are lost after running a single host delete command.

      Looking at the logs show it disconnected host, removing the host and then unexpectingly deleting the cluster also.


      I’ve tested this multiple times and in each case the cluster is remove (and all hosts belonging to it)

      single cluster host connected,

      single cluster host disconnected.

      single cluster multiple hosts (other hosts connected)


      Cluster has to be recreated and all hosts are required to be readded after running this command even once.


      If there some sort of housekeeping process here, the docs says nothing about removal of cluster when removing host