Add-VMdisk passthrough SAN drive

Apr 22, 2010 at 3:13 PM

I am attempting to add-vmdisk to some vms but getting errors when attempting to use the CLI.
Seen below is a passthrough disk added through the UI for example: "Physical drive:"

PS C:\hyper-v> Get-VMDisk | foreach {$_.diskpath}
H:\PEDAG-D1S2\PEDAG-D1S2\PEDAG-D1S2_MB-TEMPLATE.vhd
H:\PEDAG-D1S1\PEDAG-D1S1\PEDAG-D1S1_MB-TEMPLATE.vhd
Physical drive: Disk 10 900.00 GB Bus 0 Lun 1 Target 2

But when attempting through the CLI to add a physical disk "passthrough" from a san drive I get.

PS C:\hyper-v> add-vmdisk -VM D1S1 -controllerid 0 -lun 2 -path "Physical drive Disk 2 900.00 GB
Bus 0 Lun 3 Target 2" -SCSI -Server "dell-blade9"

Test-WMIResult : Failed to add Hard Disk Image to D1S1, return code'D1S1' failed to add device
'Microsoft Virtual Hard Disk'. (Virtual machine ID FFBFCE86-665A-4622-8BC9-28D8CBD18431)
'D1S1': Attachment 'C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\Physical drive Disk 2
900.00 GB Bus 0 Lun 3 Target 2.VHD' could not be found due to error: 'The system cannot find th
e file specified.' (0x80070002). (Virtual machine ID FFBFCE86-665A-4622-8BC9-28D8CBD18431)
At C:\Program Files\modules\Hyperv\VMConfig.ps1:56 char:43
+             if ( ($result | Test-wmiResult <<<< -wait:$wait -JobWaitText ($lstr_CreateHW -f$Rasd.ElementName)`
   + CategoryInfo         : NotSpecified: (:) [Write-Error], WriteErrorException
   + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-WMIResult

And after adding the same LUN/Disk through the UI its working.
PS C:\hyper-v> Get-VMDisk D1S1| foreach {$_.diskpath}
H:\PEDAG-D1S1\PEDAG-D1S1\PEDAG-D1S1_MB-TEMPLATE.vhd
Physical drive: Disk 10 900.00 GB Bus 0 Lun 1 Target 2
Physical drive: Disk 4 900.00 GB Bus 0 Lun 2 Target 2
Physical drive: Disk 2 900.00 GB Bus 0 Lun 3 Target 2
PS C:\hyper-v>

I am sure I am just missing a paramater or putting in wrong info but the PDF does really go over passthrough disks from san examples.

Apr 22, 2010 at 3:51 PM

What is getting added into the VM, is a Hard Drive, linked to a VHD that is blank.

Under the SCSI Controller its showing
Hard Drive
<file>

Instead of being linked to the Physical hard disk.

Nov 30, 2010 at 6:00 PM

I have the same issue. Do you know how to add the physical hard disk (pass-through disk) from add-vmdisk?

Dec 4, 2010 at 6:03 PM
unfortunately not, we are trying to find at way now.
the issue we get with hyper-v is that if we run any powershell scripts out there now is that with a san drive it adds the "drive" to the scsi adapter, but doesn't enumerate with the correct san drive number.
a local physical disk it works just fine. it most likey is some scsi command blocked with hyper-v but we still are trying to even find that out.

From: willychan [notifications@codeplex.com]
Sent: Tuesday, November 30, 2010 14:01
To: derrick.baxter@whiteeaglesaints.com
Subject: Re: Add-VMdisk passthrough SAN drive [PSHyperv:210195]

From: willychan

I have the same issue. Do you know how to add the physical hard disk (pass-through disk) from add-vmdisk?

Read the full discussion online.

To add a post to this discussion, reply to this email (PSHyperv@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email PSHyperv@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com