Class HostProfileManager


  • @Sample(name="host-profile-manager",
            description="demonstrates HostProfileManager and ProfileComplainceManager \n\nNOTE: this command may place a host into maintenance mode which will require VMs on the host to be suspended.\n\nCommand:\n\nCreate hostprofile given profileSourceHost (host system),  profileAttachEntity (host system), profileAttachEntityType (host system)\n\nApplies config after attaching hostprofile to  host system and check for compliance run.bat com.vmware.host.HostProfileManager --url [webserviceurl] --username [username] --password [password] --sourcehostname [host name] --entityname [host name] --entitytype HostSystem Create hostprofile given profileSourceHost (host system),  profileAttachEntity (cluster computer resource), profileAttachEntityType (cluster compute resource)\n\nAttaches hostprofile to all hosts in  cluster and checks for compliance \n\nrun.bat com.vmware.host.HostProfileManager --url [webserviceurl]--username [username] --password  [password]  --sourcehostname [host name] \n\n--entityname [Cluster] --entitytype ClusterComputeResource")
    public class HostProfileManager
    extends ConnectedVimServiceBase
     This sample demonstrates HostProfileManager and ProfileComplainceManager
    
     Parameters:
     url              [required] : url of the web service
     username         [required] : username for the authentication
     password         [required] : password for the authentication
     sourcehostname   [required] : Name of the host
     entityname       [required] : Attached Entity Name
     entitytype       [required] : Attached Entity Type
    
     Command Line:
     Create hostprofile given profileSourceHost (host system)
     profileAttachEntity (host system), profileAttachEntityType (host system)
     Applies config after attaching hostprofile to host system and check for compliance");
     run.bat com.vmware.host.HostProfileManager --url [webserviceurl]");
     --username [username] --password [password] --sourcehostname [host name]
     --entityname [host name] --entitytype HostSystem
    
     Create hostprofile given profileSourceHost (host system),
     profileAttachEntity (cluster computer resource), profileAttachEntityType
     (cluster compute resource)
     Attaches hostprofile to all hosts in cluster and checks for compliance
     run.bat com.vmware.host.HostProfileManager --url [webserviceurl]
     --username [username] --password  [password] --sourcehostname [host name]
     --entityname [Cluster] --entitytype ClusterComputeResource
     
    • Constructor Detail

      • HostProfileManager

        public HostProfileManager()
    • Method Detail

      • setCreateHostEntityName

        @Option(name="sourcehostname",
                description="Name of the host")
        public void setCreateHostEntityName​(java.lang.String createHostEntityName)
      • setAttachEntityName

        @Option(name="entityname",
                description="Attached Entity Name")
        public void setAttachEntityName​(java.lang.String attachEntityName)
      • setAttachEntityType

        @Option(name="entitytype",
                description="Attached Entity Type, example: HostSystem or ClusterComputeResource")
        public void setAttachEntityType​(java.lang.String attachEntityType)
      • exitMaintenanceMode

        public void exitMaintenanceMode​(com.vmware.vim25.ManagedObjectReference attachHostMoref)
                                 throws com.vmware.vim25.InvalidStateFaultMsg,
                                        com.vmware.vim25.RuntimeFaultFaultMsg,
                                        com.vmware.vim25.TimedoutFaultMsg,
                                        com.vmware.vim25.InvalidPropertyFaultMsg,
                                        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        Throws:
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.TimedoutFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
      • powerOnSuspendedGuestVMs

        public void powerOnSuspendedGuestVMs​(com.vmware.vim25.ManagedObjectReference attachHostMoref)
                                      throws com.vmware.vim25.InvalidPropertyFaultMsg,
                                             com.vmware.vim25.RuntimeFaultFaultMsg
        Throws:
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
      • suspendPoweredOnGuestVMs

        public void suspendPoweredOnGuestVMs​(com.vmware.vim25.ManagedObjectReference attachHostMoref)
                                      throws com.vmware.vim25.InvalidPropertyFaultMsg,
                                             com.vmware.vim25.RuntimeFaultFaultMsg
        Throws:
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
      • run

        @Action
        public void run()
                 throws com.vmware.vim25.DuplicateNameFaultMsg,
                        com.vmware.vim25.RuntimeFaultFaultMsg,
                        com.vmware.vim25.InvalidPropertyFaultMsg,
                        com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                        java.rmi.RemoteException,
                        com.vmware.vim25.HostConfigFailedFaultMsg,
                        com.vmware.vim25.InvalidStateFaultMsg,
                        com.vmware.vim25.TimedoutFaultMsg
        Throws:
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        java.rmi.RemoteException
        com.vmware.vim25.HostConfigFailedFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.TimedoutFaultMsg