Previous Topic: dpmvc-addvmvnic Command--Add Virtual NIC (Funclet)Next Topic: dpmvc-createdatastore Command--Create a Datastore (Funclet)


dpmvc-clone Command--Clone a VM (Funclet)

The dpmvc-clone command lets you clone a VM.

This command has the following format:

dpmvc-clone 
{-template_name templatename | -cloned_from vmname}
{-datacenter_name datacentername | -vc vcenterservername}
-vm_name vmname 
-esx_host_name esxhostname 
-datacenter_name datacentername 
-data_store_name datastorename 
-compute_resource_name name 
-resource_pool_name resourcepool 
-spec_name specificationname 
[-auto_deploy value] 
[-deploy_template templatename] 
[-network_connection "nic=sequence_number,network_name=name,ip_address=ip_address,def_gateway=default_gateway,alt_gateway=alt_gateway,subnet_mask=subnet_mask[,win_dns_server=wins_dns_server,win_alt_dns=wins_alt_dns,wins_primary=wins_primary,wins_secondary=wins_secondary"]] 
[-global_dns_search_suffix suffix1[,suffix2,suffix3,…]] 
[-linux_domain_name domain_name] 
[-linux_dns_servers primary_dns=value,secondary_dns=value,tertiary_dns=value] 
[-create_disk MB,datastorename,controller] 
[-modify_disk key, datastorename] 
[-set_memory number] 
[-set_cpu number] 
-vm_os_username username 
[-vm_os_password password] 
[-auth_file authorizationfilename] 
[-auth_comp componentID]  
[-scalability_server scalabilityservername] 
-datacenter_name datacentername

Specifies the data center where the VM is located.

-vc vcenterservername

Specifies the vCenter Server where the VM is located.

-compute_resource_name name

Specifies the cluster or VMware ESX host where the VM is created.

-esx_host_name esxhostname

Specifies the VMware ESX server where the VM resides.

-datastore_name datastorename

Specifies the name of the data store where the new VM is located.

-vm_name vmname

Specifies the VM.

-resource_pool_name resourcepool

Specifies the name of the resource pool from which you want to select the VM for cloning.

-spec_name specificationname

(Optional) Specifies the name of the specification you want to use for the cloned virtual machine.

-auto_deploy {yes|no}

Specifies whether CA Virtual Assurance agents are deployed automatically. Options include the following:

yes

Deploys CA Virtual Assurance agents automatically.

no

Prevents CA Virtual Assurance agents from being deployed automatically.

Default: no

-deploy_template templatename

(Optional) Specifies the name of the generic template created in CA Virtual Assurance.

Note: Do not confuse this template with the templates created and managed by VMware vCenter.

-network_connection "nic=sequence_number,network_name=name,ip_address=ip_address,def_gateway=default_gateway,alt_gateway=alt_gateway,subnet_mask=subnet_mask,win_dns_server=wins_dns_server,win_alt_dns=wins_alt_dns,wins_primary=wins_primary,wins_secondary=wins_secondary"

Windows:

(Optional) Creates network connections for a VM. This parameter can be specified multiple times. Sequence number is the integer value starting with one (1) that identifies the network connection. The full set of parameters must be enclosed in parentheses if it includes any spaces. All values except nic, network_name, ip_address, def_gateway and subnet_mask; can be reset by entering the name without a value (for example, "nic=123,alt_gateway=").

-network_connection "nic=sequence_number,network_name=name,ip_address=ip_address,def_gateway=default_gateway,alt_gateway=alt_gateway,subnet_mask=subnet_mask"

Linux:

(Optional) Creates one or more network connections. This parameter can be specified multiple times. The sequence number is the integer value starting with one (1) that identifies the network connection. The full set of parameters must be enclosed in parentheses if it contains any spaces. Only alt_gateway can be reset by entering the name without a value (for example, "nic=123,alt_gateway=").

-global_dns_search_suffix suffix1{,suffix2,suffix3,…}

Linux:

Specifies one or more DNS search suffixes.

Windows:

(Optional) Specifies one or more DNS search suffixes.

-linux_domain_name domain_name

Linux:

(Optional) Specifies the domain name for a Linux VM.

-linux_dns_servers primary_dns=value{,secondary_dns=value,tertiary_dns=value}

Linux:

(Optional) Specifies the IP addresses of DNS servers for a Linux VM. One or more of the values can be omitted (for example, primary_dns=123.123.123.13,secondary_dns=,tertiary_dns=123.123.123.15) to unset the value.

-create_disk MB,datastore_name,controller

(Optional) Creates one or more additional hard drives. This parameter can be specified multiple times.

MB

Defines the size in megabytes of the hard drive.

Datastore_name

Specifies the name of the data store for this hard drive. Currently only one data store is supported per VM.

Controller

Specifies the controller key for this hard drive.

-modify_disk {key,datastore_name}

(Optional) Specifies the data store where the hard drive resides. Can be specified multiple times.

key

Specifies an existing disk.

datastore_name

Specifies the name of the data store that this disk moves to.

-set_memory number

(Optional) Defines the amount of memory in megabytes (MB) for the cloned VM. This value overrides the value specified in the template.

-set_cpu number

(Optional) Define the number of CPUs for the cloned VM. This value overrides the value specified in the template.

-vm_os_username user name

Specifies the user for the cloned VM. This user name is also used for authentication when you auto-deploy the image.

Windows: Must be the user name defined in the customization specification.

Linux: Must be the user name defined in the template.

-vm_os_password password

(Optional) Specifies the password for the user for the cloned VM. This password is also used for authentication when you auto-deploy the image.

Windows: Must be the same password defined in the customization specification.

Linux: Must be the same password defined in the template.

-auth_file authorizationfilename

(Optional) Specifies the full path name of the authorization file to use to retrieve the encrypted password. This file contains the CA Virtual Assurance administrator credentials that were generated using the dpmutil set auth command. When this option is not specified, the default authorization file is used.

-auth_comp componentID

(Optional) Specifies a component ID that you can use to group hosts and users.

-template_name templatename

Specifies the name of the template you want to use for the cloned virtual machine. This parameter replaces -vm_name_cloned_from and you cannot specify both together.

-vm_name_cloned_from vmname

Specifies the name of the virtual machine to use as a template for the cloned virtual machine. This parameter replaces -template_name and you cannot specify both together.

-resource_pool_name resourcepool

Specifies the name of the resource pool from which you want to select the VM for cloning.

-scalability_server servername

(Optional) Specifies the [assign itcm product name for the adsm variable] scalability server for software distribution.

-spec_name specificationname

(Optional) Specifies the name of the specification you want to use for the cloned virtual machine.

-compute_resource_name name

Specifies the cluster or VMware ESX host where the VM is created.

Example: Clone a VM using Global Credentials

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, Specifies VAS/MyCity. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VPMCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword 

Example: Clone a VM using Authorization File and Component

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, VAS/MyCity. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name Specifies VAS/MyCity -datastore_name storage1 
-compute_resource_name VPMCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -auth_file c:\localauth.dat -auth_comp Imaging

Example: Clone a VM using Global Credentials and Create 2 CPUs

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, VAS/MyCity and creates 2 CPUs for the VM. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VPMCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -set_cpu 2 

Example: Clone a VM using Default Authorization File and Set Memory to 4096 MB

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, VAS/MyCity and sets the memory to 4096. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VPMCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -set_memory 4096 

Example: Clone a VM using Default Authorization File and Create Two Hard Disks

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, VAS/MyCity and creates two hard disks for data store storage1. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VASCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -create_disk 10000,storage1,1000 
-create_disk 10000,storage1,2001 

Example: Clone a VM and Create a Network Connection

This example creates a VM, "testvm01", a network connection using the template "BaseW2k3" on the data center, VAS/MyCity, and sets the initial values. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VASCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -network_connection "nic=1,network_name=VM Network,ip_address=123.321.5.22,def_gatewat=123.321.1.108,subnet_mask=255.255.255.0,win_dns_server=123.321.42.1,win_alt_dns=123.321.3.101,wins_primary=123.321.3.3"

Example: Clone a VM using Default Authorization File from a Powered off VM

This example creates a VM, "testvm01" using VM “testvm02” in place of a template on the data center, VAS/MyCity. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -datacenter_name "VAS/MyCity" -vm_name testvm01 -datastore_name storage1 
-esx_host_name vc1.ca.com -resource_pool_name Resources/DPMTest 
-compute_resource_name DPMCluster/ussdCluster -vm_name_cloned_from testvm02 
-auto_deploy yes -spec_name w2k3_spec_01 -vm_os_username administrator 
-vm_os_password mypassword 

Example: Clone a VM using Default Authorization File and Modify an Existing Hard Disk

This example creates a VM, "testvm01" using the template "BaseW2k3" on the data center, VAS/MyCity and creates two hard disks for data store storage1. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc-clone -vm_name testvm01 -template_name Templates/BaseW2k3 -auto_deploy yes 
-spec_name w2k3_spec_01 -datacenter_name VAS/MyCity -datastore_name storage1 
-compute_resource_name VPMCluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -create_disk 10000,storage1,1000 -modify_disk 2000,storage2