[1] VMware vSphere PowerCLI 5.1 Release 2 Build 1012425
[2] Microsoft Windows Server 2008 R2 Datacenter with Service Pack 1, single virtual Hard Disk 1, single SCSI Controller 0 type VMware Paravirtual
I tried to use [1] to expand a virtual disk and partition capacity on a virtual machine [2] like this:
Get-HardDisk-VM"..."|Set-HardDisk-CapacityGB40-GuestUser"..."-GuestPassword"..."-ResizeGuestPartition-Confirm:$False
Set-HardDisk : 05.03.2013 16:27:44 Set-HardDisk Execution of the script in guest OS on VM '...' failed: 'The system cannot find the drive specified.
Specified disk "0" was not found
'
At line:1 char:36
+ Get-HardDisk -VM "..." | Set-HardDisk -CapacityGB 40 -GuestUser "...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (...:VirtualMachineImpl) [Set-HardDisk], VimException
+ FullyQualifiedErrorId : Client20_RunScriptInGuestHelper_RunScriptFileInGuest_ScriptError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.SetHardDisk
WARNING: The system cannot find the drive specified.
Specified disk "0" was not found
The virtual disk size was changed correctly but the partition inside the VM was not extended. So I checked under the hood. GuestDiskExpansion_WindowsGuest.bat gets executed inside the VM with parameters Bus Number = 0, Unit number = 0, Partition = "", ControllerType = SCSI. However DiskPart returns disk type as SAS (disk_type = SAS). Also in the batch file line 90:
set disk_target=!disk_target:~0,-1!
It strips a valid disk target number 0 to an empty string! My questions:
- how can I trace disk type mismatch, why does Set-HardDisk pass the disk type as SCSI instead of SAS?
- is line 90 a bug, should it be removed?
Regards
Gregor