VMware Cloud Community
abulhol
Enthusiast
Enthusiast
Jump to solution

snapshot.revert suppressPowerOn does not work

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?

Labels (1)
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

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)

 

View solution in original post

0 Kudos
4 Replies
compdigit44
Enthusiast
Enthusiast
Jump to solution

0 Kudos
abulhol
Enthusiast
Enthusiast
Jump to solution

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.

0 Kudos
abulhol
Enthusiast
Enthusiast
Jump to solution

It's sad that there are no helpful replies yet. 

This is an officially documented option also in the vsphere API:

https://vdc-download.vmware.com/vmwb-repository/dcr-public/a5f4000f-1ea8-48a9-9221-586adff3c557/7ff5...

I hope someone from VMware reads this and takes a look. 

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

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)

 

0 Kudos