Create Host
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 Host.CreateSpec.ThumbprintVerification.
Request
URLURL
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
{
"folder": "string",
"hostname": "string",
"password": "string",
"thumbprint_verification": "NONE",
"user_name": "string"
}
Host and cluster folder in which the new standalone host should be created. 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.
The administrator account on the host.
The IP address or DNS resolvable name of the host.
The password for the administrator account on the host.
The Host.CreateSpec.ThumbprintVerification enumerated type defines the thumbprint verification schemes for a host’s SSL certificate.
NONE : Accept the host’s thumbprint without verifying it.
THUMBPRINT : Host’s SSL certificate verified by checking its thumbprint against the specified thumbprint.
Possible values are: NONE , THUMBPRINT
The port of the host. If unset, port 443 will be used.
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. This field is optional and it is only relevant when the value of Host.CreateSpec.thumbprint-verification is THUMBPRINT.
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. If unset, forceAdd is default to false.
Authentication
Response
Response BodyResponse Body
The newly created identifier of the host in vCenter. The result will be an identifier for the resource type: HostSystem.
Errors
com.vmware.vapi.std.errors.already_exists : if the host with the same name is already present. | com.vmware.vapi.std.errors.invalid_argument : if the host name is invalid. if the host folder is invalid. if the SSL thumbprint specified is invalid. if the PEM SSL certificate in CreateSpec.sslCertificate is invalid. if both CreateSpec.thumbprint and CreateSpec.sslCertificate are set. if the CreateSpec.sslCertificate argument is not set, and the CreateSpec.thumbprint argument is set, but the SHA-1 hashing algorithm is currently disabled for computing certificate thumbprints. | com.vmware.vapi.std.errors.invalid_element_type : if the host folder id does not support vSphere compute resource as its children type. | com.vmware.vapi.std.errors.resource_in_use : if the host is already being managed by another vCenter Server | com.vmware.vapi.std.errors.unsupported : if the software version on the host is not supported.
com.vmware.vapi.std.errors.unauthenticated : if the user name or password for the administration account on the host are invalid. if the user can not be authenticated.
com.vmware.vapi.std.errors.unauthorized : if the user doesn’t have the required privileges.
com.vmware.vapi.std.errors.not_found : if there is no folder associated with the Host.CreateSpec.folder field in the system.
com.vmware.vapi.std.errors.error : if installation of VirtualCenter agent on a host fails. if the system reports an error while responding to the request. | com.vmware.vapi.std.errors.unable_to_allocate_resource : if there are not enough licenses to add the host.
com.vmware.vapi.std.errors.service_unavailable : if the system is unable to communicate with a service to complete the request.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/vcenter/host
x-vmw-doc-operation: create