Cluster Compute Resource Add Host Task

Cluster Compute Resource Add Host Task

Adds a host to the cluster.

The hostname must be either an IP address, such as 192.168.0.1, or a DNS resolvable name. DNS names may be fully qualified names, such as host1.domain1.com, or a short name such as host1, providing host1 resolves to host1.domain1.com. The system uses DNS to resolve short names to fully qualified names. If the cluster supports nested resource pools and the user specifies the optional ResourcePool argument, then the host's root resource pool becomes the specified resource pool. The stand-alone host resource hierarchy is imported into the new nested resource pool.

If the cluster does not support nested resource pools, then the stand-alone host resource hierarchy is discarded and all virtual machines on the host are put under the cluster's root resource pool.

In addition to the Host.Inventory.AddHostToCluster and Resource.AssignVMToPool privileges, it requires System.View privilege on the VM folder that the VMs of the host will be placed on.

Required privileges: Host.Inventory.AddHostToCluster

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/ClusterComputeResource/{moId}/AddHost_Task
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case ClusterComputeResource/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
AddHostRequestType of type(s) application/json
Required
{
    "spec": {
        "_typeName": "string",
        "hostName": "string",
        "port": 0,
        "sslThumbprint": "string",
        "userName": "string",
        "password": "string",
        "vmFolder": {
            "_typeName": "string",
            "type": "string",
            "value": "string"
        },
        "force": false,
        "vimAccountName": "string",
        "vimAccountPassword": "string",
        "managementIp": "string",
        "lockdownMode": "string",
        "hostGateway": {
            "_typeName": "string",
            "gatewayType": "string",
            "gatewayId": "string",
            "trustVerificationToken": "string",
            "hostAuthParams": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": "string"
                }
            ]
        }
    },
    "asConnected": false,
    "resourcePool": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "license": "string"
}
spec
Required

Specifies the parameters needed to add a single host.

This includes a small set of optional information about the host configuration. This allows the network and datastore configuration of the host to be synchronized with the naming conventions of the datacenter, as well as the configuration of a vim account (the username/password for the virtual machine files that is created on disk).

boolean
asConnected
Required

Flag to specify whether or not the host should be connected immediately after it is added. The host will not be added if a connection attempt is made and fails.

resourcePool
Optional

Reference to an instance of the ResourcePool managed object.

string
license
Optional

Provide a licenseKey or licenseKeyType. See LicenseManager

Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the newly added HostSystem upon success.

Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidLogin: if "asConnected" is specified but authentication with the new host fails.

HostConnectFault: if an error occurred when connecting to a host. Typically, a more specific subclass, such as AlreadyBeingManaged, is thrown.

AlreadyBeingManaged: if the host is already being managed by a VirtualCenter server.

NotEnoughLicenses: if no licenses are available to add this host.

NoHost: if the host cannot be contacted.

NotSupportedHost: if the host is running a software version that does not support clustering features. It may still be possible to add the host as a stand-alone host.

TooManyHosts: if no additional hosts can be added to the cluster.

AgentInstallFailed: if there is an error installing the VirtualCenter agent on the host.

AlreadyConnected: if asConnected is true and the host is already connected to VirtualCenter.

SSLVerifyFault: if the host certificate could not be authenticated

DuplicateName: if another host in the same cluster has the name.

NoPermission: if there are crypto keys to be sent to the host, but the user does not have Cryptographer.RegisterHost privilege on the Cluster.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}

Cluster Compute Resource Operations
POST
Cluster Compute Resource Abandon Hci Workflow
POST
Cluster Compute Resource Add Host Task
POST
Cluster Compute Resource Apply Recommendation
POST
Cluster Compute Resource Cancel Recommendation
POST
Cluster Compute Resource Cluster Enter Maintenance Mode
POST
Cluster Compute Resource Configure HCI Task
POST
Cluster Compute Resource Destroy Task
POST
Cluster Compute Resource Evc Manager
POST
Cluster Compute Resource Extend HCI Task
POST
Cluster Compute Resource Find Rules For Vm
GET
Cluster Compute Resource Get Action History
GET
Cluster Compute Resource Get Alarm Actions Enabled
GET
Cluster Compute Resource Get Available Field
GET
Cluster Compute Resource Get Config Issue
GET
Cluster Compute Resource Get Config Manager Enabled
GET
Cluster Compute Resource Get Config Status
GET
Cluster Compute Resource Get Configuration
GET
Cluster Compute Resource Get Configuration Ex
GET
Cluster Compute Resource Get Custom Value
GET
Cluster Compute Resource Get Datastore
GET
Cluster Compute Resource Get Declared Alarm State
GET
Cluster Compute Resource Get Disabled Method
GET
Cluster Compute Resource Get Drs Fault
GET
Cluster Compute Resource Get Drs Recommendation
GET
Cluster Compute Resource Get Effective Role
GET
Cluster Compute Resource Get Environment Browser
GET
Cluster Compute Resource Get Hci Config
GET
Cluster Compute Resource Get Host
GET
Cluster Compute Resource Get Lifecycle Managed
GET
Cluster Compute Resource Get Migration History
GET
Cluster Compute Resource Get Name
GET
Cluster Compute Resource Get Network
GET
Cluster Compute Resource Get Overall Status
GET
Cluster Compute Resource Get Parent
GET
Cluster Compute Resource Get Permission
GET
Cluster Compute Resource Get Recent Task
GET
Cluster Compute Resource Get Recommendation
GET
Cluster Compute Resource Get Resource Pool
POST
Cluster Compute Resource Get Resource Usage
GET
Cluster Compute Resource Get Summary
GET
Cluster Compute Resource Get Summary Ex
POST
Cluster Compute Resource Get System V Ms Restricted Datastores
GET
Cluster Compute Resource Get Tag
GET
Cluster Compute Resource Get Triggered Alarm State
GET
Cluster Compute Resource Get Value
POST
Cluster Compute Resource Move Host Into Task
POST
Cluster Compute Resource Move Into Task
POST
Cluster Compute Resource Place Vm
POST
Cluster Compute Resource Recommend Hosts For Vm
POST
Cluster Compute Resource Reconfigure Cluster Task
POST
Cluster Compute Resource Reconfigure Compute Resource Task
POST
Cluster Compute Resource Refresh Recommendation
POST
Cluster Compute Resource Reload
POST
Cluster Compute Resource Rename Task
POST
Cluster Compute Resource Retrieve Das Advanced Runtime Info
POST
Cluster Compute Resource Set Crypto Mode
POST
Cluster Compute Resource Set Custom Value
POST
Cluster Compute Resource Stamp All Rules With Uuid Task
POST
Cluster Compute Resource Validate HCI Configuration