Previous Topic: dpmhyperv CreateVirtFloppy Command--Create a Virtual Floppy Disk ImageNext Topic: dpmhyperv CreateVMFromTemplate Command--Create a VM from a SCVMM Server Template


dpmhyperv CreateVM Command--Create a New VM

The dpmhyperv CreateVM command creates a VM on a Hyper-V host.

This command has the following format:

dpmhyperv CreateVM 
[-ws_user username] 
[-ws_password password] 
[-ws_encrypted_password] 
-hypervHost hostname 
[-templatevm vm_template]| 
[-templatevmguid template_ID] 
[-path location] 
[-memory memory_size] 
[-cpuSocketCount total_CPU_socket_count] 
[-cpuidLimit] 
[-cpufeatlimit] 
[-cpuReserve cpu_reserve] 
[-cpuLimit max_CPU_resources] 
[-cpuWeight cpu_wieight] 
[-startAction {none|auto|always}] 
[-startDelay start_delay_secs] 
[-stopAction {save|off|shutdown}] 
[-recoveryAction {none|restart|revert}] 
[-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.

-hypervHost hostname

Specifies the name of the Hyper-V host.

-templatevm vm_template

(Optional) Specifies the name of the VM from which you want to copy the configuration. This parameter identifies an existing VM in the Hyper-V environment and not a template from the VM catalog.

Note: We do not recommend creating VMs from the existing VMs because the shared resources results in potential conflicts.

-templatevmguid template_ID

(Optional) Specifies the GUID of the VM from which you want to copy the configuration. This parameter identifies an existing VM in the Hyper-V environment and not a template from the VM catalog.

Note: We do not recommend creating VMs from the existing VMs because the shared resources results in potential conflicts.

-path location

(Optional) Defines the full path of the new VM.

-memory memory_size

(Optional) Defines the memory size of the VM in MB.

-cpuSocketCount total_CPU_socket_count

(Optional) Defines the number of CPU cores in the VM. The number of the CPU cores of the VM cannot be more than the total number of the CPU cores available in the Hyper-V host.

-cpuidLimit

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

-cpufeatlimit

(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_resources

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

Default: 100

-startAction {none|auto|always}

(Optional) Specifies the action to perform after the VM startup. Options include the following:

none

Performs no action on the VM.

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 stops. Options include the following:

save

Suspends the VM.

off

Turns off the VM.

shutdown

Shuts down the VM. To use this option, the Hyper-V tools must be installed.

-recoveryAction {none|restart|revert}

(Optional) Specifies the action to perform on the VM after the VM worker process terminates abnormally and recovers. Options include the following:

none

Performs no action.

restart

Restarts the VM.

revert

Returns to the last snapshot. To use this option, the VM should have at least one snapshot.

-pre

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

-post

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

-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

This example creates the VM, "TestVM" in the "VM" folder.

dpmhyperv CreateVM -ws_user dcaadmin -ws_password #test# -hypervHost hvserver -name TestVM -path c:\VM\TestVM