NAME

vmclone.pl - Perform clone operation on virtual machine and customize operation on both virtual machine and the guest.


SYNOPSIS

 vmclone.pl [options]


DESCRIPTION

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.


OPTIONS

GENERAL OPTIONS

vmhost

Required. Name of the host containing the virtual machine.

vmname

Required. Name of the virtual machine whose clone is to be created.

vmname_destination

Required. Name of the clone virtual machine which will be created.

datastore

Optional. Name of a data center. If none is given, the script uses the default data center.

CUSTOMIZE GUEST OPTIONS

customize_guest

Required. Customize guest is used to customize the network settings of the guest operating system. Options are Yes/No.

filename

Required. It is the name of the file in which values of parameters to be customized is written e.g. --filename clone_vm.xml.

schema

Required. It is the name of the schema which validates the filename.

CUSTOMIZE VM OPTIONS

customize_vm

Required. customize_vm is used to customize the virtual machine settings like disksize, memory. If yes is written it will be customized.

filename

Required. It is the name of the file in which values of parameters to be customized is written e.g. --filename clone_vm.xml.

schema

Required. It is the name of the schema which validates the filename.

INPUT PARAMETERS

GUEST CUSTOMIZATION

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:

Auto-Logon

Required. Flag to specify whether auto logon should be enabled or disabled.

Virtual-Machine-Name

Required. Name of the virtual machine to be created.

Timezone

Required. Time zone property of guest OS.

Domain

Required. The domain that the virtual machine should join.

Domain-User-Name

Required. The domain user account used for authentication.

Domain-User-Password

Required. The password for the domain user account used for authentication.

Full-Name

Required. User's full name.

Orgnization-Name

Required. User's organization.

VIRTUAL MACHINE CUSTOMIZATION

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:

Guest-Id

Required. Short guest operating system identifier.

Memory

Required. Size of a virtual machine's memory, in MB.

Number-of-CPUS

Required. Number of virtual processors in a virtual machine.

See the vmcreate.pl page for an example of a virtual machine XML file.


EXAMPLES

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.