NAME

vmcontrol.pl - poweron, poweroff, suspend, reset, reboot, shutdown and standby virtual machines.


SYNOPSIS

vmcontrol.pl --operation <poweron|poweroff|suspend| reset|reboot|shutdown|standby> [options]


DESCRIPTION

This VI Perl command-line utility provides an interface for seven common provisioning operations: powering, poweringoff, resetting, rebooting, shutting down, suspending and setting into standby mode on one or many Virtual Machines.


OPTIONS

GENERAL OPTIONS

operation

Operation to be performed. One of the following: poweron (poweron one or more virtual machines), poweroff (poweron one or more virtual machines, suspend (suspend one or more virtual machines), reboot (reboot one or more virtual machines), reset (reset one or more virtual machines), shutdown (shutdown one or more virtual machines), standby (set to standby mode one or more virtual machines)

url

URL of the Virtual Data Center

POWEROFF OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

ipaddress

Optional. ipaddress of the VM machine

One cannot use ipaddress to poweron a VM as in poweredoff state ipaddress will not be recognised.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified

POWERON OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

host

Name of the host for the virtual machine(s).

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

REBOOT OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

ipaddress

Optional. ipaddress of the VM machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified

SHUTDOWN OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

ipaddress

Optional. ipaddress of the VM machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified

STANDBY OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

ipaddress

Optional. ipaddress of the VM machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified

SUSPEND OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified

RESET OPTIONS

vmname

Optional. Name of the virtual machine on which operation is to be performed.

guestos

Optional. Name of the guestos of the VM machine. If Windows is given operation on all the machines having Windows as OS will be done.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.

folder

Optional. Name of the folder which contains the Virtual Machines

Atleast one criteria for selecting the VM's should be specified


EXAMPLES

Poweron a VM

   perl vmcontrol.pl --username root --password esxadmin --operation poweron 
                --vmname VM3 --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin
                --operation poweron --guestos Windows
   perl vmcontrol.pl --username root --password esxadmin
                  --vmname VM1 --guestos Windows --operation poweron
   perl vmcontrol.pl --username root --password esxadmin --operation poweron
                 --pool poolName --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin
                 --operation poweron --folder folderName
 Via Virtual Center:
   perl vmcontrol.pl --username manir --password mypassword --vmname VM2 
                  --operation poweron --url https://192.168.111.52:443/sdk/webService
   perl vmcontrol.pl --username manir --password mypassword --operation poweron 
                  --url https://192.168.111.52:443/sdk/webService  --pool Zod
   perl vmcontrol.pl --username manir --password mypassword
                    --operation poweron --url https://192.168.111.52:443/sdk/webService
                  --datacenter Dracula

Poweroff a VM

   perl vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --vmname VM3 --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --guestos Windows --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin --vmname VM1 
                    --guestos Windows --operation poweroff
                    --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --pool poolName --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin --operation poweroff 
                    --folder folderName --url https://192.168.111.2:443/sdk/webService
   perl vmcontrol.pl --username root --password esxadmin
                    --operation poweroff --ipaddress 192.168.111.55
 Via Virtual Center:
   perl vmcontrol.pl --username manir --password mypassword --vmname VM2 
                    --operation poweroff --url https://192.168.111.52:443/sdk/webService

Reboot

   perl vmcontrol.pl --username root --password esxadmin
                    --operation reboot --vmname VM3
                  --url https://192.168.111.2:443/sdk/webService

Shutdown

   perl vmcontrol.pl --username root --password esxadmin --operation shutdown
                    --vmname VM3

Reset

   perl vmcontrol.pl --username root --password esxadmin --operation reset
                    --vmname VM3
   perl vmcontrol.pl --username manir --password mypassword --vmname VM2 
                    --operation reset --url https://192.168.111.52:443/sdk/webService

Standby

   perl vmcontrol.pl --username root --password esxadmin --operation standby
                    --vmname VM3

Suspend

   perl vmcontrol.pl --username root --password esxadmin --operation suspend
                    --vmname VM3
   perl vmcontrol.pl --username manir --password mypassword --vmname VM2 
                    --operation suspend --url https://192.168.111.52:443/sdk/webService
 Follow the same pattern for other operations :
 reset , shutdown, reboot, standby, suspend like in poweron and poweroff


SUPPORTED PLATFORMS

All operations supported on ESX 3.0.1

All operations supported on Virtual Center 2.0.1