NAME

vmcontrol.pl - Perform poweron, poweroff, suspend, reset, reboot, shutdown and standby operations on 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 on one or more virtual machines: powering on, powering off, resetting, rebooting, shutting down, suspending and setting into standby mode.


OPTIONS

GENERAL OPTIONS

operation

Operation to be performed. One of the following:

  <poweron> (power on one or more virtual machines),
  <poweroff> (power off one  or more virtual machines),
  <suspend> (suspend one or more virtual machines),
  <reboot> (reboot one or more guests),
  <reset> (reset one or more virtual machines),
  <shutdown> (shutdown one or more guests),
  <standby> (set to standby mode one or guests).

POWER OFF (UNLESS OPTION NAME)

url

URL of the VirtualCenter Server's web service, for example, --url https://192.168.111.2:443/sdk/webService

vmname

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

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

ipaddress

Optional. IP address of the virtual machine. You cannot use ipaddress to power on a virtual machine because a powered off virtual machine does not have an active IP address.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the virtual machines

POWER ON (UNLESS OPTION NAME)

vmname

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

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

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 virtual machines under the given datacenter.

pool

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

REBOOT OPTIONS

vmname

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

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

ipaddress

Optional. ipaddress of the virtual machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the virtual machines 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 the operation is to be performed.

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

ipaddress

Optional. ipaddress of the virtual machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the virtual machines 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 the operation is to be performed.

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

ipaddress

Optional. ipaddress of the virtual machine.

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the virtual machines

At least one criteria for selecting the virtual machines should be specified

SUSPEND OPTIONS

vmname

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

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

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

folder

Optional. Name of the folder which contain the virtual machines

RESET OPTIONS

vmname

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

guestos

Optional. Name of the virtual machine's guest operating system. For example, if you specify Windows, the operation is performed on all virtual machines running Windows

datacenter

Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the virtual machines under the given datacenter.

pool

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

folder

Optional. Name of the folder which contains the virtual machines


EXAMPLES

Power on a virtual machine

   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

Power off a virtual machine

    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