Class FcdAttachToVM


  • @Sample(name="fcd-attachtovm",
            description="This sample attaches a given virtual storage object(FCD) to the given virtual machine.")
    public class FcdAttachToVM
    extends ConnectedVimServiceBase
     FcdAttachToVM
    
     This sample attaches a given virtual storage object to the given virtual
     machine.
    
     Parameters:
     url                    [required] : url of the web service
     username               [required] : username for the authentication
     password               [required] : password for the authentication
     vstorageobjectid       [required] : Uuid of the disk
     datastorename          [required] : Name of the datastore which contains
                                         the virtual storage object
     vmname                 [required] : Name of the virtual machine. A minimum
                                         virtual machine version of 'vmx-13' is
                                         required for the attach operation to
                                         succeed
     controllerkey          [optional] : Device Key of the controller the disk
                                         will connect to. It can be unset if
                                         there is only one controller (SCSI or
                                         SATA) with the available slot in the
                                         virtual machine. If there are multiple
                                         SCSI or SATA controllers available, user
                                         must specify the controller
     unitnumber             [optional] : Unit number of the virtual machine
     Command Line:
     Attach a given virtual storage object to the given virtual machine.
     run.bat com.vmware.vm.FcdAttachToVM --url [webserviceurl] --username [username]
     --password [password] --vstorageobjectid [vstorageobjectid] --vmname [vmname]
    
     Attach a given virtual storage object to the given virtual machine by specifying
     controller key and unit number.
     run.bat com.vmware.vm.FcdAttachToVM --url [webserviceurl] --username [username]
     --password [password] --vstorageobjectid [vstorageobjectid] --vmname [vmname]
     --controllerkey [controllerkey] --unitnumber [unitnumber]
     
    • Constructor Detail

      • FcdAttachToVM

        public FcdAttachToVM()
    • Method Detail

      • setVStorageObjectId

        @Option(name="vstorageobjectid",
                required=true,
                description="Uuid of the disk.")
        public void setVStorageObjectId​(java.lang.String vStorageObjectId)
        Parameters:
        vStorageObjectId - the vStorageObjectId to set
      • setDatastoreName

        @Option(name="datastorename",
                required=true,
                description="Name of datastore containing the vstorageobject.")
        public void setDatastoreName​(java.lang.String datastoreName)
        Parameters:
        datastoreName - the datastoreName to set
      • setVmName

        @Option(name="vmname",
                required=true,
                description="Name of virtual machine.")
        public void setVmName​(java.lang.String vmName)
        Parameters:
        vmName - the vmName to set
      • setControllerKey

        @Option(name="controllerkey",
                required=false,
                description="Device Key of the controller.")
        public void setControllerKey​(java.lang.String controllerKey)
        Parameters:
        controllerKey - the controllerKey to set
      • setUnitNumber

        @Option(name="unitnumber",
                required=false,
                description="Unit number of the virtual machine.")
        public void setUnitNumber​(java.lang.String unitNumber)
        Parameters:
        unitNumber - the unitNumber to set
      • run

        @Action
        public void run()
                 throws com.vmware.vim25.InvalidPropertyFaultMsg,
                        com.vmware.vim25.RuntimeFaultFaultMsg,
                        com.vmware.vim25.FileFaultFaultMsg,
                        com.vmware.vim25.InvalidDatastoreFaultMsg,
                        com.vmware.vim25.NotFoundFaultMsg,
                        com.vmware.vim25.InvalidControllerFaultMsg,
                        com.vmware.vim25.InvalidStateFaultMsg,
                        com.vmware.vim25.MissingControllerFaultMsg,
                        com.vmware.vim25.VmConfigFaultFaultMsg,
                        com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                        com.vmware.vim25.DeviceUnsupportedForVmVersionFaultMsg
        Throws:
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        com.vmware.vim25.InvalidDatastoreFaultMsg
        com.vmware.vim25.NotFoundFaultMsg
        com.vmware.vim25.InvalidControllerFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.MissingControllerFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        com.vmware.vim25.DeviceUnsupportedForVmVersionFaultMsg