The Art of ESX Disk Expansion

Two of the most common scenarios of disk expension are 1) A .vmdk needs to be extended to allow for more space within a virtual machine or 2) a virtual machine using RAW Physical access of a LUN needs more room. First, power off the virtual machine.

1) Extending a .vmdk

SSH into the appropriate ESX server and use the following command to extend (or potential shrink) a .vmdk file:
vmkfstools –X totalspaceG pathtodisk:diskname.vmdk

Example 1
Current disk is 5GB and you want to make it 15GB.
vmkfstools –X 15G vmhba1:0:59:1:SERVERA_2.vmdk

Example 2
Current disk is 5GB and you want to make it 3GB.
vmkfstools –X 3G vmhba1:0:59:1:SERVERA_2.vmdk

Now proceed to the “Manipulating the Virtual Machine” section below.

1) Extending a LUN used for RAW Physical Access

First you need to extend the LUN on the SAN side. Use whatever command you need to (e.g. SET DISK SIZE= or right click extend, et cetera).
Now that the LUN has extended perform a rescan:
cos-rescan.sh vmhba1
cos-rescan.sh vmhba2

Now boot up the virtual machine. It should see the additional disk space but it will be unallocated.

Now proceed below.

Manipulating the Virtual Machine

Once you have increased the size of the disk you will notice that your partition isn’t using the new space as of yet. Drop to a command line and work the following magic:
diskpart
list volume
select volume 2 (or whatever # is appropriate)
list partition
select partition 1 (or whatever # is appropriate)
extend size=# (# is in MB)

That’s it – enjoy your new space.

- Jason Langone

Posted on Oct 19, 11:02 AM by Jason Langone

Commenting is closed for this article.

Commenting is closed for this article.