VMware vSphere 7.0.x / 8.0.x
VMware vSAN 7.x / 8.x
vSphere Cluster Services (vCLS) are managed by vCenter Server. When an ESXi host enters Maintenance Mode, it expects vCenter to shut down or migrate these agent VMs. If vCenter is offline, the local HA agent keeps the vCLS VMs powered on, which blocks the host's transition to Maintenance Mode.
Shut down all virtual machines on the ESXi host except the vCenter Server VM and the vCLS VMs.
Before entering maintenance mode on the last ESXi host in the cluster, put the cluster into Retreat Mode to delete the vCLS VMs.
Using the Host Client, shut down the vCenter Server VM on that ESXi host.
In the Host Client, place the ESXi host into Maintenance Mode.
If vCenter is offline and you cannot enable Retreat Mode via the GUI, perform these steps on the ESXi host terminal:
Stop the HA Agent to prevent it from restarting VMs automatically:
/etc/init.d/vmware-fdm stop
List all VMs to identify the vCLS VM ID: Refer Powering off an unresponsive virtual machine on an ESXi host
vim-cmd vmsvc/getallvms | grep -i vcls
Power off the vCLS VM using the ID from the first column:
vim-cmd vmsvc/power.off ####
Cancel any stuck maintenance mode tasks and retry: Refer Proper use of esxcli/localcli vsan maintenancemode cancelesxcli/localcli vsan maintenancemode cancel
esxcli system maintenanceMode set --enable true -m noAction
Once maintenance tasks are complete, remember to restart the HA agent if the host remains in the cluster:
/etc/init.d/vmware-fdm start
Note: When vCenter Server is restored, it will automatically redeploy new vCLS VMs once Retreat Mode is disabled or services are stabilized.