hostops.pl - Performs these operations: add standalone, disconnect, reconnect, enter maintenance mode, exit from maintenance mode, reboot, shutdown host, add host, remove host, and move host into folder/cluster.
hostops.pl --operation <disconnect|reconnect|enter_maintenance| exit_maintenance|reboot|shutdown|add_standalone| addhost|moveintofolder|moveintocluster|removehost> [options]
This script allows users to perform basic operations on the host server. The supported operations are: add_standalone, disconnect, reconnect, enter_maintenance, exit_maintenance, reboot, shutdown, addhost moveintofolder, moveintocluster, removehost.
Required. Operation to be performed must be one of the following:
shutdown – shutdown the host
reboot – reboot the host
enter_maintenance – set host into maintenance mode
exit_maintenance – exit the maintenance mode
disconnect – disconnect the host
reconnect – reconnect the host
add_standalone – add new host
addhost – add host to a cluster
moveintofolder – move host out of a cluster to a folder
moveintocluster – move host out of a folder to a cluster
removehost – remove move host
Required. Domain name or IP address of the target host.
Required. Username for logging into the VirtualCenter server to be added.
Required. Password for logging into the VirtualCenter server to be added.
Required. Domain name or IP address of the target host.
Required. Username for logging into the VirtualCenter server to be added.
Required. Password for logging into the VirtualCenter server to be added.
Required. Name of the cluster into which host is to be added.
Optional. Flag to specify whether or not to force the addition of host even if this is being managed by other virtual center.
Optional. Port number for the connection.
Required. Domain name or IP address of the target host.
Required. Folder name into which host is to be moved in from the cluster in the current datacenter.
Required. Domain name or iIP address of the target host.
Required. Cluster name into which host is to be moved in from the folder in the current datacenter.
Required. Domain name or IP address of the target host.
Required. Domain name or IP address of the target host.
Required. Domain name or IP address of the target host.
Required. Domain name or IP address of the target host.
Optional. Flag to specify whether or not to suspend to virtual machine.
Optional. Flag to specify whether or not to provide progress messages as the virtual machines are suspended for some operations.
Required. Domain name or IP address of the target host.
Required. Domain name or IP address of the target host.
Optional. Flag to specify whether or not to suspend to virtual machine.
Optional. Flag to specify whether or not to provide progress messages as the virtual machines are suspended for some operations.
Required. Domain name or IP address of the target host.
Optional. Flag to specify whether or not to suspend to virtual machine. Default: 0
Optional. Flag to specify whether or not to provide progress messages as the virtual machines are suspended for some operations. Default: 1
Shut down a host with progress messages. i.e ``quiet = 0'':
hostops.pl --username root --password esxadmin --operation shutdown --url https://<ipaddress>:<port>/sdk/webService --target_host targetABC --suspend 1 --quiet 0
Reboot a host with progress messages. i.e ``quiet = 0'':
hostops.pl --username root --password esxadmin --operation reboot --url https://<ipaddress>:<port>/sdk/webService --target_host targetABC --suspend 1 --quiet 0
Enter maintenance mode with no progress messages. i.e ``quiet = 1'':
hostops.pl --username root --password esxadmin --operation enter_maintenance --url https://<ipaddress>:<port>/sdk/webService --target_host targetABC --suspend 1 --quiet 1
Exit maintenance mode:
hostops.pl --username root --password esxadmin --operation exit_maintenance --url https://<ipaddress>:<port>/sdk/webService --target_host targetABC
Reconnect a host:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation reconnect
Disconnect a host:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation disconnect
Add standalone host, this host is already being managed by other virtual center use force option to add it to the given virtual center:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --target_username root --target_password esxadmin --operation add_standalone --force 1
Remove host:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation removehost
Add host to a cluster:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation addhost --cluster myCluster
Move host from cluster to a folder:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation moveintofolder --folder myFolder
Move host from folder to a cluster:
hostops.pl --url https://<ipaddress>:<port>/sdk/webService --username user --password mypassword --target_host targetABC --operation moveintocluster --cluster mycluster