hostops.pl - Performs add_standalone, disconnect, reconnect, enter_maintenance, exit_maintenance, reboot, and shutdown
hostops.pl --operation <disconnect|reconnect|enter_maintenance|
exit_maintenance|reboot|shutdown|add_standalone> [options]
This scripts allows users to perform basic host operations. The supported operations are: add_standalone, disconnect, reconnect, enter_maintenance, exit_maintenance, reboot, and shutdown.
Operation to be performed. It is a mandatory field. One of the following: I<shutdown> (shutdown the host), I<reboot> (reboot the host ), I<enter_maintenance> (set host into maintenance mode), I<exit_maintenance> (exit the maintenance mode), I<disconnect> (disconnect the host from virtual center server), I<reconnect> (reconnect the host to virtual center server), I<add_standalone> (add new host to the virtual center server),
URL of the Virtual Data Center.
Username of the Host server
Password of the host server
Required. Domain name of the target_host i.e ESX server
Required. Username of the Host to be added.
Required. Password of the target host
Required. Domain name of the target_host i.e ESX server
Required. Username of the Host to be disconnected.
Required. Password of the target host
Required. Domain name of the target_host i.e ESX server
Required. Username of the Host to be reconnected.
Required. Password of the target host
Optional. Domain name of the target_host i.e ESX server. When we do this operation via Virtual Center then this is required
Optional. Username of the Host to be sent into maintenance mode.
Optional . Password of the target host
Optional. Domain name of the target_host i.e ESX server
Optional. Username of the Host to be exited from the maintenance mode. When we do this operation via Virtual Center then this is required
Optional . Password of the target host
Optional. Domain name of the target_host i.e ESX server. When we do this operation via Virtual Center then this is required
Optional. Username of the Host to be shutdown.
Optional . Password of the target host
Optional. Domain name of the target_host i.e ESX server When we do this operation via Virtual Center then this is required
Optional. Username of the Host rebooted.
Optional . Password of the target host
Shutdown a Host
hostops.pl --username root --password esxadmin --operation shutdown
--url https://192.168.111.2:443/sdk/webService
(Host must be in maintenance mode for this operation)
Reboot a Host
hostops.pl --username root --password esxadmin --operation reboot
--url https://192.168.111.2:443/sdk/webService
(Host must be in maintenance mode for this operation)
Enter in maintenance mode:
hostops.pl --username root --password esxadmin --operation enter_maintenance
--url https://192.168.111.2:443/sdk/webService
hostops.pl --url https://192.168.111.52:443/sdk/webService
--username manir --password mypassword --operation enter_maintenance
--target_host ESX.InterraIT.info --target_host 192.168.111.2
--target_username root --target_password esxadmin
Exit maintenance mode
hostops.pl --username root --password esxadmin --operation exit_maintenance
--url https://192.168.111.2:443/sdk/webService
Reconnect:
hostops.pl --url https://192.168.111.52:443/sdk/webService --username user
--password mypassword --target_host 192.168.111.2
--target_username root --target_password esxadmin --operation reconnect
Disconnect:
hostops.pl --url https://192.168.111.52:443/sdk/webService --username user
--password mypassword --target_host 192.168.111.2
--target_username root --target_password esxadmin --operation disconnect
Add Standalone:
hostops.pl --url https://192.168.111.52:443/sdk/webService --username user
--password mypassword --target_host 192.168.111.2
--target_username root --target_password esxadmin
--operation add_standalone
All operations supported via Virtual Data Center 2.0.1.
enter_maintenance, exit_maintenance, shutdown , reboot works with ESX Sever 3.0.1