I have a 2 node VMWare cluster (Simplivity) which I am planning to do some hardware maintenance on (i.e. switching them off). Hence I would like to cleanly shutdown the VM guests and subsequently bring them back. There are quite a few guests running (~200) so doing this manually via vsphere will take rather a long time. This is somewhat compounbded by dependencies in the startup which requires startup to be ordered. I am therefore hoping to do this via the command line using....
vim-cmd vmcsv/power.shutdown <vmid>
...
vim-cmd vmcsv/power.on <vmid>
I ran a test case of stopping and starting a VM. Via the CLI, it worked a treat, but when I tried starting the VM via vsphere, VMware decided that to start it on the other node than it had previously been running on, and assigned it a new vmid.
While I can identify the vmids when the VMs are running, what will happen after I have restarted the ESX hosts? Will the vmids I captured previously still reference the VMs? Or do I need to find a different way of identifying VMs and starting them?
(I would ask HPE - but their advice the last 3 times I have contacted them has been disastrously wrong)
It turns out that they persist across restarts of ESX, however they are not completely static. Although unique in a cluster they do change when the VM is migrated by DRS. So a safe way to start it up again (if you know the name and the vmid from a point in the past) is: