One of my virtual machines, running on ESX Server 3 (VI3) was in dire need to get it's boot partition expanded. Obviously I had miscalculated the storage requirements for this particular VM, but luckily there is an easy way to expand the VMDK file and then use third party tools to let Windows utilize the new space.
- 1. Shut down the Virtual Machine
- 2. Expanding the VMDK
Log into the ESX server via ssh (I prefer Putty) Find the .vmdk file you want to expand and use vmkfstools to expand it:
vmkfstools -X 20g vmname.vmdkThat expands the existing virtual disk to 20 Gigabytes, now we need to make the extra space available to Windows. - 3. Resize boot partition
As Windows doesn't allow you to resize the active boot partition, you'll need a third party tool to accomplish this step.
In this case I used the GParted LiveCD, but you could also use BartPE or other bootable disk partition/resize tools.
All I did was to download the GParted ISO, copy the .ISO to my datastore, mount it as a Virtual CD-ROM device and boot my VM from it. Then use the tool of choice to expand the existing partition. - 4. Remove the virtual CD-ROM device and reboot the VM
Thats it. How painful would that have been if this was a physical machine?