Using: VMware ESXi 7.0.3 build-20842708
I want to use suppressPowerOn to keep a VM powered off after reverting to an online snapshot.
[root@myhost:/] vim-cmd vmsvc/snapshot.revert 27 1 suppressPowerOn
Revert Snapshot:
|-ROOT
--Snapshot Name : Current
--Snapshot Id : 1
--Snapshot Desciption :
--Snapshot Created On : 2/25/2020 13:10:7
--Snapshot State : powered on
As visible here, the machine is powered on instead.
Is there possibly another way of reverting the VM without powering it on?
Are you specifying "true" after the suppresspoweron switch?
I didn't pass this to the command.
But even if I pass it like this (I've also tried other variations)
vim-cmd vmsvc/snapshot.revert 7 2 suppressPowerOn true
vim-cmd vmsvc/snapshot.revert 7 2 suppressPowerOn=true
It doesn't change anything, the machine is still powered on.
It's sad that there are no helpful replies yet.
This is an officially documented option also in the vsphere API:
I hope someone from VMware reads this and takes a look.
The VMTN Community forum is exactly that ... a community. If you're not happy with the responses, then you are more than welcome to use the official route via VMware Support.
With that said, did you actually look at the VM when you ran the vim-cmd? I just took a look and it behaves exactly as described in the API docs ...
The output from running the command simply shows the snapshot you're reverting TO, it does NOT reflect the state of the VM. This can clearly be seen when looking at the VM from the vSphere UI. The VM is "suspended" rather than powered on when you use 'true' value. This is ALSO the exact same behavior when using vSphere API RevertVMSnapshot_Task()
vim-cmd vmsvc/snapshot.revert 4491 1 true
Revert Snapshot:
|-ROOT
--Snapshot Name : VM Snapshot 1/6/2023, 12:57:44 PM
--Snapshot Id : 1
--Snapshot Desciption :
--Snapshot Created On : 1/6/2023 20:57:46
--Snapshot State : powered on
$vm = Get-VM 'Nested_ESXi8.0a_Appliance_Template_v1'
$snap = Get-View $vm.ExtensionData.Snapshot.CurrentSnapshot
$snap.RevertToSnapshot_Task($null,$true)