This sample demonstrates VM snapshot operations

url            [required] : url of the web service.
username       [required] : username for the authentication
password       [required] : password for the authentication
vmname         [required] : Name of the virtual machine
operation      [required] : operation type - [list|create|remove|revert]
snapshotname   [optional] : Name of the snapshot
description    [optional] : description of the sanpshot
removechild    [optional] : remove snapshot children - [1 | 0]

Command Line:
List VM snapshot names
run.bat com.vmware.vm.VMSnapshot
--url [webserviceurl] --username [username] --password  [password]
--vmname [vmname] --operation list

Create VM snapshot
run.bat com.vmware.vm.VMSnapshot
--url [webserviceurl] --username [username] --password  [password]
--vmname [vmname] --operation create
--description [Description of the snapshot]

Revert VM snapshot
run.bat com.vmware.vm.VMSnapshot
--url [webserviceurl] --username [username] --password  [password]
--vmname [vmname] --operation revert --description [Snapshot Description]

Remove VM snapshot
run.bat com.vmware.vm.VMSnapshot
--url [webserviceurl] --username [username] --password  [password]
--vmname [vmname] --operation remove --removechild 0

VMware vSphere Web Services Java Samples

This sample was originally released as a part of vSphere 6.0 under license terms that contained a provision that disallowed redistribution in source form. In order to encourage growth of community around VMware samples, these samples are being re-released under a commercially friendly open source license (BSD 3-Clause). See the file header for details.

The samples themselves are identical to the official release version with the exception of a changed copyright and license header on each file.

If you wish to run this sample, please download the official SDK from https://my.vmware.com/group/vmware/get-download?downloadGroup=MNGMTSDK600 and follow the provided instructions.

These samples are provided for reference with no warranty expressed or implied.

Sign in to be able to add comments.

Comments 0