Class HCIBatchAddHostAndExtendCluster


  • @Sample(name="HCIBatchAddHostAndExtendCluster",
            description="This sample code demonstrates how to call vSphere HCI API")
    public class HCIBatchAddHostAndExtendCluster
    extends ConnectedVimServiceBase
     HCIBatchAddHostAndExtendCluster
    
     This file includes sample codes for calling
     batchAddHost HCI API to add new hosts to cluster.
     At least four hosts are required for this sample.
    
     This example demonstrates how to call the vSphere HCI API via Vsphere SDK.
    
     Parameters:
     url          [required] : URL of the vCenter Web Service
     username     [required] : Username for the vCenter authentication
     password     [required] : Password for the vCenter authentication
     hostIps      [required] : IPs of the hosts to be added to the cluster
     hostUsername [required] : Username of the hosts
     hostPassword [required] : Password of the hosts
     createVlcmCluster [required] : Create a lifecycle managed cluster
     baseImageVersion  [optional] : Base image version in the desired software
                                    spec for the lifecycle managed cluster
     addOnName         [optional] : Name of the addon to include in the desired
                                    software spec for the lifecycle managed
                                    cluster
     addOnVersion      [optional] : Version of the addon to include in the desired
                                    software spec for the lifecycle managed
                                    cluster
     componentName     [optional] : Name of the component to include in the
                                    desired software spec for the lifecycle
                                    managed cluster
     componentVersion  [optional] : Version of the component to include in the
                                    desired software spec for the lifecycle
                                    managed cluster
    
     Command Line:
     run.bat com.vmware.hci.HCIBatchAddHostAndExtendCluster
        --url [webserviceurl]
        --username [username]
        --password [password]
        --hostIps [name]
        --hostUsername [hostUsername]
        --hostPassword [hostPassword]
        --createVlcmCluster [createVlcmCluster]
        --baseImageVersion [baseImageVersion]
        --addOnName [addOnName]
        --addOnVersion [addOnVersion]
        --componentName [componentName]
        --componentVersion [componentVersion]
     
    • Constructor Detail

      • HCIBatchAddHostAndExtendCluster

        public HCIBatchAddHostAndExtendCluster()
    • Method Detail

      • sethostIps

        @Option(name="hostIps",
                required=true,
                description="The IPs of the hosts, comma separated")
        public void sethostIps​(java.lang.String hostIps)
      • sethostUsername

        @Option(name="hostUsername",
                required=true,
                description="The username for the hosts to be added")
        public void sethostUsername​(java.lang.String hostUsername)
      • sethostPassword

        @Option(name="hostPassword",
                required=true,
                description="The password for the hosts to be added")
        public void sethostPassword​(java.lang.String hostPassword)
      • setCreateVlcmCluster

        @Option(name="createVlcmCluster",
                required=true,
                description="Create a lifecycle managed cluster")
        public void setCreateVlcmCluster​(java.lang.String createVlcmCluster)
      • setBaseImageVersion

        @Option(name="baseImageVersion",
                required=false,
                description="Base image version to create a lifecycle managed cluster")
        public void setBaseImageVersion​(java.lang.String baseImageVersion)
      • setAddOnName

        @Option(name="addOnName",
                required=false,
                description="Name of the addon to include with the base image to create a lifecycle managed cluster")
        public void setAddOnName​(java.lang.String addOnName)
      • setAddOnVersion

        @Option(name="addOnVersion",
                required=false,
                description="Version of the addon to include with the base image to create a lifecycle managed cluster")
        public void setAddOnVersion​(java.lang.String addOnVersion)
      • setComponentName

        @Option(name="componentName",
                required=false,
                description="Name of the component to include with the base image to create a lifecycle managed cluster")
        public void setComponentName​(java.lang.String componentName)
      • setComponentVersion

        @Option(name="componentVersion",
                required=false,
                description="Version of the component to include with the base image to create a lifecycle managed cluster")
        public void setComponentVersion​(java.lang.String componentVersion)
      • main

        @Action
        public void main()
                  throws com.vmware.vim25.NotFoundFaultMsg,
                         com.vmware.vim25.NotSupportedFaultMsg,
                         com.vmware.vim25.VsanFaultFaultMsg,
                         com.vmware.vim25.InvalidPropertyFaultMsg,
                         com.vmware.vim25.RuntimeFaultFaultMsg,
                         com.vmware.vim25.DuplicateNameFaultMsg,
                         com.vmware.vim25.HostConnectFaultFaultMsg,
                         com.vmware.vim25.InvalidNameFaultMsg,
                         com.vmware.vim25.InvalidLoginFaultMsg,
                         com.vmware.vim25.InvalidCollectorVersionFaultMsg
        This function demonstrate an HCI example to add hosts to cluster and extend the cluster. This function first demonstrates how to use batchAddHostsToCluster to add hosts into a cluster. Then we call configHCI to config the HCI cluster. Finally we call extendHCI to extend the existing cluster with a couple more hosts.
        Throws:
        com.vmware.vim25.NotFoundFaultMsg
        com.vmware.vim25.NotSupportedFaultMsg
        com.vmware.vim25.VsanFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.HostConnectFaultFaultMsg
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.InvalidLoginFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg