Could not add disk - could not find or create drive for it

Aug 31, 2011 at 10:02 AM
Edited Aug 31, 2011 at 10:05 AM

I keep getting this error message when using trying to add new disk no matter what kind of cmdlet I use (i.e. new-vhd/add-vmdisk or Add-VMNewHardDisk).

It worked just fine yesterday and it jsut stopped working today, nothing has changed.

Anyone knows what this might be caused of??

"Warning: Could not add disk - could not find or create drive for it"

Thanks in advance!


Here's the script:



#Import-Module "F:\Software&Utilities\PowerShell Utilities\PsHyperV\HyperV"

$nvm = New-VM  -Name  "$VMName"  | Set-VMMemory -Memory 536870912

$dn = $VMName+"_OSD"

Add-VMDrive $nvm 1 0

New-VHD E:\VHDs\$dn`.vhd

#Add-VMNewHardDisk -vm $nvm -controllerID 0 -lun 0 -VHDPath "$pt\$VMName.vhd" -size 20gb

#Get-ChildItem E:\VHDs\$VMName.* | Select-Object | Rename-Item -NewName {$VMName+"_OSD.vhd"}

Add-VMDisk $nvm 0 0 "E:\VHDs\$dn.*"

#Add-VMNewHardDisk -vm $nvm -VHDPath "$VMName" -controllerID 0 -lun 0 -size 20gb -scsi

#Add-VMDisk $nvm 0 1 "F:\Images\windows_server_2008_r2_SED.iso" -DVD

Aug 31, 2011 at 12:50 PM

Strangely enough I've tried to use the Add-VMNewHardDisk cmdlet today but it completely ignores the -VHDPath argument and then fails to run the Add-VMDisk command, reporting that it cannot bind to the argument 'Path' as it is Null.

I don't kow enough about Powershell to work out what needs to be fixed but I assume the issue is where the -VHDPath is converted to $NewVHD.  Once there it seems this path is then not passed to the Add-VMDisk cmdlet.

I can do the individual steps for now but I'd love to get it working smoothly.