Does anyone know how to shutdown the CVM through REST API or PowerShell? I am trying to put together a script that would put the ESXi host in maintenance mode and would like to gracefully shutdown the CVM via script, after all other VMs on the host have been evacuated.
Thanks!
Best answer by Explorer
I figured out a workaround using PowerCLI for this:
Invoke-VMScript -VM $CVM -ScriptText $script -GuestUser $CVM_UserName -GuestPassword $CVM_Password
So, pass the shutdown command (cvm_shutdown -P now) as ScriptText and let PowerCLI run it.
View original
Invoke-VMScript -VM $CVM -ScriptText $script -GuestUser $CVM_UserName -GuestPassword $CVM_Password
So, pass the shutdown command (cvm_shutdown -P now) as ScriptText and let PowerCLI run it.