5 Replies Latest reply on Sep 16, 2019 2:23 PM by COS

    Grow a VMs disk via PowerCLI - Getting error  'The system cannot find the drive specified.'

    COS Master

      I am trying to increase the C: drive of a VM with the below command....

      Get-HardDisk -vm "test-diskbump" | where {$_.Name -eq "Hard Disk 1"} | Set-HardDisk -CapacityGB 155 -ResizeGuestPartition -Confirm:$false

       

      It actually increased the VMdk but when it tries to adjust the partition, I get the below Error....

      "Execution of the  script in guest OS on VM 'test-diskbump' failed: 'The system cannot find the drive specified."

       

      So I tested segments of the script.

      The below returns correct data with no error...

      Get-HardDisk -vm "ps-laoyang" | where {$_.Name -eq "Hard Disk 1"}

       

      CapacityGB      Persistence                                                    Filename

      ----------      -----------                                                    --------

      155.000         Persistent              [vmware-nfstest] test-diskbump/test-diskbump.vmdk

       

      Looks good so far.

       

      But when I add the "-ResizeGuestPartition -Confirm:$false" I get the error below...

      "Execution of the  script in guest OS on VM 'test-diskbump' failed: 'The system cannot find the drive specified."

       

      any ideas?