vmcontrol.pl - Performs poweron, poweroff, suspend and reset operations on the VM and reboot, shutdown and standby operations on the Guest OS.
vmcontrol.pl --operation <poweron|poweroff|suspend| reset|reboot|shutdown|standby> [options]
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.
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),
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. ipaddress of the VM machine
One cannot use ipaddress to poweron a VM as in poweredoff state ipaddress will not be recognised.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
Optional. Name of the virtual machine on which operation is to be performed.
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.
Name of the host for the virtual machine(s).
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. ipaddress of the VM machine.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. ipaddress of the VM machine.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. ipaddress of the VM machine.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
Atleast one criteria for selecting the VM's should be specified
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
Optional. Name of the virtual machine on which operation is to be performed.
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.
Optional. Name of the datacenter for the virtual machine(s). Operations will be performed on all the VMs under the given datacenter.
Optional. Name of the resource pool of the virtual machine(s). Operations will be performed on all the VMs under the given pool.
Optional. Name of the folder which contains the Virtual Machines
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
All operations supported on ESX 3.0.1
All operations supported on Virtual Center 2.0.1