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]
(Optional) Defines the URL for the service controller host.
Example: https://hostname:port/...
Defines the fully qualified host where the service controller is installed.
Example: localhost.ca.com
Defines the listening port for the service controller server.
Example: 80
Specifies the data center where the VM is located.
Specifies the cluster or VMware ESX host where the VM is created.
Specifies the VMware ESX server where the VM resides.
Specifies the name of the data store where the new VM is located.
Specifies the VM.
Specifies the name of the resource pool from which you want to select the VM for cloning.
(Optional) Specifies the name of the specification you want to use for the cloned virtual machine.
Specifies whether CA Server Automation agents are deployed automatically. Options include the following:
Deploys CA Server Automation agents automatically.
Prevents CA Server Automation agents from being deployed automatically.
Default: no
(Optional) Specifies the name of the generic template created in CA Server Automation.
Note: Do not confuse this template with the templates created and managed by VMware vCenter.
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=").
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=").
Linux:
Specifies one or more DNS search suffixes.
Windows:
(Optional) Specifies one or more DNS search suffixes.
Linux:
(Optional) Specifies the domain name for a Linux VM.
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.
(Optional) Creates one or more additional hard drives. This parameter can be specified multiple times.
Defines the size in megabytes of the hard drive.
Specifies the name of the data store for this hard drive. Currently only one data store is supported per VM.
Specifies the controller key for this hard drive.
(Optional) Specifies the data store where the hard drive resides. Can be specified multiple times.
Specifies an existing disk.
Specifies the name of the data store that this disk moves to.
(Optional) Defines the amount of memory in megabytes (MB) for the cloned VM. This value overrides the value specified in the template.
(Optional) Define the number of CPUs for the cloned VM. This value overrides the value specified in the template.
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.
(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.
Specifies the vCenter Server to access when you have multiple vCenter Servers. Optional for single vCenter Server environments.
(Optional) Specifies the vCenter Server user ID. It is optional depending on whether global credentials are enabled.
(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).
(Optional) Specifies the full path name of the authorization file to use to retrieve the encrypted password. This file contains the CA Server Automation administrator credentials that were generated using the dpmutil set auth command. When this option is not specified, the default authorization file is used.
(Optional) Specifies a component ID that you can use to group hosts and users.
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.
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.
Specifies the name of the resource pool from which you want to select the VM for cloning.
(Optional) Specifies the CA ITCM scalability server for software distribution.
(Optional) Specifies the name of the specification you want to use for the cloned virtual machine.
Specifies the cluster or VMware ESX host where the VM is created.
(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.
Wait indefinitely.
(Optional) Specifies whether to generate an event before the operation is performed.
(Optional) Specifies whether to generate an event after the operation is performed.
(Optional) Specifies the web service user name to connect to the VC Platform Management Module (PMM).
(Optional) Specifies the password for the web service user to connect to the VC Performance Management Module (PMM).
(Optional) Specifies whether you are prompted for the web service user ID and password.
Default: Yes
(Optional) Specifies whether you want to encrypt the VC user password.
Default: Yes
(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 Server Automation 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 Server Automation 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 Server Automation 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 Server Automation 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 Server Automation 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 Server Automation 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 Server Automation 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 Server Automation 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
Copyright © 2013 CA. All rights reserved. |
|