vmcontrol.pl - poweron, poweroff, suspend, reset, reboot, shutdown and standby virtual machines.
vmcontrol.pl --operation <poweron|poweroff|suspend| reset|reboot|shutdown|standby> [options]
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.
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 of the Virtual Data Center
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 on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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.
Name of the host for the virtual machine(s).
Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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 on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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. ipaddress of the VM machine.
Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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. ipaddress of the VM machine.
Optional. Name of the datacenter for the virtual machine(s). Operations on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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 on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
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 on all the VMs in the given datacenter will be done.
Optional. Name of the resource pool of the virtual machine(s). Operations on all the VMs in the given pool will be done.
Optional. Name of the folder which contains the Virtual Machines
Atleast one criteria for selecting the VM's should be specified
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
All operations supported on ESX 3.0.1
All operations supported on Virtual Center 2.0.1