ESXi 5: Expanding datastore by extending local array

April 21, 2012 at 21:48 (VMWare) (, , , , , , , , , , , , , , , , , , )

Recently i extended my RAID 5 array by replacing one-by-one hdd’s with bigger ones and waiting for each to rebuild.

All the instructions are executed on a HP DL360 G6 with an SmartArray P410i controller with only one logicaldisk.

It is highly recommended that you backup all your VM’s before executing a single command – everything worked fine for me but one error in a command could leas to a complete data loss of everything!

To see the rebuilding status, HP has a tool called hpacucli which allows you to control the array and see the status of it out of the ESXi console.

First you have to install HP’s ESXi5 Offline Utilities right from here

Upload it to your datastore, login to your ESXi5 server and execute

  • esxcli software vib install -d/path/to/

Now you can see the status of your array with

  • /opt/hp/hpacucli/bin/hpacucli controller slot=0 show config

** Warning: Add a new hard disk ONLY if ALL harddisks show “OK” **

Remove one disk, add the new one and execute again

It will show something like this:

logicaldrive 1 (838.1 GB, RAID 5, Recovering, 3% complete)

physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 300 GB, OK)
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 300 GB, OK)
physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 300 GB, OK)
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 900.1 GB, Rebuilding)

Wait until everything recovered and all disks show OK again. Then go ahead with the second disk and so on till all disks are changed…


After adding all the disks without destroying the array you can now see unused space here:

  • /opt/hp/hpacucli/bin/hpacucli  controller slot=0 array all show detail

Now let’s extend the array to use up the new space:

  • /opt/hp/hpacucli/bin/hpacucli controller slot=0 logicaldrive 1 modify size=max

A second call to show detail of the array should show you that the unused space is again zero, now your logicaldrive is successfully extended!

  •  /opt/hp/hpacucli/bin/hpacucli controller slot=0 array all show detail

Now on to the datastore part. Unfortunatly it is not possible to extend or expand the datastore from within the GUI because the “VMWare extend” is for adding several sources of Partitions, NFS mounts etc. to one “big” datastore and not expanding the partition to fill up the new space we won.

First we need to find what disk we are using, as i’m have only one logical disk, this is easy for me, be sure to select the correct disk from: /vmfs/devices/disks/

let have a look at the partitioning table:

  • partedUtil getptbl /vmfs/devices/disks/vml.0200010000600508b1001c504c1f73b6b6947016164c4f47494341

109406 255 63 1757614684
1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
2 1843200 10229759 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
3 10229760 860050190 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

The last line is the one we are intrested in, the VMFS partition. For me it is the Partition number 3 with start-sector at 10229760  and end-sector at 860050190.

We now need to know the last sector of the Harddisk we could use up, give that a shot:

  • partedUtil getUsableSectors /vmfs/devices/disks/vm.0200010000600508b1001c504c1f73b6b6947016164c4f47494341

This is what i get back:  1757614650

Now i can go and extend the partition where my datastore lives in:

  • partedUtil resize “/vmfs/devices/disks/vml.0200010000600508b1001c504c1f73b6b6947016164c4f47494341” 3 10229760 1757614650

Note the last 3 arguments: Partition 3, start-sector and new last-sector

After that has been done without output we will stright go and expand the Filesystem of our VMFS partition to fill it up:

  • vmkfstools –growfs /vmfs/devices/disks/vml.0200010000600508b1001c504c1f73b6b6947016164c4f47494341:3 /vmfs/devices/disks/vml.0200010000600508b1001c504c1f73b6b6947016164c4f47494341:3

Again, note the :3 at the end..

finished & have phun ;)



  1. benpro said,

    This made my day! Many thanks for this article, I was stuck in vSphere trying to extend my VMFS partition after upgrading disks… which is not possible.

    • devbios said,

      Nice to hear that, thanks ;)

  2. Eric said,

    Thanks for this. Much more clear and concise than the VMware KB article

    I’m assuming I need to shutdown the hosts running on my datastore that I am expanding. Correct?

    • devbios said,

      Hey Eric,

      i didn’t shut down my hosts on it while expanding everything, from exchanging the Harddrives with bigger ones till the growfs command, it worked for me without downtime.

      But to be on the safe side i recommend a backup ;)

  3. Nick said,

    Thank you for this – your source is no longer valid though. new link

    Having trouble with the installation of the tools though. Seems to run but no folder in /opt/
    If my path is /vmfs/volumes/GPS Store 1/ what should my command be. Sorry – i’ve tried several variations but no go….

  4. ewwhite said,

    I was able to do this from the GUI without incident after making the hpacucli change. I also rescanned the LUNs in the GUI, which reflected the new logicaldrive size.

    • Jim said,

      I was also able to expand the VMFS partition from the GUI after making the hpacucli changes outlined above.

  5. John said,

    -growfs command did not work for me

    • devbios said,

      Just tried it again today, works as expected for me.

    • Jörg said,

      Hi, try –growfs . That worked for me.

  6. Michael said,

    Thanks, helped me a lot….
    In ESXi 5.5 U2 the correct command to grow up VMFS Partition is:

    vmkfstools -G

    vmkfstools –growfs doesn´t work anymore.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: