NAME

snapshotmanager.pl - Allows you to list, revert, go to, rename, or remove one or more snapshots.


SYNOPSIS

 snapshotmanager.pl --operation<List|Create|Revert|Goto|Rename|Remove|RemoveAll>[options]


DESCRIPTION

This VI Perl command-line utility provides an interface for seven basic operations for Snapshot:

 Listing all snapshots for one or more virtual machines,
 Creating a snapshot (memory dump is not included) for one or more virtual machines,
 Reverting to the current snapshot for a single virtual machine,
 Reverting to the specified snapshot for a single virtual machine,
 Renaming a named snapshot for a single virtual machine,
 Removing all snapshots for a single virtual machine,
 Removing a named snapshot for one or more virtual machines.


OPTIONS

GENERAL OPTIONS

operation

Operation to be performed. Must be one of the following:


 <list>      (List all snapshots for one or more virtual machines),
 <create>    (Creating a snapshot for one or more virtual machines),
 <revert>    (Reverting to the current snapshot for a single virtual machine),
 <goTo>      (Reverting to the specified snapshot for a single virtual machine),
 <rename>    (Renaming a named snapshot [and children] for a single virtual machine),
 <removeAll> (Removing all snapshots for a single virtual machine),
 <remove>    (Removing a named snapshot for one or more virtual machines).

LIST OPTIONS

vmname

Optional. The name of the source virtual machine.

datacenter

Optional. Name of the datacenter for selection of virtual machines.

pool

Optional. Name of the resource pool for selection of virtual machines.

host

Optional. Name of the host for selection of virtual machines.

folder

Optional. Name of the folder for selection of virtual machines.

ipaddress

Optional. IP address of virtual machine.

powerstatus

Optional. Power Status for selection of virtual machines.

guestOS

Optional. Guest OS for selection of virtual machines.

CREATE OPTIONS

vmname

Optional. The name of the source virtual machine.

datacenter

Optional. Name of the target datacenter for selection of virtual machines.

pool

Optional. Name of the target resource pool for selection of virtual machines.

host

Optional. Name of the target host for selection of virtual machines.

folder

Optional. Name of the target folder for selection of virtual machines.

ipaddress

Optional. IP address of target virtual machine.

powerstatus

Optional. Power Status for selection of virtual machines.

guestOS

Optional. Guest OS for selection of virtual machines.

snapshotname

Required. Name of the new snapshot for the Create operation.

REVERT OPTIONS

vmname

Required. The name of the source virtual machine.

GOTO OPTIONS

vmname

Required. The name of the source virtual machine.

snapshotname

Required. Name of snapshot to revert to.

RENAME OPTIONS

vmname

Required. The name of the source virtual machine.

snapshotname

Required. Name of snapshot to be renamed.

newname

Required. New name for the snapshot.

REMOVEALL OPTIONS

vmname

Required. The name of the source virtual machine.

REMOVE OPTIONS

vmname

Optional. The name of the source virtual machine.

datacenter

Optional. Name of the target datacenter for selection of virtual machines.

pool

Optional. Name of the target resource pool for selection of virtual machines.

host

Optional. Name of the target host for selection of virtual machines.

folder

Optional. Name of the target folder for selection of virtual machines.

ipaddress

Optional. IP address of target virtual machine.

powerstatus

Optional. Power Status for selection of virtual machines.

guestOS

Optional. Guest OS for selection of virtual machines.

snapshotname

Required. Name of snapshot to be removed for operation Remove

children

Required. Binary value (0 or 1) that determines whether child snapshots are also removed (1) or not removed (0) for operation I <Remove>


EXAMPLES

List all the snapshots for Virtual Machine with name ``ABC'':

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation list
                    --vmname ABC

Create snapshot SN1 for the Virtual Machine ``ABC'':

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation create
                    --vmname ABC --snapshotname SN1

Revert Virtual Machine ``ABC'' to Current Snapshot:

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation revert
                    --vmname ABC

Revert Virtual Machine ``ABC'' to the snapshot ``SN1'' :

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation goto
                    --vmname ABC --snapshotname SN1

Rename snapshot ``SN1'' of Virtual Machine ``ABC'' to ``SN2'':

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation rename
                    --snapshotname SN1
                    --newname SN2 --vmname ABC

Remove all the snapshot for the Virtual Machine ``ABC'':

 snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation removeAll
                    --vmname ABC

Remove the snapshot ``SN1'' of Virtual Machine ``ABC'' along with all the childrens:

   snapshotmanager.pl --url <https://<IP Address>:<Port>/sdk/vimService>
                    --username myuser --password mypassword --operation remove
                    --vmname ABC --snapshotname SN1
                    --children 1


KNOWN ISSUE

If you suspend a virtual machine and then take two successive snapshots, the second snapshot operation fails with the error ``Failure due to a malformed request to the server''. This error is expected and does not indicate a problem, because suspended virtual machines do not change, the second snapshot would overwrite the existing snapshot with identical data.


SUPPORTED PLATFORMS

All operations work with VMware VirtualCenter 2.0.1.

All operations work with VMware ESX Server 3.0.1.