Delete VM Snapshot operation


The Delete VM Snapshot operation removes the specified snapshot and deletes any storage associated with the snapshot.

The following table describes the elements for this request.

Adapter request elements for Delete VM Snapshot operation

Element

Definition

Required

<operation-type>

Defines the type of operation: Advanced_Vm

Yes

<operation-name>

Defines the name of operation: Delete_VM_Snapshot

Yes

<soap-url>

Specifies the URL for the remote SOAP service running on the VMware VirtualCenter

If the <soap-url> element is not specified, the request uses the VirtualCenter Server details specified in the adapter configuration.

Default format for HTTPS: https://<hostName>:<port>/sdk/vim

Default format for HTTP: http://<hostName>:<port>/sdk/vim

Note

If you want to use an HTTP value, you might need to change the configuration of the VMware Infrastructure application.

No

<transport>

Specifies the transport protocol for the message

If the <transport> element is not provided, the request uses the VirtualCenter Server details specified in the adapter configuration.

Valid values: https-rpc (default), http-rpc

Note

If the value of the <transport> element is https-rpc, you must install the security certificate for the VMware Virtual Center to the keystore of the peer on which the adapter is enabled.

No

<user-name>

Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center

If no user name is specified, the request is executed with the user name that is specified in the configuration.

No

<password>

Specifies the password corresponding to <user-name>

Conditional; required if <user-name> is specified

<parameters>

Contains the elements required to execute the operation

Yes

<virtual-machine>

Contains the name of the virtual machine on which this operation is to be executed

Yes

<name>

Specifies the parent/child hierarchy of the snapshot that must be deleted

If the snapshot is a child snapshot, the value of the <name> element must be expressed in terms of the root snapshot.

For example, to delete the VM snapshot "SNAP_67890000", which is the child snapshot of "SNAP_12345000", you need to specify the parent/child hierarchy as follows:

<name>SNAP_12345000/SNAP_67890000</name>

If the snapshot to be deleted is several levels below the parent snapshot, you must specify the complete path, starting with the parent snapshot, including all the intermediate levels, and the snapshot that you wish to delete.

Tip

Use the Retrieve_VM_Configuration operation to see the root/child relationship in a given VM.

The name need not be unique for the specified virtual machine.

Valid value: Any string

Yes

<remove-children>

Indicates whether to remove the entire snapshot subtree

Warning

If you specify <remove-children> as true and specify only a root snapshot in <name>, all the snapshots from the VM are deleted.

Valid values: true, false

Yes

The following code sample shows a sample adapter request for the Delete VM Snapshot operation to delete VM snapshot "SNAP_67890000":

Sample adapter request for Delete VM Snapshot operation

<vmware-infrastructure-request>
  <operation-type>Advanced_VM</operation-type>
  <operation-name>Delete_VM_Snapshot</operation-name>
  <soap-url></soap-url>
  <transport></transport>
  <user-name></user-name>
  <password></password>
  <parameters>
     <virtual-machine>TestDev156</virtual-machine>
     <name>SNAP_12345000/SNAP_67890000</name>
     <remove-children>true</remove-children>
  </parameters>
</vmware-infrastructure-request>

The following code sample shows the response for the sample Delete VM Snapshot operation.

Sample adapter response for Delete VM Snapshot operation

<vmware-infrastructure-response>
 <metadata>
   <status>success</status>
 </metadata>
 <RemoveSnapshot_TaskResponse>
    <Task>task-6932</Task>
  </RemoveSnapshot_TaskResponse>
</vmware-infrastructure-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*