Class VMClone


  • @Sample(name="vm-clone",
            description="This sample makes a clone of an existing VM to a new VM andassociates it with the specified storage profile. Note: This sampledoes not relocate the vm disks. Thus, the clone VM may or may not becompliant with the given storage profile.")
    public class VMClone
    extends ConnectedServiceBase
     VMClone
    
     This sample makes a clone of an existing VM to a new VM and
     associates it with the specified storage profile. Note: This sample
     does not relocate the vm disks. Thus, the clone may or may not be
     compliant with the given storage profile.
    
     Parameters:
     url             [required] : url of the web service
     username        [required] : username for the authentication
     password        [required] : password for the authentication
     datacentername  [required] : name of Datacenter
     vmpath          [required] : inventory path of the VM
     clonename       [required] : name of the clone
     profilename     [required] : name of the storage profile
    
     Command Line:
     java com.vmware.vm.VMClone --url [webserviceurl]
     --username [username] --password [password]
     --datacentername [DatacenterName]"
     --vmpath [vmPath] --clonename [CloneName]
     --profilename [Profile Name]
     
    • Constructor Detail

      • VMClone

        public VMClone()
    • Method Detail

      • run

        @Action
        public void run()
                 throws com.vmware.vim25.RuntimeFaultFaultMsg,
                        com.vmware.vim25.TaskInProgressFaultMsg,
                        com.vmware.vim25.VmConfigFaultFaultMsg,
                        com.vmware.vim25.InvalidDatastoreFaultMsg,
                        com.vmware.vim25.FileFaultFaultMsg,
                        java.lang.NoSuchMethodException,
                        com.vmware.vim25.MigrationFaultFaultMsg,
                        com.vmware.vim25.InvalidStateFaultMsg,
                        com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                        java.lang.IllegalAccessException,
                        com.vmware.vim25.CustomizationFaultFaultMsg,
                        com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
                        java.lang.reflect.InvocationTargetException,
                        com.vmware.vim25.InvalidPropertyFaultMsg,
                        com.vmware.pbm.InvalidArgumentFaultMsg,
                        com.vmware.pbm.RuntimeFaultFaultMsg,
                        com.vmware.pbm.PbmFaultFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.InvalidDatastoreFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        java.lang.NoSuchMethodException
        com.vmware.vim25.MigrationFaultFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        java.lang.IllegalAccessException
        com.vmware.vim25.CustomizationFaultFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        java.lang.reflect.InvocationTargetException
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.pbm.InvalidArgumentFaultMsg
        com.vmware.pbm.PbmFaultFaultMsg
      • setCloneName

        @Option(name="clonename",
                description="name of the clone")
        public void setCloneName​(java.lang.String cloneName)
      • setDataCenterName

        @Option(name="datacentername",
                description="name of Datacenter")
        public void setDataCenterName​(java.lang.String dataCenterName)
      • setProfileName

        @Option(name="profilename",
                description="Name of the storage profile",
                required=true)
        public void setProfileName​(java.lang.String profileName)
      • setVmPathName

        @Option(name="vmpath",
                description="inventory path of the VM")
        public void setVmPathName​(java.lang.String vmPathName)