vmclone.pl - Perform clone operation on virtual machine and customize operation on both virtual machine and the guest.
vmclone.pl [options]
VI Perl command-line utility allows you to clone a virtual machine. You can customize the virtual machine or the guest operating system as part of the clone operation.
Required. Name of the host containing the virtual machine.
Required. Name of the virtual machine whose clone is to be created.
Required. Name of the clone virtual machine which will be created.
Optional. Name of a data center. If none is given, the script uses the default data center.
Required. Customize guest is used to customize the network settings of the guest operating system. Options are Yes/No.
Required. It is the name of the file in which values of parameters to be customized is written e.g. --filename clone_vm.xml.
Required. It is the name of the schema which validates the filename.
Required. customize_vm is used to customize the virtual machine settings like disksize, memory. If yes is written it will be customized.
Required. It is the name of the file in which values of parameters to be customized is written e.g. --filename clone_vm.xml.
Required. It is the name of the schema which validates the filename.
The parameters for customizing the guest os are specified in an XML file. The structure of the input XML file is:
<Specification> <Customization-Spec> </Customization-Spec> </Specification>
Following are the input parameters:
Required. Flag to specify whether auto logon should be enabled or disabled.
Required. Name of the virtual machine to be created.
Required. Time zone property of guest OS.
Required. The domain that the virtual machine should join.
Required. The domain user account used for authentication.
Required. The password for the domain user account used for authentication.
Required. User's full name.
Required. User's organization.
The parameters for customizing the virtual machine are specified in an XML file. The structure of the input XML file is:
<Specification> <Config-Spec-Spec> <!--Several parameters like Guest-Id, Memory, Disksize, Number-of-CPUS etc--> </Config-Spec> </Specification>
Following are the input parameters:
Required. Short guest operating system identifier.
Required. Size of a virtual machine's memory, in MB.
Required. Number of virtual processors in a virtual machine.
See the vmcreate.pl page for an example of a virtual machine XML file.
Making a clone without any customization:
perl vmclone.pl --username username --password mypassword --vmhost <hostname/ipaddress> --vmname DVM1 --vmname_destination DVM99 --url https://<ipaddress>:<port>/sdk/webService
If datastore is given:
perl vmclone.pl --username username --password mypassword --vmhost <hostname/ipaddress> --vmname DVM1 --vmname_destination DVM99 --url https://<ipaddress>:<port>/sdk/webService --datastore storage1
Making a clone and customizing the VM:
perl vmclone.pl --username myusername --password mypassword --vmhost <hostname/ipaddress> --vmname DVM1 --vmname_destination Clone_VM --url https://<ipaddress>:<port>/sdk/webService --customize_vm yes --filename clone_vm.xml --schema clone_schema.xsd
Making a clone and customizing the guestOS:
perl vmclone.pl --username myuser --password mypassword --operation clone --vmhost <hostname/ipaddress> --vmname DVM1 --vmname_destination DVM99 --url https://<ipaddress>:<port>/sdk/webService --customize_guest yes --filename clone_vm.xml --schema clone_schema.xsd
Making a clone and customizing both guestos and VM:
perl vmclone.pl --username myuser --password mypassword --vmhost <hostname/ipaddress> --vmname DVM1 --vmname_destination DVM99 --url https://<ipaddress>:<port>/sdk/webService --customize_guest yes --customize_vm yes --filename clone_vm.xml --schema clone_schema.xsd
All the parameters which are to be customized are written in the vmclone.xml file.