Previous Topic: dpmhyperv SetSysPrepProperties Command--Sets Sysprep PropertiesNext Topic: dpmhyperv SetVMProperties Command--Set Properties of a VM


dpmhyperv SetVMDisk Command--Assign a Drive or Disk to a Drive Controller

The SetVMDisk command lets you assign a virtual drive or disk to a drive controller.

This command has the following format:

dpmhyperv SetVMDisk 
[-ws_user username] 
[-ws_password password] 
[-ws_encrypted_password] -hypervHost hostname 
-vm vm_name|-vmguid vm_ID 
-drive {HDD|DVD} -driveType {scsi|ide} 
[-path location] 
-id drive_ID_number 
[-lun logical_unit_num] 
[-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.

-vm vm_name

Specifies the VM name.

-vmguid vm_ID

Specifies the unique GUID of the VM.

-drive {HDD|DVD}

Specifies the type of drive that the image is assigned to. Options include the following:

HDD

Indicates that the drive type is hard drive.

DVD

Indicates that the drive type is CD/DVD drive.

-driveType {scsi|ide}

Specifies the type of drive controller that the image is assigned to. Options include the following:

scsi

Indicates that the drive controller is SCSI.

ide

Indicates that the drive controller is IDE. For CD/DVD images the controller type must IDE.

-path location

(Optional) Defines the location of the virtual disk or drive.

-id drive_ID_number

Specifies the ID number of the drive. Specify 0 for the IDE and 0,1, or 2 for the SCSI drive.

-lun logical_unit_num

(Optional) Specifies the Logical Unit Number (LUN) number of the SCSI drive. For IDE controllers, the LUN must be 0 or 1 and for SCSI controllers, the LUN must be from 0 to 63. If no number is specified, the available channel is assigned automatically.

-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: Assign a Drive on a Drive Controller

This example assigns the virtual hard drive image file, "disk.vhd" to the first channel on the first SCSI controller:

dpmhv-setVMDisk -hypervHost hvserver -vm TestVM -type scsi -id 0 -lun 0 -drive HDD -path c:\VHDs\disk.vhd