Package com.vmware.hci
Class HCIBatchAddHostAndExtendCluster
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.hci.HCIBatchAddHostAndExtendCluster
-
@Sample(name="HCIBatchAddHostAndExtendCluster", description="This sample code demonstrates how to call vSphere HCI API") public class HCIBatchAddHostAndExtendCluster extends ConnectedVimServiceBaseHCIBatchAddHostAndExtendCluster 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]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description HCIBatchAddHostAndExtendCluster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmain()This function demonstrate an HCI example to add hosts to cluster and extend the cluster.voidsetAddOnName(java.lang.String addOnName)voidsetAddOnVersion(java.lang.String addOnVersion)voidsetBaseImageVersion(java.lang.String baseImageVersion)voidsetComponentName(java.lang.String componentName)voidsetComponentVersion(java.lang.String componentVersion)voidsetCreateVlcmCluster(java.lang.String createVlcmCluster)voidsethostIps(java.lang.String hostIps)voidsethostPassword(java.lang.String hostPassword)voidsethostUsername(java.lang.String hostUsername)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
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.InvalidCollectorVersionFaultMsgThis 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.NotFoundFaultMsgcom.vmware.vim25.NotSupportedFaultMsgcom.vmware.vim25.VsanFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.HostConnectFaultFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.InvalidLoginFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsg
-
-