NAME

hostops.pl - Performs add_standalone, disconnect, reconnect, enter_maintenance, exit_maintenance, reboot, and shutdown


SYNOPSIS

    hostops.pl --operation <disconnect|reconnect|enter_maintenance|
                 exit_maintenance|reboot|shutdown|add_standalone> [options]


DESCRIPTION

This scripts allows users to perform basic host operations. The supported operations are: add_standalone, disconnect, reconnect, enter_maintenance, exit_maintenance, reboot, and shutdown.


OPTIONS

GENERAL OPTIONS

operation
 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

URL of the Virtual Data Center.

username

Username of the Host server

password

Password of the host server

ADD STANDALONE OPTIONS

target_host

Required. Domain name of the target_host i.e ESX server

target_username

Required. Username of the Host to be added.

target_password

Required. Password of the target host

DISCONNECT HOST OPTIONS

target_host

Required. Domain name of the target_host i.e ESX server

target_username

Required. Username of the Host to be disconnected.

target_password

Required. Password of the target host

RECONNECT HOST OPTIONS

target_host

Required. Domain name of the target_host i.e ESX server

target_username

Required. Username of the Host to be reconnected.

target_password

Required. Password of the target host

ENTER MAINTENANCE MODE OPTIONS

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

target_username

Optional. Username of the Host to be sent into maintenance mode.

target_password

Optional . Password of the target host

EXIT MAINTENANCE MODE OPTIONS

target_host

Optional. Domain name of the target_host i.e ESX server

target_username

Optional. Username of the Host to be exited from the maintenance mode. When we do this operation via Virtual Center then this is required

target_password

Optional . Password of the target host

SHUTDOWN OPTIONS

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

target_username

Optional. Username of the Host to be shutdown.

target_password

Optional . Password of the target host

REBOOT OPTIONS

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

target_username

Optional. Username of the Host rebooted.

target_password

Optional . Password of the target host


EXAMPLES

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


SUPPORTED PLATFORMS

All operations supported via Virtual Data Center 2.0.1.

enter_maintenance, exit_maintenance, shutdown , reboot works with ESX Sever 3.0.1