vim-cmd vmsvc/getallvmsvmid Name## envoy-####
/var/log/vmware/vpxd/vpxd.log the host already seems to be in maintenance mode per error below.Error:--> com.vmware.vapi.std.errors.already_in_desired_state--> Messages:--> vcenter.wcp.node.alreadyindesiredstate<Node identified by host-## is already in state NodeMaintenanceThe stale PodVM needs to be manually deleted in order for the host to enter maintenance mode.
Note: Perform a backup or take an offline snapshot of the vCenter Server Appliance before proceeding. If the vCenter Server is in Enhanced Linked mode, backups or offline snapshot has to be created for every vCenter server as described in KB Snapshot Best practices for vCenter Server Virtual Machines
vim-cmd vmsvc/getallvms
Note: Make a note of the vmid of the affected PodVM.vim-cmd vmsvc/destroy <vmid>
service-control --stop vpxdservice-control --stop wcp/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDBselect * from vpx_entity where name like '%<VM-Name>%';delete from VPX_COMPUTE_RESOURCE_DAS_VM where VM_ID=####;delete from VPX_COMPUTE_RESOURCE_DRS_VM where VM_ID=####;delete from VPX_COMPUTE_RESOURCE_ORC_VM where VM_ID=####;delete from VPX_VM_SGXINFO where VM_ID=####;delete from VPX_GUEST_DISK where VM_ID=####;delete from VPX_VM_VIRTUAL_DEVICE where ID=####;delete from VPX_VM_DS_SPACE where VM_ID=####;delete from VPX_NON_ORM_VM_CONFIG_INFO where ID=####;delete from VPX_NORM_VM_FLE_FILE_INFO where VM_ID=####;delete from VPX_VDEVICE_BACKING_REL where VM_ID=####;delete from VPX_VIRTUAL_DISK_IOFILTERS where VM_ID=####;delete from VPX_VM_STATIC_OVERHEAD_MAP where VM_ID=####;delete from VPX_VM_TEXT where VM_ID=####;delete from VPX_VM where ID=####;delete from VPX_ENTITY where ID=####;
Reference KB: Manually removing a stale VM from the vCenter Server vpostgres database\qservice-control --start vpxdservice-control --start wcp