Jun 19, 2012

VMWARE virtual machine boot partition size expansion


Remove page file from c:\ & ensure there is no snapshot of the VM for which we are considering disk expansion.
Note down partition size and .vmdk details from vsphere client. (machine1 = C:\ of which is to be expanded). Say existing C:\ is 30 GB and we want to expand to 50 GB.

Detach this hard disk i.e. vmdk from machine1 VM. (Make sure not to delete that .vmdk)

Vmkfstools –X 50G machine1_c.vmdk

Attach this machine1_c.vmdk file to another windows 2008 server or windows 7 machine using vsphere client.
Let’s consider we have used Win7 machine. Then boot win7 and from my computer – manage, go to disks. Here we can see original disk of 30 GB plus unallocated space of 20 GB.
Right click and expand it. Once done. Detach it from that machine i.e. remove the hdd from win7 VM. (No deletion).

Attach this expanded machine1_c.vmdk back to original machine.
Done.

For the above method if we do not have win7 machine and using windows xp then we need to use diskpart command to expand vmdk.

No comments: