Package com.vmware.vm

Class VMManageCD


  • @Sample(name="vm-manage-cd",
            description="This sample adds / removes CDROM to / from an existing VM\nThis sample lists information about a VMs CDROMs\nThis sample updates an existing CDROM a VM\n")
    public class VMManageCD
    extends ConnectedVimServiceBase
     VMManageCD
    
     This sample adds / removes CDROM to / from an existing VM
     This sample lists information about a VMs CDROMs
     This sample updates an existing CDROM a VM
    
     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 - [get|add|remove|set]
     isopath           [optional] : full datastore path to the iso file
     remote            [optional] : Specify the device is a remote or client device or iso
     startconnected    [optional] : virtual CD starts connected when VM powers on
     connect           [optional] : virtual CD is connected after creation or update
                                    Set only if VM is powered on
     label             [optional] : used to find the device.key value
     devicename        [optional] : Specify the path to the CD on the VM's host
    
     Command Line:
     Get CD-Rom Info");
     run.bat com.vmware.vm.VMManageCD
     --url [webserviceurl] --username [username] --password [password]
     --operation get --vmname [Virtual Machine Name]
    
     Add CD-Rom
     run.bat com.vmware.vm.VMManageCD
     --url [webserviceurl] --username [username] --password  [password]
     --operation add --vmname [Virtual Machine Name]
     --isoPath "[datastore1] test.iso" --remote false --connect true
    
     Remove CD-Rom
     run.bat com.vmware.vm.VMManageCD
     --url [webserviceurl] --username [username] --password  [password]
     --operation remove --vmname [Virtual Machine Name]
     --label CD\\DVD Drive 1
    
     Reconfigure CD-Rom
     run.bat com.vmware.vm.VMManageCD
     --url [webserviceurl] --username [username] --password  [password]
     --operation set --vmname [Virtual Machine Name]
     --label CD\\DVD Drive 1 --connect false
     
    • Constructor Detail

      • VMManageCD

        public VMManageCD()
    • Method Detail

      • setVirtualMachineName

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

        @Option(name="operation",
                description="operation type - [get|add|remove|set]")
        public void setOperation​(java.lang.String operation)
      • setIsoPath

        @Option(name="isopath",
                required=false,
                description="full datastore path to the iso file")
        public void setIsoPath​(java.lang.String path)
      • setRemote

        @Option(name="remote",
                required=false,
                description="Specify the device is a remote or client device or iso")
        public void setRemote​(java.lang.String remote)
      • setStartConnected

        @Option(name="startconnected",
                required=false,
                description="virtual CD starts connected when VM powers on")
        public void setStartConnected​(java.lang.String setting)
      • setConnect

        @Option(name="connect",
                required=false,
                description="virtual CD is connected after creation or update\nSet only if VM is powered on")
        public void setConnect​(java.lang.String setting)
      • setLabelName

        @Option(name="label",
                required=false,
                description="used to find the device.key value")
        public void setLabelName​(java.lang.String name)
      • setDeviceName

        @Option(name="devicename",
                required=false,
                description="Specify the path to the CD on the VM\'s host")
        public void setDeviceName​(java.lang.String name)
      • run

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