vcenter host: create
Add a new standalone host in the vCenter inventory. The newly connected host will be in connected state. The vCenter Server will verify the SSL certificate before adding the host to its inventory. In the case where the SSL certificate cannot be verified because the Certificate Authority is not recognized or the certificate is self signed, the vCenter Server will fall back to thumbprint verification mode as defined by vcenter.host.create_spec.thumbprint_verification.
Request:
HTTP request
POST https://{server}/rest/vcenter/host
Request Body Structure:
{
"spec": {
"folder": "obj-103",
"force_add": true,
"hostname": "string",
"password": "secret string",
"port": 1,
"thumbprint": "string",
"thumbprint_verification": "NONE",
"user_name": "string"
}
}
"spec": {
"folder": "obj-103",
"force_add": true,
"hostname": "string",
"password": "secret string",
"port": 1,
"thumbprint": "string",
"thumbprint_verification": "NONE",
"user_name": "string"
}
}
Request Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
spec | create_spec | Specification for the new host to be created. |
spec.hostname | string | The IP address or DNS resolvable name of the host. |
spec.port | long | The port of the host. Optional. If unset, port 443 will be used. |
spec.user_name | string | The administrator account on the host. |
spec.password | secret | The password for the administrator account on the host. |
spec.folder | string | Host and cluster folder in which the new standalone host should be created. Optional. This field is currently required. In the future, if this field is unset, the system will attempt to choose a suitable folder for the host; if a folder cannot be chosen, the host creation operation will fail.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Folder . When operations return a value of this structure as a result, the field will be an identifier for the resource type: Folder . |
spec.thumbprint_verification | string | Type of host's SSL certificate verification to be done. Defines the thumbprint verification schemes for a host's SSL certificate. Value is one of: NONE: Accept the host's thumbprint without verifying it. THUMBPRINT: Host's SSL certificate verified by checking its thumbprint against the specified thumbprint. |
spec.thumbprint | string | The thumbprint of the SSL certificate, which the host is expected to have. The thumbprint is always computed using the SHA1 hash and is the string representation of that hash in the format: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx where, 'x' represents a hexadecimal digit. Optional. It is only relevant when thumbprint_verification has value THUMBPRINT. This field is optional and it is only relevant when the value of thumbprint_verification is THUMBPRINT. |
spec.force_add | boolean | Whether host should be added to the vCenter Server even if it is being managed by another vCenter Server. The original vCenterServer loses connection to the host. Optional. If unset, forceAdd is default to false. |
Response:
HTTP Status Code: 200
Representation:
{
"value": "obj-103"
}
"value": "obj-103"
}
Response Type:
Name | Type | Description |
---|---|---|
bold = required | ||
value | string | The newly created identifier of the host in vCenter. |
Errors:
HTTP Status Code | Type | Description |
---|---|---|
400 | already_exists | if the host with the same name is already present. |
500 | error | if installation of VirtualCenter agent on a host fails. |
400 | invalid_argument | if the host name is invalid. |
400 | invalid_element_type | if the host folder id does not support vSphere compute resource as its children type. |
404 | not_found | if there is no folder associated with the folder field in the system. |
400 | resource_in_use | if the host is already being managed by another vCenter Server |
400 | unable_to_allocate_resource | if there are not enough licenses to add the host. |
401 | unauthenticated | if the user name or password for the administration account on the host are invalid. |
400 | unsupported | if the software version on the host is not supported. |
503 | service_unavailable | if the system is unable to communicate with a service to complete the request. |
403 | unauthorized | if the user doesn't have the required privileges. |