Thursday, February 26, 2009

Increase the Size of a VMWare Guest Boot/System Drive

Have you ever created a VMWare guest server (Windows) and made the C drive too small only to realize later that you're unable to resize it?

Be sure to backup your VMDK prior to trying these steps.

Here is a way to do it on ESX 3.5 update 2:
(This also works on vSphere 4.1 Update 1)
  1. Shut down the problem server.
  2. Edit the settings of the server and note the location of the VMDK file you want to change.
  3. You can extend the drive using the GUI or using steps 4 and 5.
  4. SSH to your ESX server and navigate to the data store you noted in step 2.
  5. Run vmkfstools -X 40G nameofthedisk.vmdk. 40G is the total size of the disk you want to change it to, not the the amount you want to increase it by. (/vmfs/volumes/.....)
  6. Mount the drive that you want to expand on a Windows 2008 Server.
  7. Extend the volume from Disk Management by right clicking on it and selecting extend.
  8. Shut down the 2008 server and remove the disk from the settings.
  9. Boot up the old problem server.
  10. It will likely ask you for a reboot after the OS detects what it thinks is a new drive.
  11. Reboot, and Voila! Your C drive is now bigger!
NOTE: I have found on a 2008 R2 server you will sometimes get the 0xc000000e error unless you follow this: http://support.microsoft.com/kb/2261423 specifically #7 in the resolution section.

NOTE: You must have contiguious space where the original C drive exists for this to work.