Class FcdAssociateProfile


  • @Sample(name="fcd-associateprofile",
            description="This sample attaches a given virtual storage object(FCD) to the given virtual machine.")
    public class FcdAssociateProfile
    extends ConnectedServiceBase
     FcdAssociateProfile
    
     This sample attaches a virtual storage object to given virtual machine and
     associates a given storage profile to the virtual storage object.
    
     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
     vmpath                 [required] : Inventory path of the virtual machine
     datastorename          [required] : Name of the datastore which contains
                                         the virtual storage object
     profilename            [required] : Name of the storage profile
    
     Command Line:
     Attach a given virtual storage object to the given virtual machine.
     run.bat com.vmware.spbm.samples.FcdAssociateProfile --url [webserviceurl]
     --username [username] --password [password]
     --vstorageobjectid [vstorageobjectid] --vmpath [vmpath]
     --datastorename [datastorename] --profilename [profilename]
    
     Ex: vmpath ::
     <DatacenterName>/<HiddenFolder - "vm">/<VmName>
     ( testDC/vm/VM_Test1 )
     
    • Constructor Detail

      • FcdAssociateProfile

        public FcdAssociateProfile()
    • 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
      • setVmPath

        @Option(name="vmpath",
                required=true,
                description="Path of virtual machine.")
        public void setVmPath​(java.lang.String vmPath)
        Parameters:
        vmPath - the vmPath 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
      • setProfileName

        @Option(name="profilename",
                required=true,
                description="Name of the storage profile")
        public void setProfileName​(java.lang.String profileName)
        Parameters:
        profileName - the profileName 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.pbm.InvalidArgumentFaultMsg,
                        com.vmware.pbm.RuntimeFaultFaultMsg,
                        com.vmware.vim25.ConcurrentAccessFaultMsg,
                        com.vmware.vim25.DuplicateNameFaultMsg,
                        com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
                        com.vmware.vim25.InvalidNameFaultMsg,
                        com.vmware.vim25.TaskInProgressFaultMsg
        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.pbm.InvalidArgumentFaultMsg
        com.vmware.vim25.ConcurrentAccessFaultMsg
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg