Previous Topic: dpmhyperv CreateVMFromTemplate Command--Create a VM from a SCVMM Server TemplateNext Topic: dpmhyperv DeleteVM Command--Delete a VM


dpmhyperv CreateVMFromTemplate Command--Create a VM from a Template

The dpmhyperv CreateVMFromTemplateEx command creates a VM from a standalone Hyper-V server template.

This command has the following format:

dpmhyperv CreateTemplateFromVMEx 
[-ws_user username] 
[-ws_password password] 
[-ws_encrypted_password] 
[-prompt {yes|no}] 
-hypervHost hostname 
-vmname vm_name 
-template template_name 
[-dest destination] 
[-computerName computer_Name] 
[-ip4addr ip4addr] 
[-ip4dhcp ip4dhcp] 
[-ip4dhcpInt ip4dhcpInt] 
[-ip4mask ip4mask] 
[-ip4gw ip4gw]
[-ip4metric ip4metric] 
[-ip4dns ip4dns]
[-disableAdmin]
[-adminPass admin_password] 
[-autoLogon autologon]
[-duplicatorString dupicate_String]
[-timeZone timezone]
[-productKey product_key] 
[-userName user_name] 
[-organization org_name] 
[-domain domain_name] 
[-domainAdmin domain_admin_login] 
[-domainAdminPass domain_admin_password] 
[-workgroup workgroup_name] 
[-adminUser admin_username] 
[-adminUserPass admin_password] [adminGroup admin_group_name] 
[-startVM start_vm] 
[-custom custom] 
[-memory memory_size] [cpuSocketCount total_CPU_socket] 
[-cpuidLimit cpu_id_limit] 
[-cpufeatlimit cpu_feat_limit] 
[-cpuReserve cpu_reserve] 
[-cpuLimit max_CPU_usage] 
[-cpuWeight cpu_wieight] 
[-startAction {none|auto|always}] 
[-startDelay start_delay_secs] 
[-stopAction {save|off|shutdown}] 
[-recoveryAction {none,restart,revert}] 
[-scvmmHost scvmm_host] 
[-scvmmHardwareProf scvmm_hardware_profile] 
[-scvmmGuestOSProf scvmm_guest_os_profile] 
[-async] 
[-pre] 
[-post]
[-locale iso639value]
-ws_user username

(Optional) Specifies the CA Virtual Assurance user name.

-ws_password password

(Optional) Specifies the CA Virtual Assurance user password.

-ws_encrypted_password

(Optional) Indicates whether the CA Virtual Assurance password is encrypted.

-prompt {yes|no}

(Optional) Specifies whether you are prompted for the user name and password.

-hypervHost hostname

Specifies the name of the Hyper-V host.

-vm vm_name

Specifies the VM name.

-template template_name

Defines the name of the new template.

-dest destination_path

(Optional) Specifies the destination path where the template is created.

-computerName computer_name

(Optional) Specifies the name of the computer.

-ip4addr ip4addr

(Optional) Specifies the static IPv4 address that you want to assign to the VM interface.

-ip4dhcp ip4dhcp

(Optional) Specifies whether to use DHCP.

Default: local

-ip4dhcpInt ip4dhcpInt

(Optional) Specifies the DHCP address.

-ip4mask network_mask

(Optional) Specifies the subnet mask that you want to assign to the VM. Use this option with the -ip4ddr option.

-ip4gw gateway_address

(Optional) Specifies the option to set the gateway for the VM. Use this option with the -ip4ddr option.

-ip4metric ip_metric

(Optional) Specifies the interface metric that you want to set for the VM. Use this option with the -ip4ddr option.

-ip4dns dnsserver_ip

(Optional) Specifies the DNS server for the VM. Use this option with the -ip4ddr option.

-disableAdmin

(Optional) Specifies an option to disable default administrator account for the VM.

-adminPass admin_password

(Optional) Specifies the default administrator password for the VM.

-autoLogon autologon

(Optional) Specifies the option to set the number of accounts that automatically log in with the default administrator account Sysprep process is complete.

-duplicatorString duplicate_string

(Optional) Specifies the name of the system duplicator to set in the VM registry.

-timeZone timezone

(Optional) Specifies the time zone used by the VM that are created using the template.

-productKey product_key

(Optional) Specifies the Windows product activation key for the VM.

-userName user_name

(Optional) Specifies the user name of the Windows in the VM.

-organization org_name

(Optional) Specifies the organization name of the Windows in the VM.

-domain domain_name

(Optional) Specifies the domain name of the VM.

-domainAdmin domain_admin_login

(Optional) Specifies the domain administrator login.

-domainAdminPass domain_admin_password

(Optional) Specifies the password for the domain administrator account. This option is invalid for the asynchronous mode.

-workgroup workgroup_name

(Optional) Specifies the workgroup of the VM. This option is invalid for the asynchronous mode.

-adminUser admin_username

(Optional) Specifies the user name that is the member of the default Administrators group.

-adminUserPass admin_password

(Optional) Specifies the password of the default Administrators group.

-adminGroup admin_group_name

(Optional) Specifies the group name of the administrator.

-startVM start_vm

(Optional) Indicates whether to start the VM.

-custom custom

(Optional) Specifies the list of comma-separated custom commands that are executed at the end of the Sysprep process.

-memory memory_size

(Optional) Defines the size of the memory in bytes.

-cpuSocketCount total_CPU_socket

(Optional) Specifies the number of processor sockets in the VM.

-cpuidLimit cpu_id_limit

(Optional) Indicates whether the processor must limit the maximum CPUID value.

cpufeatlimit cpu_feat_limit

(Optional) Indicates whether the VM must limit the CPU features exposed to the operating system.

-cpuReserve cpu_reserve

(Optional) Specifies the amount of CPU resources that are reserved for use by the VM.

-cpuLimit max_CPU_usage

(Optional) Specifies the maximum amount of CPU resources that the VM can consume.

-cpuWeight cpu_weight

(Optional) Specifies the relative weight of the virtual machine from 1 to 10000.

-startAction {none|auto|always}

(Optional) Specifies the action to perform on the VM after the Hyper-V host starts up. Options include the following:

none

Performs no action.

auto

Starts the VM automatically if it was running before the Hyper-V host was shut down.

always

Starts the VM every time Hyper-V starts.

-startDelay start_delay_secs

(Optional) Specifies the delay in seconds to start the VM after the Hyper-V host starts up.

-stopAction {save|off|shutdown}

(Optional) Specifies the action to perform on the VM before the Hyper-V host shuts down. Options include the following:

save

Suspends the VM.

off

Turns off the VM.

shutdown

Shuts down the VM.

-recoveryAction {none,restart,revert}

(Optional) Specifies the action to perform on the VM after the Hyper-V host restarts after an unexpected shutdown. Options include the following:

none

Performs no action.

restart

Restarts the VM.

revert

Returns to the last snapshot.

-scvmmHost scvmm_hostname

(Optional) Specifies the name of the SCVMM server host.

-scvmmHardwareProf scvmm_hardware_profile

(Optional) Specifies the name of the SCVMM defined hardware profile.

-scvmmGuestOSProf scvmm_guest_os_profile

(Optional) Specifies the name of the SCVMM defined guest operating system profile.

-async

(Optional) Runs the command in the asynchronous mode.

-pre

(Optional) Generates an event before the operation is complete.

-post

(Optional) Generates an event after the operation is complete.

Note: If you are not using the -async mode, the following parameters are ignored: memory, cpuSocketCount, cpuidLimit, cpufeatlimit, cpuReserve, cpuLimit, cpuWeight, startAction, startDelay, stopAction, and recoveryAction.

-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: Create a VM from a Standalone Hyper-V Server Template

This example creates the VM, "NewVM" using the template, "Win2kSysPrepped."

dpmhyperv -createVMFromTemplateEx -ws_user dcaadmin -ws_password #test# -hypervHost hvserver -vm NewVM -dest c:\VMs\NewBox -template Win2k3SysPrepped -ip4addr 127.0.0.1 -ip4mask 255.255.255.0 -ip4gw 127.0.0.1 -ip4dns 127.0.0.1 -computerName NewBox