The dpmhv-createVM command lets you create a VM. This command creates VM without system components such as network adapter or hard disks. Upon creating VM, you can create system components using respective commands.
This command has the following format:
dpmhv-createVM -host hostname -name name [-path pathname] [-template templatename] [-templateid vmguid] [-mem mem] [-cpus cpus] [-cpuidlimit limit] [-cpureserve reserve] [-cpulimit limit] [-cpuweight weight] [-startAction {none|auto|always}] [-startDelay delay] [-stopAction {save,off,shutdown}] [-recoveryAction {none,restart,revert}] [-retval] [-silent]
Specifies the name of the Hyper-V server host.
(Optional) Specifies the name of the VM.
Note: The name of the VM must be unique.
(Optional) Specifies the path of the VM that you want to create (template is stored). If this option is not specified, VM is created in the Hyper-V Server default location. The name of the template created is stored in the following location: %ALLUSERSPROFILE%\ca\vpm\Hyper-V_Templates.
Note: We recommend not creating VMs in the Hyper-V default location. It conflicts with virtual disk image file names that do not change when creating VMs using templates.
(Optional) Specifies the name of the existing VM. This option is used to copy the configuration settings of existing VMs to create new VMs. We recommend not creating VMs from existing VMs. Two VMs share resources such as virtual disk and cannot be run at the same time.
Note: The template name must be unique in the local template catalog.
(Optional) Specifies the unique ID (GUID) of the existing VM. This option is used to copy the configuration settings of the existing VMs to create new VMs. We recommend not creating VMs from existing VMs. Two VMs can share resources such as virtual disks and cannot be run at the same time.
Default: -1
Note: This option does not represent the template ID from VM catalog, but it represents the existing VM in Hyper-V environment.
(Optional) Specifies the RAM memory in megabytes (MB) for the VM that you want to create.
Default: -1
(Optional) Specifies the number of CPU core that you want to assign to the VM.
(Optional) Specifies the limit of CPU ID functionality of VM. This option improves the compatibility with legacy operating systems such as Windows NT.
Default: -1
(Optional) Specifies the percentage of the CPU that you want to reserve for the VM. If this option is not specified, Hyper-V server assigns CPU cycles based on the overall system usage.
Default: -1
(Optional) Specifies the limit for the number of CPU resources used by a VM. This option improves the compatibility while moving VMs between physical hosts with different CPU capabilities.
Default: -1
(Optional) Specifies the relative weight of the virtual machine. This option controls resource allocation when more than one VM is running. Valid entry: integer, 1-10000.
Default: -1
(Optional) Specifies the action that you want to perform on the VM when the Hyper-V host starts up. Options include the following:
Performs no action.
Starts the VM automatically.
Note: Use this option if the VM was running before the Hyper-V host is shut down.
Starts the VM always.
(Optional) Specifies the delay in seconds to start the VM after the Hyper-V host is up and running.
Default: -1
(Optional) Specifies the action that you want to perform on the VM when the physical Hyper-V shuts down. Options include the following:
Suspends the VM.
Power offs the VM.
Shuts down the system.
(Optional) Specifies the action to perform on the VM after the Hyper-V host restarts from unexpected shutdown. Options include the following:
Performs no action.
Restart the VM.
Reverts to the last snapshot of the VM.
Returns a value for further processing.
Specifies not to direct the output to the screen.
This command returns a string with the unique identifier (GUID) of newly created VM.
Example: Create a VM with default settings
This example creates VM, "TestVM" with default settings.
dpmhv-createVM -host hvserver -name TestVM
Example: Create a VM with default settings in user-defined directory
This example creates VM,"TestVM" with default settings in user-defined directory.
dpmhv-createVM -host hvserver -name TestVM -path c:\VMs\TestVM
Example: Create a VM with custom memory and CPU core values
This example creates VM,"TestVM" with custom memory and CPU core values.
dpmhv-createVM -host hvserver -name TestVM -mem 1024 -cpus 2
Copyright © 2013 CA. All rights reserved. |
|