NAME

vmcontrol.pl - Performs poweron, poweroff, suspend and reset operations on the VM and reboot, shutdown and standby operations on the Guest OS.


SYNOPSIS

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


DESCRIPTION

This VI Perl command-line utility provides an interface for common provisioning operations: poweron, poweroff, reset and suspend one or more Virtual Machines and reboot, shutdown, standby guest OS running the VMs.


OPTIONS

GENERAL OPTIONS

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

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 will be performed on all the VMs under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the Virtual Machines

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 will be performed on all the VMs under the given datacenter.

pool

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

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 will be performed on all the VMs under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the Virtual Machines

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 will be performed on all the VMs under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the Virtual Machines

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 will be performed on all the VMs under the given datacenter.

pool

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

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 will be performed on all the VMs under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the Virtual Machines

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 will be performed on all the VMs under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the Virtual Machines


EXAMPLES

Poweron a VM

   vmcontrol.pl --username root --password esxadmin --operation poweron
                --vmname VM3 --url https://<ipaddress>:<port>/sdk/webService
   vmcontrol.pl --username root --password esxadmin
                --operation poweron --guestos Windows
                --url https://<ipaddress>:<port>/sdk/webService
   vmcontrol.pl --username root --password esxadmin
                  --vmname VM1 --guestos Windows --operation poweron
                  --https://<ipaddress>:<port>/sdk/webService
   vmcontrol.pl --username root --password esxadmin --operation poweron
                 --pool poolName --url https://<ipaddress>:<port>/sdk/webService
   vmcontrol.pl --username root --password esxadmin
                --url https://<ipaddress>:<port>/sdk/webService
                 --operation poweron --folder folderName
   vmcontrol.pl --username user --password mypassword --operation poweron
                  --url https://<ipaddress>:<port>/sdk/webService  --pool Zod
   vmcontrol.pl --username user --password mypassword
                    --operation poweron --url https://<ipaddress>:<port>/sdk/webService
                  --datacenter Dracula

Poweroff a VM

    vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --vmname VM3 --url https://<ipaddress>:<port>/sdk/webService
    vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --guestos Windows --url https://<ipaddress>:<port>/sdk/webService
    vmcontrol.pl --username root --password esxadmin --vmname VM1 
                    --guestos Windows --operation poweroff
                    --url https://<ipaddress>:<port>/sdk/webService
    vmcontrol.pl --username root --password esxadmin --operation poweroff
                    --pool poolName --url https://<ipaddress>:<port>/sdk/webService
    vmcontrol.pl --username root --password esxadmin --operation poweroff 
                    --folder folderName --url https://<ipaddress>:<port>/sdk/webService
    vmcontrol.pl --username root --password esxadmin
                  --url https://<ipaddress>:<port>/sdk/webService
                    --operation poweroff --ipaddress IP
     vmcontrol.pl --username user --password mypassword --vmname VM2
                    --operation poweroff --url https://<ipaddress>:<port>/sdk/webService

Reboot

    vmcontrol.pl --username root --password esxadmin
                    --operation reboot --vmname VM3
                  --url https://<ipaddress>:<port>/sdk/webService

Shutdown

    vmcontrol.pl --username root --password esxadmin --operation shutdown
                    --vmname VM3 --url https://<ipaddress>:<port>/sdk/webService

Reset

    vmcontrol.pl --username root --password esxadmin --operation reset
                    --vmname VM3
    vmcontrol.pl --username user --password mypassword --vmname VM2
                    --operation reset --url https://<ipaddress>:<port>/sdk/webService

Standby

    vmcontrol.pl --username root --password esxadmin --operation standby
                    --vmname VM3 --url https://<ipaddress>:<port>/sdk/webService

Suspend

    vmcontrol.pl --username root --password esxadmin --operation suspend
                    --vmname VM3 --url https://<ipaddress>:<port>/sdk/webService
   perl vmcontrol.pl --username user --password mypassword --vmname VM2
                    --operation suspend --url https://<ipaddress>:<port>/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