VMware Cloud Community
briandoody
Contributor
Contributor

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

Vsphere Version 6.5.0.20000 Build 8815520

Issue:

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-... 

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)

Findings:

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

0 Kudos
1 Reply
briandoody
Contributor
Contributor

Tested this in separate vmware instance running version 6.5.100000 Build 5973321.

Same behaviour, it appears the delete host function is actually mapped to delete cluster and it used the host id to determine the cluster to delete.

In this specific build however it fails with 500 error message if any hosts are connected.

0 Kudos