Best Practices of Resizing Windows Virtual Machine Disks on VMWARE ESX Server 3<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Author : VM2008
====================================================

Expand:

 

Workaround 1 : vmkfstools + diskpart ( additional VM need)

 

Workaround 2 : VMWARE  Converter (Best and Easy)

 

Workaround 3 : vmkfstools + Parted LiveCD (for no VMWARE Converter users or VMWARE Converter doesn’t work)

 
Step 1) Power off Virtual Machine

 

Step 2) Expanding the VMDK

Log into the ESX server via ssh (use Putty) Find the .vmdk file you want to expand and use vmkfstools to expand it:

 

 
vmkfstools –X xxxxG /vmfs/volumes/file_system_label/dir/myDisk.vmdk

notes: chance xxxx with whatever size you want it to be


Sample :

vmkfstools -X 30g  /vmfs/volumes/ESX01_LOCAL01/WSOEx64/WSOEx64.vmdk

ls -lah WSOEx64.vmdk

 

Step 3) Power up the virtual machine

Step 4) Go to command prompt type "chkdsk" - This is critical - it may cause issues if you skip this step.

Step 5) Download the Parted LiveCD from  here (A linux based free GUI tool like Partition Magic
VM2008 Notes: 0.3.4-8 doesn’t work for VMWARE machine, but 0.3.4-7 works well

Step 6) Mount the downloaded ISO as the CD-Rom of the Virtual Machine. You can mount the ISO directly or burn it to CD then mount the CD-Rom to the Virtual Machine.

Step 7) Restart the virtual machine and boot from the CD . (You may have to hit ESC to bring up the boot menu.)

Step 8) Choose your Language and Keyboard Layout

Step 9)  Click the partition you want to expand then apply change

Step 10) Reboot, Power up the virtual machine

 

 

====================================================

 

 

Shrink:

 

Workaround 1 : VMWARE  Converter (Best and Easy)

 

Workaround 2 : Parted LiveCD + cloning utility (Ghost) (for no VMWARE Converter users or VMWARE Converter doesn’t work)

 

Step 1) Power off Virtual Machine

Step 2) Download the Parted LiveCD from  here (A linux based free GUI tool like Partition Magic
VM2008 Notes: 0.3.4-8 doesn’t work for VMWARE machine, but 0.3.4-7 works well

Step 3) Mount the downloaded ISO as the CD-Rom of the Virtual Machine. You can mount the ISO directly or burn it to CD then mount the CD-Rom to the Virtual Machine.

Step 4) Restart the virtual machine and boot from the CD . (You may have to hit ESC to bring up the boot menu.)

Step 5) Choose your Language and Keyboard Layout

Step 6)  Click the partitions, just shrink the partition, no need to move partitions from right to left to release the free space near the right(end) of vmdk file.

 

Step 7) Power off Virtual Machine

Step 8) create a new vmdk file at the desired size
vmkfstools -a lsilogic -c 15G HA_TEST_small.vmdk
ls –lah HA_TEST_small.vmdk
Step 9)  mount the new vmdk in your VM, and use a disk imaging/cloning utility (ghost, truep_w_picpath,etc) to move the VM's primary disk contents to the secondary disk

Step 10) detach the old vmdk from your VM, Power on the VM

VM2008 Notes: : Old solution : Parted LiveCD + vmkfstools  doesn’t work under ESX Server 3

====================================================