Increase the size of a virtual disk on ESX
When I need to increase the size of a virtual disk (.vmdk) I use the console command vmkfstools and the Gparted LiveCD. If you did not know, Gparted is an open source Partition Magic Alternative.
Here’s how I grow a VM’s disk. These steps are for a Windows VM. They should work for any OS, however.
- Download the Gparted LiveCD ISO. You will need to save it to a location you can use it to boot the VM.
- Shutdown the virtual machine you want to resize
- Log into the ESX Server via Putty, or however you can get to the console.
- Use vmkfstools to increase the size of the .vmdk For example if you had a VM named “MyOS” in a folder called “myVMFS” and you wanted to increase it from 20GB to 24GB you would type (it is case sensitive):
- Boot the VM to the Gparted ISO
- Once the Gparted partition editor loads, click your disk in the partition list
- Click the Resize/Move button
- Drag the arrow to extend the size of the partition. Be sure to work out the free space before and/or after the partition by sliding the whole partition either left or right.
- Next click the Apply button to start the resizing process.
- After it completes click the Close button
- Reboot the VM without the Gparted ISO to the VM’s OS.
- You will have to wait for a chkdsk on the reboot. Then Windows will reboot again.
- Check your new disk size in My Computer and Disk Manager!
vmkfstools -X 24g /vmfs/volumes/myVMFS/myOS.vmdk
or
vmkfstools -X 24576m /vmfs/volumes/myVMFS/myOS.vmdk
vmkfstools is a powerful console utility. If you would like to RTFM, I have saved the output of “man vmkfstools” here












If you use dynamic disks within Windows, then Gparted isn’t needed, you can just choose to expand the drive and it accomplishes it on the fly. Just thought I’d throw it out there as an option. Some times you want to avoid dynamic disks, but MS has stabilized them for a lot of things since originally introduced in the 2000 product line.
Cheers,
Jim
Hi guys,
Anyone using Symantec Backup exec 11D to backup guest OS on ESX 3.0
Malik,
The VMware Communities forum has several posts from administrators using Backup Exec 11D. The following link should take you to a summary page of posts to check out.
http://communities.vmware.com/search.jspa;jsessionid=AD8D369B94561582FB57E17D1BB5DF97?resultTypes=BLOG_POST&resultTypes=DOCUMENT&resultTypes=MESSAGE&resultTypes=BLOG&resultTypes=COMMUNITY&peopleEnabled=true&q=Symantec+Backup+exec+11D
Thanks Rich,
It helped me ,
Another question, When creating new VM am giving the path to use an exisiting one which resides in my storage.When i make ssh to host server it creates another directory for configuration , is it possible i can put all in one,i dont want two direcories for same VM.
Malik,
If I understand you right, the smoothest way to use an existing .vmdk would be to follow the following advice:
If the folder already has a .vmx file in it, use the storage browser of the vi client to browse to the folder and double click the .vmx to auto register the vm.
If you have to create a .vmx file and you want to keep your VM files in the same folder, you’ll want to create an new VM first (do not install the OS), delete the new hard drive from the VM, then copy the vmdk file you want to use to the new VM’s folder. You can then edit the VM and add the newly moved existing vmdk file.
Is a direct in place upgrade possible for ESX 3.0.1 to ESX 3.5 ?
Malik,
Yes it is a possible upgrade path, but 3.0.1 has seen it’s share of issues coexisting between VC 2.5 and other ESX 3.5 hosts during the upgrade. I would recommend you read the following before getting started:
http://www.vmware.com/support/vi3/doc/vi3_esx35_vc25_rel_notes.html
http://www.vmware.com/pdf/vi3_35/esx_3/r35/vi3_35_25_upgrade_guide.pdf
http://vmetc.com/2008/01/31/upgrade-to-esx-35-without-leaving-your-desk/
Hey Rich,
Thanks Dude.
Need help
I have taken image of one of my server using Backuexec server 7.0 and used the same to convert to vmdk how do i import it to my storage of ESX 3.0.1 ??? , i used vmkfstool as follows:
vmkfstool -i , when it had done with cloning i saw that there was a file in my storage by name vmhba0:0:1:0 , my point is after i import i should be able to create VM using VMclient 2.0 selecting create VM using exisitng Virtual disk.where am i wrong.
Malik,
If you already have the image converted to .vmdk format – you mean a stand alone virtual machine? Then the easiest thing to do would be to use VMware Converter on the same computer as the .vmdk and v2v it to ESX.
I am closing the comments on this post. Please use my Insane page for general questions and comments.
Thanks, Rich
OMG, could you make it any easier?… thanks sooooo much!!
OMG, could you make it any easier?… thanks sooooo much!!