[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 of 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 -CapacityGB 40 -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 looked 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 are:
Regards
Gregor
Since nobody bothered to answer... I tried to dig a bit more, I took a VM [2], but this time with a LSI Logic SAS controller. Set-HardDisk -ResizeGuestPartition was successful. So, is Paravirtual SCSI adapter supported with ResizeGuestPartition? If not, could you please add support in the very next PowerCLI release?
Gregor
Hi Gregor,
Thanks for reporting the issue! I filed it in the internal bugtracking system to make sure we'll look into it. If you need a temporary workaround, one possible solution is to write a custom script and run it inside guests through the Invoke-VMScript cmdlet.
Best Regards,
Andrey