Package com.vmware.vm

Class VMSnapshot


  • @Sample(name="vm-snapshot",
            description="This sample demonstrates VM snapshot operations")
    public class VMSnapshot
    extends ConnectedVimServiceBase
     VMSnapshot
     
     This sample demonstrates VM snapshot operations
     
     Parameters:
     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
     
    • Constructor Detail

      • VMSnapshot

        public VMSnapshot()
    • Method Detail

      • setVirtualMachineName

        @Option(name="vmname",
                description="Name of the virtual machine")
        public void setVirtualMachineName​(java.lang.String virtualMachineName)
      • setOperation

        @Option(name="operation",
                description="operation type - [list|create|remove|revert]")
        public void setOperation​(java.lang.String operation)
      • setSnapshotname

        @Option(name="snapshotname",
                required=false,
                description="Name of the snapshot")
        public void setSnapshotname​(java.lang.String snapshotname)
      • setDescription

        @Option(name="description",
                required=false,
                description="description of the sanpshot")
        public void setDescription​(java.lang.String description)
      • setRemovechild

        @Option(name="removechild",
                required=false,
                description="remove snapshot children - [1 | 0]")
        public void setRemovechild​(java.lang.String removechild)
      • run

        @Action
        public void run()
                 throws com.vmware.vim25.InvalidPropertyFaultMsg,
                        com.vmware.vim25.TaskInProgressFaultMsg,
                        com.vmware.vim25.SnapshotFaultFaultMsg,
                        com.vmware.vim25.VmConfigFaultFaultMsg,
                        com.vmware.vim25.FileFaultFaultMsg,
                        com.vmware.vim25.InvalidStateFaultMsg,
                        com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                        com.vmware.vim25.InvalidNameFaultMsg,
                        com.vmware.vim25.RuntimeFaultFaultMsg,
                        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        Throws:
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg
        com.vmware.vim25.SnapshotFaultFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg