Hopefully it's not me being stupid, but I'm continually getting errs trying to create a VM using an existing disk via PowerShell. Se attached for commands and output... I dont think I am doing anything wrong there? Bit puzzled as to how the device spec could be wrong when I'm using a disk that was just created using the same guest type!
The path doesn't look right.
With the VM you created could you try
get-vm <yourvm> | get-view | select { $_.Config.Files.VmPathName }
and feed that path to new-vm? You'll have to put the path in quotes since it has spaces.
The path doesn't look right.
With the VM you created could you try
get-vm <yourvm> | get-view | select { $_.Config.Files.VmPathName }
and feed that path to new-vm? You'll have to put the path in quotes since it has spaces.
Cheers Carter, will try that when i get in tomorrow. I too thought the path looked wierd, but I actually get an "invalid path" type err when I don't include the square brackets. It does seem to be finding the vmdk though, otherwise it how would it know to throw back an invalid type? Can I assume the 1 in the err refers to the persistence state of the disk or something?
Cheers
Stu
nice one
It doesn't want a slash after the datastore name, replacing the slash with a space and surrounding the diskpath with quotes did the trick!
new-vm -Name testpowershell -DiskPath "[local] disk0.vmdk" -GuestId winXPProGuest