Вы находитесь на странице: 1из 12

Increasing your Virtual Disk

size running inside VMware


ESX or workstation
by Saravana Kumar KKB

Abstract:While configuring and installing an OS, we find later on that more


space is needed on the primary partition. One could argue why not install one
more virtual hard drive and use it. Well there are a number of software that will
work only from the primary partition. This paper will guide step by step on how to
increase the virtual hard disk on a VMware ESX server which has and which
doesn't have snapshots.

About the author: Saravana Kumar is working as Senior QA Engineer for IBM
Policy Atlas team under ECM. Reach out to him at saravkkb@in.ibm.com

Introduction
Today many engineering teams in worldwide, uses more Virtual environment for their
test and development activities than physical machines.
While configuring and installing an OS, we find later on that more space is needed on
the primary partition. One could argue why not install one more virtual hard drive and
use it. Well there are a number of software that will work only from the primary partition.
This paper will guide step by step on how to increase the virtual hard disk on a VMware
ESX server which has and which doesn't have snapshots.

Snapshot
Snapshots are not complete copies of the original vmdk disk files. Taking a snapshot does
not create a complete copy of the original vmdk disk file, rather it only copies the delta
disks. The change log in the snapshot file combines with the original disk files to make
up the current state of the virtual machine. If the base disks are deleted, the snapshot files
are useless.

Increasing a VM Disk
VM which doesn't have snapshot:
Increasing the hard disk in ESX server:
1. Shutdown the VM Image
2. Ensure you have taken backup of the existing files(mainly all the .vmdk
files)
3. Login to ESX console as root
4. Run the following command to increase the size to the new specified size

vmkfstools X [new size] [your vmdk file]


For Example:
There is a Windows Server 2003 machine which was originally created with 50
GB of virtual HDD, however now more space is needed and you now want a total
space of 100G. So the command to use for this is :

~ # vmkfstools -X 100G islrpbeixn120.vmdk


Grow: 100% done.
A message will appear 100% done as confirmation.
Note: If you are in some other path you might need to give the complete path of
the .vmdk file. .vmdk files usually reside in below path in your ESX
/vmfs/volumes/
2

Increasing the hard disk in VMWare workstation:


Command:

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.
Once this is done, the next job is to increase the primary partition and use the complete
available hard disk space ( in this case 100GB we have increased the hard disk). We can
use various partition assistant software to do this. Lets take most recommended or widely
used Gparted Live CD.
http://gparted.sourceforge.net/livecd.php
Download this ISO and upload to any of the datastore in your ESX or keep it in your
client machine hard disk.

Increasing hard disk space using Gparted Live ISO:


1. Right click your VM name from the inventory and select the Edit settings
Option
2. Click the Option tab and choose the Boot Options link
3. Choose Force entry to BIOS setup screen check-box button

4. From the BIOS choose the boot from CD-ROM Device option

5. From the VM CD/DVD Drive map to the Gparted Live ISO which is in
your hard disk or ESX data store.

6. Once this is done Exit the BIOS by choosing Exit Saving Changes

7. Now, the VM will start booting with Gparted Live ISO

8. Select the default options , language in next 2 questions

9. Once it is booted with X windows, below screen will be shown

10. Select the boot partition and choose the Resize/Move option

11. Now, drag the arrow in the box till the end of the available disk space

12. Click the Apply button

13. Once done primary partition will start growing the disk

14. Wait of the growing option to complete, until you get complete screen

15. We are almost at the final step now Choose the exit option and select
Reboot radio button

16. Once VM is rebooted, Operating system will run the CHKDSK (In
windows) or FSCK (Linux) command to check the file system integrity

10

status of the Hard disk.

17. Now, you can check your Hard disk space after logging into your
machine.

VM which has snapshot:


In general VMware doesnt allow growing the Virtual hard disk of a Virtual machine
which has a snapshot. Sometimes the snapshot might be critical and we cannot afford to
11

delete it. When we are in such situation the only option we have is to clone the VM to
another machine and increase the size by following the steps mentioned above and under:

Increasing Hard disk space in VM which doesnt have


snapshot
Steps for cloning:
1. Create a New Virtual machine by selecting corresponding OS
2. Now, copy the source .vmdk and .vmx files to the folder of the newly
created Virtual machine
For example:
If your VM has 2 snapshots there will be 3 .vmdk files
<your vmname>.vmdk
<your vmname>-00001.vmdk
< your vmname>-00002.vmdk
You should copy the base file <your vmname>.vmdk and <your vmname>.vmx
file to the destination VM directory.

Conclusion:
We have ever-increasing requirements, release after release. Engineering teams face
many times the situation of installing more software in the available VMs. Tools like
VMware , Gparted live ISO comes handy in increasing the hard disk space. Raising the
IT ticket for the same involves lot of manual and time involved. Instead one can DIY by
following the mentioned steps.

12

Вам также может понравиться