VM Operations - Clone

 

Declaration

<AMVMWAREVM ACTIVITY="clone_vm" VMPATH="text" DESTVMPATH="text" TIMEOUT="number" OPENVMTIMEOUT="number" LINKED="yes/no" />

See Also

VM Operations - Clone | VM Operations - Connect | VM Operations - Create Snapshot | VM Operations - Delete | VM Operations - Delete Snapshot | VM Operations - Disconnect | VM Operations - Install Tools | VM Operations - List Registered VMs | VM Operations - List Running VMs | VM Operations - List Snapshots | VM Operations - Pause | VM Operations - Power Off | VM Operations - Power On | VM Operations - Register VMs | VM Operations - Reset | VM Operations - Revert to Snapshots | VM Operations - Suspend | VM Operations - Unregister VM

Description

Creates a clone (copy) of an existing virtual machine. When the cloning operation is complete, the clone is a separate virtual machine — though it may share virtual disks with the parent virtual machine. Changes made to a clone do not affect the parent virtual machine. This activity provides the option to create a full clone, which is an independent copy of a virtual machine, and a linked clone, which is a copy of a virtual machine that shares virtual disks with the parent virtual machine in an ongoing manner.

Practical Usage

With clones, you can make many copies of a virtual machine from a single installation and configuration process. Clones are useful when you must deploy many identical virtual machines to a group. For example, a teacher can clone a virtual machine for each student, with all the lessons and labs required for the term. With clones, you can conveniently make complete copies of a virtual machine, without browsing a host file system or worrying if you have located all the configuration files.

Parameters

Virtual Machine Properties

Property

Type

Required

Default

Markup

Description

Virtual Machine Path

Text

Yes

(Empty)

VMPATH="C:\VMFolder\VMfile.vmx"

The absolute path of the virtual machine configuration (.vmx) file in which to clone. This parameter varies by product platform. With ESX/ESXi hosts and VMware Server 2.0, use a URL of the form "https://<hostName>:<port>/sdk" where <hostName> is either the DNS name or IP address, and <port> might be optional; credentials are required even for connections made locally. With VMware Workstation, use undef to connect to the local host. With VMware Server 1.0.x, use a DNS name or IP address for remote connections, or the same as Workstation for local connections.

Destination Path

Text

Yes

(Empty)

DESTVMPATH="C:\VM\VM_file.vmx"

The absolute path (full path and file name)  of the virtual machine configuration file that will be created for the virtual machine clone produced by this activity. This should be a full absolute path name, with directory names delineated according to host system convention (i.e. \ for Windows and / for Linux).

Linked

Yes/No

No

No

LINKED="yes"

If set to YES, creates a linked clone, which is a copy of a virtual machine that shares virtual disks with the parent virtual machine in an ongoing manner. This conserves disk space as long as the parent and clone do not change too much from their original state. If set to NO (default), creates a full, independent clone of the virtual machine.

Timeout (seconds)

Number

No

60

TIMEOUT="5"

The time out value in seconds that this activity waits for a response from the host.

Open VM Timeout (seconds)

Number

No

60

OPENVMTIMEOUT="5"

The maximum time period in seconds during which this activity must successfully connect to the specified VMware product or the task times out.

Connection Properties

These properties allow you to create a custom connection for this activity or link it to a session previously established (using the Connect activity) that contains pre-defined connection parameters.

Property

Type

Required

Default

Markup

Description

Provide Connection

 

 

 

 

Indicates where this activity's connection should originate from. Different parameters become active depending on the option selected. The available options are:

  • Custom (Default) - A custom set of credentials will be entered for this activity. Select this option if performing a single a single operation.

  • Session Based - Credentials should derive from a session created in a previous step with the use of the Connect activity. This allows several operations to be linked to a single session, eliminating redundancy. Multiple sessions can exist in a single task.

Host Type

Text (options)

Yes

VIServer

HOSTTYPE="Workstation"

The type of VM host to establish a connection with. The available options are:

  • VMware Server (1.0x)

  • VMware Workstation

  • VMware VI Server (ESX/ESXi, vCenter, VMware Server 2.0)(Default)

  • VMware Player

This property is active only if Custom is selected under the Provide Connection property.

Host

Text

Yes

(Empty)

SECRETKEY=

"kWcrlUX5JEDGM/LtmEENI/

aVmYvHNif5zB+d9+ct"

The VM host to connect to. This parameter varies depending on which option is selected in the Host Type parameter. If VMware VI Server is selected, use URL format (Example:  "https://<hostName>:<port>/sdk" where <hostName> is either the DNS name or IP address, and <port> might be optional; credentials are required even for connections made locally. With VMware Workstation, use NULL to connect to the local host. With VMware Server 1.0.x, use a DNS name or IP address for remote connections, or the same as Workstation for local connections.

Username

Text

No

AutoMate

USERAGENT="AutoMate"

The User-Agent header name. The User-Agent request-header field contains information about the user agent originating the request such as timeouts, proxies, name, etc. The default User Agent name is AutoMate.

This property is active only if Custom is selected under the Provide Credentials property.

Password

Text

No

(Empty)

SERVICEURL=

"https://sdb.eu-west-1.amazonaws.com"

The Service URL used to make requests to the EC2 service. The Service URL provides the service endpoint. For example, To make the service call to a different region, you can pass the region-specific endpoint, such as 'https://sdb.eu-west-1.amazonaws.com'.

This property is active only if Custom is selected under the Provide Credentials property.

Connection Timeout (seconds)

Number

No

60

MAXERRORRETRY="4"

Signifies how many times the Amazon EC2 engine should retry the request before returning an error.

This property is active only if Custom is selected under the Provide Credentials property.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Clone virtual machine "C:\Virtual Machines\Windows 7 x64 (FULL)\Windows 7 x64.vmx" and store the new virtual machine at location "C:\Temp\VMClone.vmx". Create a linked clone. Use default VM session.

 

<AMVMWAREVM ACTIVITY="clone_vm" VMPATH="C:\Virtual Machines\Windows 7 x64 (FULL)\Windows 7 x64.vmx" DESTVMPATH="C:\Temp\VMClone.vmx" LINKED="yes" />

 

↑ Top