The methods available for adding hosts to a cluster are useful under different circumstances. Each method returns a managed object reference to a task.
- ClusterComputeResource.AddHost_Task adds a host to the cluster. The host may be specified by a numeric IP address or a DNS resolvable name. If the cluster supports nested resource pools and you pass an optional resourcePool argument, the host's resource pool hierarchy is imported into the new nested resource pool. If a cluster does not support nested resource pools, the host resource pool hierarchy is discarded and all virtual machines on the host are added to the cluster's root resource pool.
- ClusterComputeResource.MoveInto_Task moves a host in the datacenter into a cluster, or from one cluster into another. The MoveHostInto_Task method is similar, with extra resourcePool parameter.
- Folder.BatchAddStandaloneHosts_Task adds a list of newHosts to the inventory as standalone hosts. This operation works though the list of hosts and returns, in the task result, a list of hosts that were successfully added.