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 command 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

OPERATION 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 more guests.

POWER OFF OPTIONS

url

URL of the VirtualCenter Server's web service, for example, --url https://<ipaddress>:<port>/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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

POWER ON 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

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

folder

Optional. Name of the folder which contains the virtual machines

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.

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

host

Optional. Name of the host which contains the virtual machines. Operation will be performed on all the vms under a host.


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
   vmcontrol.pl --username user --password mypassword
                --operation poweron --url https://<ipaddress>:<port>/sdk/webService
                --host ABC.BCD.XXX.XXX
   vmcontrol.pl --username user --password mypassword
                --operation poweron --url https://<ipaddress>:<port>/sdk/webService
                --folder folderName

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
    vmcontrol.pl --username root --password esxadmin
                 --url https://<ipaddress>:<port>/sdk/webService
                 --operation poweroff --host ABC.BCD.XXX.XXX

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
    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 VirtualCenter 2.0.1