VMware

Host Namespace

The Host namespace provides commands to manage hosts in the vCenter Server.

List of commands:



Create Command

dcli com vmware vcenter host create

Description

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.

Options

Option Name Type Required Description
hostname string Yes The IP address or DNS resolvable name of the host.
port int No The port of the host. If unset, port 443 will be used.
user‑name string Yes The administrator account on the host.
password string Yes The password for the administrator account on the host.
folder string No Host and cluster folder in which the new standalone host should be created. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Folder. When commands return a value of this class as a output, the option will be an identifier for the resource type: Folder. This option is currently required. In the future, if this option 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.
thumbprint‑verification string Yes Type of host's SSL certificate verification to be done. Valid values are: {NONE, THUMBPRINT}
thumbprint string No 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 option is optional and it is only relevant when the value of thumbprintVerification is THUMBPRINT.
force‑add bool No 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.

Example

dcli com vmware vcenter host create --hostname testString --user-name testString --password --thumbprint-verification test


Delete Command

dcli com vmware vcenter host delete

Description

Remove a standalone host from the vCenter Server.

Options

Option Name Type Required Description
host string Yes Identifier of the host to be deleted. The parameter must be an identifier for the resource type: HostSystem.

Example

dcli com vmware vcenter host delete --host testId


List Command

dcli com vmware vcenter host list

Description

Returns information about at most 1000 visible (subject to permission checks) hosts in vCenter matching the Host.FilterSpec.

Options

Option Name Type Required Description
hosts string No Identifiers of hosts that can match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: HostSystem. When commands return a value of this class as a output, the option will contain identifiers for the resource type: HostSystem. If unset or empty, hosts with any identifier match the filter.
names string No Names that hosts must have to match the filter (see Host.Summary.name). If unset or empty, hosts with any name match the filter.
folders string No Folders that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: Folder. When commands return a value of this class as a output, the option will contain identifiers for the resource type: Folder. If unset or empty, hosts in any folder match the filter.
datacenters string No Datacenters that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: Datacenter. When commands return a value of this class as a output, the option will contain identifiers for the resource type: Datacenter. If unset or empty, hosts in any datacenter match the filter.
standalone bool No If true, only hosts that are not part of a cluster can match the filter, and if false, only hosts that are are part of a cluster can match the filter. If unset Hosts can match filter independent of whether they are part of a cluster or not. If this field is true and Host.FilterSpec.clusters os not empty, no hosts will match the filter.
clusters string No Clusters that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: ClusterComputeResource. When commands return a value of this class as a output, the option will contain identifiers for the resource type: ClusterComputeResource. If unset or empty, hosts in any cluster and hosts that are not in a cluster match the filter. If this option is not empty and Host.FilterSpec.standalone is true, no hosts will match the filter.
connection‑states string No Connection states that a host must be in to match the filter (see Host.Summary.connection-state. If unset or empty, hosts in any connection state match the filter. Valid values are: {CONNECTED, DISCONNECTED, NOT_RESPONDING}

Example

dcli com vmware vcenter host list


Connect Command

dcli com vmware vcenter host connect

Description

Connect to the host corresponding to host previously added to the vCenter server.

Options

Option Name Type Required Description
host string Yes Identifier of the host to be reconnected. The parameter must be an identifier for the resource type: HostSystem.

Example

dcli com vmware vcenter host connect --host testId


Disconnect Command

dcli com vmware vcenter host disconnect

Description

Disconnect the host corresponding to host from the vCenter server

Options

Option Name Type Required Description
host string Yes Identifier of the host to be disconnected. The parameter must be an identifier for the resource type: HostSystem.

Example

dcli com vmware vcenter host disconnect --host testId