VMware Host - Clone

Declaration

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

Related Topics   

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

Connection

Property

Type

Required

Default

Markup

Description

Connection

---

---

---

---

Indicates where this activity's connection properties should originate from. Different parameters become active depending on the option selected. This is a visual parameter used only during design-time, therefore, contains no properties or markups. The available options are:

  • Host (Default) - A custom set of credentials will be entered for this activity. This option is normally selected if only a single activity is needed to perform an operation.

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

Session

Text

Yes if Connection set to Session

VMOpsSession1

SESSION="VMO101"

The name of a session (created in a previous Connect step) in which to link this activity. This parameter is active only if the Connection parameter is set to Session.

Host type

Text (options)

Yes if Connection set to Host

VIServer

 

  1. HOSTTYPE="Server"

  2. HOSTTYPE="Workstation"

  3. HOSTTYPE="VIServer"

  4. HOSTTYPE="Player"

The type of VM host to establish a connection with. This parameter is active only if the Connection parameter is set to Host. The available options are:

  • VMware Server (1.0x)

  • VMware Workstation

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

  • VMware Player

Host name

Text

Yes

(Empty)

SERVER="host.server.com"

The hostname or IP address of the computer where the virtual machine is located. This parameter is active only if the Host type parameter is set to VMware Server or VMware VI Server.

Username

Text

No

(Empty)

USERNAME="MsPacman"

The username identifying a valid user account on the machine. This parameter is active only if the Host type parameter is set to VMware Server or VMware VI Server.

Password

Text

No

(Empty)

PASSWORD="encrypted"

The password identifying a valid user account on the machine. This parameter is active only if the Host type parameter is set to VMware Server or VMware VI Server.

Connection timeout

Number

No

60

CONNECTIONTIMEOUT="50"

The maximum time period in seconds during which a connection must be established between the guest and host, otherwise, the step times out. The default value is 60 seconds.

Virtual Machine

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 selected, 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 disabled (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.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task clones a virtual machine and stores its new location.

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