Previous Topic: dpmvc addvmvnic Command--Add Virtual NICNext Topic: dpmvc createdatastore Command--Create a Datastore


dpmvc clone Command--Clone a VM

The dpmvc clone command lets you clone a VM.

This command has the following format:

dpmvc clone 
[-sc sc_url] 
-datacenter_name datacentername 
-compute_resource_name name 
-esx_host_name esxhostname 
-datastore_name datastorename 
-vm_name vmname 
-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] 
[-vc_server vcservername] 
[-vc_user vcuser] 
[-vc_password vcpassword] 
[-auth_file authorizationfilename] 
[-auth_comp componentID] {-template_name templatename | 
-vm_name_cloned_from -vmname} 
[-scalability_server scalabilityservername] 
[-wait [timeout]] 
[-pre] 
[-post] 
[-ws_user wsuser] 
[-ws_password wspassword] 
[-prompt {yes|no}] 
[-encrypted_password {yes|no}]
[-locale iso639value]
-sc sc_url

(Optional) Defines the URL for the service controller host.

Example: https://hostname:port/...

hostname

Defines the fully qualified host where the service controller is installed.

Example: localhost.ca.com

port

Defines the listening port for the service controller server.

Example: 80

-datacenter_name datacentername

Specifies the data center 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.

-vc_server vcservername

Specifies the vCenter Server to access when you have multiple vCenter Servers. Optional for single vCenter Server environments.

-vc_user vcuser

(Optional) Specifies the vCenter Server user ID. It is optional depending on whether global credentials are enabled.

-vc_password vcpassword

(Optional) Specifies the password for the vCenter server user ID. When this option is omitted an encrypted password is retrieved for the user (-vc_user option) and component (-auth_comp option), if specified from either the default authorization file or a specific authorization file (-auth_file).

-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.

-wait timeout

(Optional) Indicates whether to display the status of the job and not return until the operation completes, fails, or the timeout period is met (if you specify a timeout value). If you do not specify this option, the CLI returns without waiting for completion. If there is no response, the optional timeout value defines the timeout period in minutes. If you enter the wait option with no timeout value, the CLI uses the default wait time from the caimgconf.cfg file or defaults to 120 minutes. In addition to any positive integer, the following timeout values are also possible:

""

No timeout value.

0

Wait indefinitely.

-pre

(Optional) Specifies whether to generate an event before the operation is performed.

-post

(Optional) Specifies whether to generate an event after the operation is performed.

-ws_user wsuser

(Optional) Specifies the web service user name to connect to the VC Platform Management Module (PMM).

-ws_password wspassword

(Optional) Specifies the password for the web service user to connect to the VC Performance Management Module (PMM).

-prompt {yes|no}

(Optional) Specifies whether you are prompted for the web service user ID and password.

Default: Yes

-encrypted_password {yes|no}

(Optional) Specifies whether you want to encrypt the VC user password.

Default: Yes

-locale iso639value

(Optional) Specifies an IS0 639_3166 combination to override the default English output, for example, fr_FR for French. To use the locale of the command prompt, specify "native".

Example: Clone a VM using Global Credentials

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -vc_server vc_server_1

Example: Clone a VM using Authorization File and Component

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -vc_server vc_server_1 -vc_user VCAdmin1 
-auth_file c:\localauth.dat -auth_comp Imaging

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

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/MyCity and creates two 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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -set_cpu 2 -vc_server vc_server_1

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

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -set_memory 4096 -vm_server vm_server_1 
-vm_user VCAdmin1

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

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/MyCity and creates 2 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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -create_disk 10000,storage1,1000 
-create_disk 10000,storage1,2001 -vm_server_1 -vm_user VCAdmin1

Example: Clone a VM and Create a Network Connection

This example creates a new VM, "testvm01" and network connection using the template "BaseW2k3" on the data center, DCA/MyCity and creates a network connection 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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/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 new VM, "testvm01" using VM “testvm02” in place of a template on the data center, DCA/MyCity. When the clone operation is complete, CA Virtual Assurance agents are automatically deployed.

dpmvc clone -datacenter_name "DCA/MyCity" -vm_name testvm01 -datastore_name storage1 
-esx_host_name ussd-dpmvc.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 -vc_server vm_server_1.myco.com -vc_user VCAdmin1

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

This example creates a new VM, "testvm01" using the template "BaseW2k3" on the data center, DCA/MyCity and creates 2 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 DCA/MyCity -datastore_name storage1 
-compute_resource_name DCACluster/ClusterServerA -vm_os_username administrator 
-vm_os_password testpassword -create_disk 10000,storage1,1000 -modify_disk 2000,storage2 
-vm_server_1 -vm_user VCAdmin1