Virtual Machine Create Snapshot Ex Task
Creates a new snapshot of this virtual machine.
As a side effect, this updates the current snapshot.
Snapshots are not supported for Fault Tolerance primary and secondary virtual machines.
Any % (percent) character used in this name parameter must be escaped, unless it is used to start an escape sequence. Clients may also escape any other characters in this name parameter.
Required privileges: VirtualMachine.State.CreateSnapshot
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.
"CreateSnapshotExRequestType Object"
The name for this snapshot. The name need not be unique for this virtual machine.
A description for this snapshot. If omitted, a default description may be provided.
If TRUE, a dump of the internal state of the virtual machine (basically a memory dump) is included in the snapshot. Memory snapshots consume time and resources, and thus take longer to create. When set to FALSE, the power state of the snapshot is set to powered off.
capabilities indicates whether or not this virtual machine supports this operation. For a virtual machine in suspended state we always include memory unless VirtualMachineCapability.diskOnlySnapshotOnSuspendedVMSupported is true.
Spec for granular control over quiesce details. If quiesceSpec is set and the virtual machine is powered on when the snapshot is taken, VMware Tools is used to quiesce the file system in the virtual machine. This assures that a disk snapshot represents a consistent state of the guest file systems. If the virtual machine is powered off or VMware Tools are not available, the quiesce spec is ignored. If the spec type is VirtualMachineGuestQuiesceSpec, the default quiescing process will be applied. If the spec type is VirtualMachineWindowsQuiesceSpec and Guest OS is Windows, the parameters will control the VSS process.
This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the newly created VirtualMachineSnapshot upon success.
"MoRefTask Object"
InvalidArgument: if quiesceSpec is invalid.
TaskInProgress: if the virtual machine is busy.
NotSupported: if the host product does not support snapshots or if the host does not support quiesced snapshots and the quiesce spec is set; or if the virtual machine is a Fault Tolerance primary or secondary; or if an unsupported quiesce spec is set.
SnapshotFault: if an error occurs during the snapshot operation. Typically a more specific fault like MultipleSnapshotsNotSupported is thrown.
FileFault: if there is a problem with creating or accessing one or more files needed for this operation.
VmConfigFault: if the virtual machine's configuration is invalid. Typically, a more specific fault like InvalidSnapshotState is thrown.
InvalidName: if the specified snapshot name is invalid.
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, the virtual machine configuration information is not available.
"VimFault Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/VirtualMachine/{moId}/CreateSnapshotEx_Task