Use Set-VMDisk to attach dvd drive error

Nov 18, 2009 at 1:42 AM

Hi, I have installed the pshyperv in my HyperV Server 2008 r2. And I log in as administrator.

When I tried to use SetVMDisk to attach the host dvd drive in my vm "abc", I got the following errors:

PS C:\Users\Administrator> Set-VMDisk abc 1 1 (Get-WmiObject -Query "Select * Fr
om win32_cdromdrive Where ID='D:' " ).deviceID

Test-wmiResult : Failed to add Hard Disk Image to abc, return code'abc' failed
to add resources. (Virtual machine ID 006423F0-A592-4A85-86D2-FFA058C2944A)
'abc' failed to set folder permission for IDE\CDROMATAPI_IHAS120___6___________
____________7L0M____: The system cannot find the path specified. (0x80070003) (
Virtual machine ID 006423F0-A592-4A85-86D2-FFA058C2944A).
At C:\Program Files\modules\HyperV\VMConfig.ps1:56 char:43
+             if ( ($result | Test-wmiResult <<<<  -wait:$wait -JobWaitText ($l
str_CreateHW -f $Rasd.ElementName)`
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio

PS C:\Users\Administrator>


Can anyone help?

Nov 24, 2009 at 3:36 PM

Failed to add Hard Disk Image to abc,

Is the giveaway. I'll double check for a bug in set-vmdisk but in the meantime can you check that the drive is a virtual DVD drive not a virtual hard disk.