vmtemplate.pl - Convert virtual machine to a template and vice-versa.
vmtemplate.pl --url <web service URL> --username <server login name>
--password <server login password> --vmname <virtual machine name>
--operation <T|VM> [--pool <resource pool name>]
[--host <host name>]
This VI Perl command-line utility provides an interface for converting an existing virtual machine to a template and vice versa.
Required. Operation to be performed. Must be one of the following: I<T> (convert virtual machine to template). I<VM> (convert template to virtual machine).
Required. The name of the virtual machine which is to be re-associated with a host and a resource pool.
Required. Resource pool to associate with the virtual machine.
Optional. The target host on which the virtual machine is intended to run. The value of the host option should be exactly same as defined in the VI client. For a stand-alone host , it can be omitted and the script selects the default.
Required. The name of the virtual machine which is to be converted to a template.
Convert a virtual machine named 'VirtualABC' to a template :
vmtemplate.pl --url https://192.168.111.52:443/sdk/webService
--username administrator --password mypassword
--vmname VirtualABC --operation T
Convert a template to virtual machine named 'VirtualABC'. Let 'Poolxyz' be the resource pool to be associated with this virtual machine and 'BlueHost' be the host on which the virtual machine is intended to run:
vmtemplate.pl --url https://192.168.111.52:443/sdk/webService
--username administrator --password mypassword
--vmname VirtualABC --operation VM --pool Poolxyz
--host BlueHost
Convert a template to virtual machine named 'VirtualABC'. Let 'Poolxyz' be the resource pool to be associated with this virtual machine and no host specified (default host will be selected in this case):
vmtemplate.pl --url https://192.168.111.52:443/sdk/webService
--username administrator --password mypassword
--vmname VirtualABC --operation VM --pool Poolxyz
All operations work with VMware VirtualCenter 2.0.1
No operation work when VMware ESX Server 3.0.1 directly accessed.