Managed Object - VirtualMachineSnapshot(vim.vm.Snapshot)

Property of
OvfCreateDescriptorParams, VirtualMachine, VirtualMachineCloneSpec, VirtualMachineFileLayoutExSnapshotLayout, VirtualMachineFileLayoutSnapshotLayout, VirtualMachineSnapshot, VirtualMachineSnapshotInfo, VirtualMachineSnapshotTree
Parameter to
QueryChangedDiskAreas, StartReplaying_Task
Returned by
CreateSnapshot_Task, CreateSnapshotEx_Task, StartRecording_Task
Extends
ExtensibleManagedObject
See also
HostSystem, HttpNfcLease, VirtualMachine, VirtualMachineConfigInfo,


Managed Object Description

The Snapshot managed object type specifies the interface to individual snapshots of a virtual machine. Although these are managed objects, they are subordinate to their virtual machine.

Properties

Name Type Description
childSnapshot*ManagedObjectReference[]
to a VirtualMachineSnapshot[]

All snapshots for which this snapshot is the parent.

Since vSphere API 4.1
configVirtualMachineConfigInfo

Information about the configuration of this virtual machine when this snapshot was taken.

The datastore paths for the virtual machine disks point to the head of the disk chain that represents the disk at this given snapshot. The fileInfo.fileLayout field is not set.


vmManagedObjectReference
to a VirtualMachine

The virtual machine for which the snapshot was taken.

Since vSphere API 6.0
Properties inherited from ExtensibleManagedObject
availableField, value
*May not be present

Methods

Methods defined in this Managed Object
ExportSnapshot, RemoveSnapshot_Task, RenameSnapshot, RevertToSnapshot_Task
Methods inherited from ExtensibleManagedObject
setCustomValue

ExportSnapshot(exportSnapshot)

Obtains an export lease on this snapshot. The export lease contains a list of URLs for the virtual disks for this snapshot, as well as a ticket giving access to the URLs.

See HttpNfcLease for information on how to use the lease.

Required Privileges
VApp.Export
Since
vSphere API 5.5

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the VirtualMachineSnapshot used to make the method call.

Return Value

Type Description
ManagedObjectReference
to a HttpNfcLease
The export lease on this VirtualMachineSnapshot. The export task continues running until the lease is completed by the caller.

Faults

Type Description
FileFaultThrown if there is an error accessing the virtual machine files.
InvalidStateThrown 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.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgressThrown if the virtual machine is busy.

Events

Type
None

Show WSDL type definition



RemoveSnapshot_Task(remove)

Removes this snapshot and deletes any associated storage.
Required Privileges
VirtualMachine.State.RemoveSnapshot

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the VirtualMachineSnapshot used to make the method call.
removeChildrenxsd:boolean

Flag to specify removal of the entire snapshot subtree.
consolidate*xsd:boolean

(optional) If set to true, the virtual disk associated with this snapshot will be merged with other disk if possible. Defaults to true.

Since vSphere API 5.0
*Need not be set

Return Value

Type Description
ManagedObjectReference
to a SmsTask
This method returns a Task object with which to monitor the operation.

Faults

Type Description
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgressThrown if the virtual machine is busy.

Events

Type
None



RenameSnapshot(rename)

Rename this snapshot with either a new name or a new description or both. At least one of these must be specified when calling the rename method.

Required Privileges
VirtualMachine.State.RenameSnapshot

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the VirtualMachineSnapshot used to make the method call.
name*xsd:string

New name for the snapshot.
description*xsd:string

New description for the snapshot.
*Need not be set

Return Value

Type Description
None

Faults

Type Description
InvalidNameThrown if the specified snapshot name is not valid.
InvalidPowerStateThrown if the operation cannot be performed in the current power state of the virtual machine.
InvalidStateThrown if the operation cannot be performed in the current state of the virtual machine. For example, the virtual machine's configuration is not available.
NotSupportedThrown if the host product does not support snapshot rename.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgressThrown if the virtual machine is busy.

Events

Type
None

Show WSDL type definition



RevertToSnapshot_Task(revert)

Change the execution state of the virtual machine to the state of this snapshot.
Required Privileges
VirtualMachine.State.RevertToSnapshot

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the VirtualMachineSnapshot used to make the method call.
host*ManagedObjectReference
to a HostSystem

(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.


suppressPowerOn*xsd:boolean

(optional) If set to true, the virtual machine will not be powered on regardless of the power state when the snapshot was created. Default to false.

Since vSphere API 4.0
*Need not be set

Return Value

Type Description
ManagedObjectReference
to a SmsTask
This method returns a Task object with which to monitor the operation.

Faults

Type Description
FileFaultThrown if there is a problem accessing the virtual machine on the filesystem.
InsufficientResourcesFaultThrown if this operation would violate a resource usage policy.
InvalidPowerStateThrown if the operation cannot be performed in the current power state of the virtual machine.
InvalidStateThrown if the operation cannot be performed in the current state of the virtual machine. For example, the virtual machine's configuration is not available.
NotSupportedThrown if the host product does not support snapshots.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
TaskInProgressThrown if the virtual machine is busy.
VmConfigFaultThrown if a configuration issue prevents the power-on. Typically, a more specific fault, such as UnsupportedVmxLocation, is thrown.

Events

Type
None