Monday, July 15, 2013

How to increase your Virtual Disk size running inside an ESX Server

This is something we all have face time and again. We configure and install an OS only to find later on that more space is needed on the primary partition. Well one could argue why not install one more virtual hard drive and use it. Well there are a number of softwares that will work only from the primary partition. Bad design, in my humble opinion, but nevertheless since the software works and solves the purpose so we might as well increase the disk space and give it more leg room.

It is pretty simple. Just run the following command from your ESX server console. Note: Take the following precautions before you attempt this operation:
  1. You should be logged in as an administrator to the ESX Console,
  2. You need to make sure that you do not have any snapshots. If you perform this operation on a virtual machine with a snapshot, your machine will fail to boot up later on.
  3. And make sure to back up your actual virtual machines files before doing anything.
The command to run on ESX server is:
vmkfstools -X [newsize] [your vmdk file]

and for VMware workstations, the command is:
vmware-vdiskmanager -X [newsize] [your vmdk file]

The vmware-vdiskmanager application will be available in the directory where VMware Workstation is installed. \VMware\VMware Workstation. So you should change (cd) to this directory and then execute the vmware-vdiskmanager command.

For example,
you have a Windows Server 2003 machine which was originally created with 20 GB of virtual HDD, however no you need more space and you now want a total space of 300G, so the command you will use:

vmkfstools -X 300g /vmfs/volumes/yourdatastore/your.vmdk,

where g in the 300 means 300 GB, for kilobytes use k, for mega bytes use M and that's it.

Now power up your machine, login and if you are running OS above Windows Vista and Windows Server 2008, from the disk management utility you could just say extend and it will work, however for Windows Server 2003 and Windows XP, the disk management tool does not have any extend functionality. I recommend the following tools:
  1. AOMEI Partition Assistant Standard (free) vailable at http://www.disk-partition.com.I have used this tool and can confidently say that it does its job.
  2. ExtPart.exe available from Dell. http://www.dell.com/support/drivers/in/en/19/driverdetails?driverid=R64398. I have not used this tool, however have read about it in a number of online blogs and other posts.
Hope this works out for you readers

No comments: