Virtual Machine Revert To Current Snapshot Task
Reverts the virtual machine to the current snapshot.
This is equivalent to doing snapshot.currentSnapshot.revert.
If no snapshot exists, then the operation does nothing, and the virtual machine state remains unchanged.
Required privileges: VirtualMachine.State.RevertToSnapshot
The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId
, in this case VirtualMachine/{moId}
.
The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.
"RevertToCurrentSnapshotRequestType Object"
(optional) Choice of host for the virtual machine, in case this operation causes the virtual machine to power on.
If a snapshot was taken while a virtual machine was powered on, and this operation is invoked after the virtual machine was powered off, the operation causes the virtual machine to power on to reach the snapshot state. This parameter can be used to specify a choice of host where the virtual machine should power on.
If this parameter is not set, and the vBalance feature is configured for automatic load balancing, a host is automatically selected. Otherwise, the virtual machine keeps its existing host affiliation.
This is not supported for virtual machines associated with hosts on ESX 2.x servers.
(optional) If set to true, the virtual machine will not be powered on regardless of the power state when the current snapshot was created. Default to false.
This method returns a Task object with which to monitor the operation.
"MoRefTask Object"
TaskInProgress: if the virtual machine is busy.
NotSupported: if the host product does not support snapshots.
InsufficientResourcesFault: if this operation would violate a resource usage policy.
SnapshotFault: if an error occurs during the snapshot operation. Typically, a more specific fault like InvalidSnapshotFormat is thrown.
InvalidPowerState: if the operation cannot be performed in the current power state of the virtual machine.
InvalidState: if the operation cannot be performed because of the virtual machine's current state. For example, if the virtual machine configuration information is not available or if an OVF consumer is blocking the operation.
VmConfigFault: if a configuration issue prevents the power-on. Typically, a more specific fault, such as UnsupportedVmxLocation, is thrown.
FileFault: if there is a problem accessing the virtual machine on the filesystem.
NotFound: if the virtual machine does not have a current snapshot.
DisallowedOperationOnFailoverHost: if the virtual machine is being reverted to a powered on state and the host specified is a failover host. See ClusterFailoverHostAdmissionControlPolicy.
"VimFault Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/VirtualMachine/{moId}/RevertToCurrentSnapshot_Task