Adding a Host to a Cluster

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 a cluster. The host name must be either an IP address, such as 192.168.0.1, or a DNS resolvable name. If the cluster supports nested resource pools and you specify the optional
    resourcePool
    argument, the host's root resource pool becomes the specified resource pool, and that resource pool and the associated hierarchy is added to the cluster.
    If a cluster does not support nested resource pools and you add a host to the cluster, the standalone host resource pool hierarchy is discarded and all virtual machines on the host are added to the cluster's root resource pool.
  • ClusterComputeResource.moveHostInto_Task
    moves a host that is in the same datacenter as the cluster into the cluster. If the host is already part of a different cluster, the host must be in maintenance mode.
  • ClusterComputeResource.moveInto_Task
    works like
    moveHostInto_Task,
    but supports an array of hosts at a time. When using this method, you cannot preserve the original resource pool hierarchy of the hosts.