NAME

snapshotmanager.pl - List, Create, Revert, Goto, Rename, Remove, Remove All Snapshot/s.


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 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:
  I<List> (List all snapshots for one or more virtual machines),
  I<Create> (Creating a snapshot for one or more virtual machines),
  I<Revert> (Reverting to the current snapshot for a single virtual machine),
  I<GoTo>   (Reverting to the specified snapshot for a single virtual machine),
  I<Rename> (Renaming a named snapshot [and children] for a single virtual machine),
  I<RemoveAll> (Removing all snapshots for a single virtual machine),
  I<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 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.

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 operation <Create>

Revert OPTIONS

vmname

Required. The name of the source virtual machine.

target

Optional. Name of Target Host.

GoTo OPTIONS

vmname

Required. The name of the source virtual machine.

revert

Required. Name of snapshot to revert to.

target

Optional. Name of Target Host.

Rename OPTIONS

vmname

Required. The name of the source virtual machine.

rename

Required. Name of snapshot to be renamed.

name

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.

remove

Required. Name of snapshot to be removed for operation Remove

children

Required. Binary value 0|1 to decide whether children snapshots also needs to be removed or not for operation I <Remove>


EXAMPLES

List all the snapshots :

   perl snapshotmanager.pl --server <server host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation List
                    --vmname <Virtual Machine Name>

Create snapshot :

   perl snapshotmanager.pl --server <server host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation Create
                    --vmname <Virtual Machine Name> --snapshotname <Snapshot Name>

Revert snapshot :

   perl snapshotmanager.pl --server <server_host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation Revert
                    --vmname <Virtual Machine Name>

GoTo snapshot :

   perl snapshotmanager.pl --server <server_host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation Goto
                    --vmname <Virtual Machine Name> --revert <Name of Snapshot>

Rename snapshot :

   perl snapshotmanager.pl --server <server_host> --url <https://192.168.111.52/sdk/vimService>
                 --username <username> --password <password> --operation Rename
                 --rename <Name of snapshot to be renamed> --name <New name of snapshot>
                 --vmname <Virtual Machine Name>

Remove all :

   perl snapshotmanager.pl --server <server_host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation RemoveAll
                    --vmname <Virtual Machine Name>

Remove :

   perl snapshotmanager.pl --server <server_host> --url <https://192.168.111.52/sdk/vimService>
                    --username <username> --password <password> --operation Remove
                    --vmname <Virtual Machine Name> --remove <Name of snapshot>
                    --children <1|0>


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.