4 min read

In this article by Abhilash G B, author of VMware vSphere 5.5 Cookbook, we will learn how to expand or grow a VMFS datastore with the help of two methods: using the Increase Datastore Capacity wizard and using the ESXi CLI tool vmkfstools.

(For more resources related to this topic, see here.)

Expanding/growing a VMFS datastore

It is likely that you would run out of free space on a VMFS volume over time as you end up deploying more and more VMs on it, especially in a growing environment. Fortunately, accommodating additional free space on a VMFS volume is possible. However, this requires that the LUN either has free space left on it or it has been expanded/resized in the storage array.

The procedure to resize/expand the LUN in the storage array differs from vendor to vendor, we assume that the LUN either has free space on it or has already been expanded.

The following flowchart provides a high-level overview of the procedure:
VMware vSphere 5.5 Cookbook

How to do it…

We can expand a VMFS datastore using two methods:

  • Using the Increase Datastore Capacity wizard
  • Using the ESXi CLI tool vmkfstools

Before attempting to grow the VMFS datastore, issue a rescan on the HBAs to ensure that the ESXi sees the increased size of the LUN.

Also, make note of the NAA ID, LUN number, and the size of the LUN backing the VMFS datastore that you are trying to expand/grow.

Using the Increase Datastore Capacity wizard

We will go through the following process to expand an existing VMFS datastore using the vSphere Web Client’s GUI.

  1. Use the vSphere Web Client to connect to vCenter Server.
  2. Navigate to Home | Storage.
  3. With the data center object selected, navigate to Related Objects | Datastores:
    VMware vSphere 5.5 Cookbook
  4. Right-click on the datastore you intend to expand and click on Increase Datastore Capacity…:
    VMware vSphere 5.5 Cookbook
  5.  Select the LUN backing the datastore and click on Next:
    VMware vSphere 5.5 Cookbook
  6.  Use the Partition Configuration drop-down menu to select the free space left in DS01 to expand the datastore:
    VMware vSphere 5.5 Cookbook
  7. On the Ready to Complete screen, review the information and click on Finish to expand the datastore:
    VMware vSphere 5.5 Cookbook

Using the ESXi CLI tool vmkfstools

A VMFS volume can also be expanded using the vmkfstools tool. As with the use of any command-line tool, it can sometimes become difficult to remember the process if you are not doing it often enough to know it like the back of your hand.

Hence, I have devised the following flowchart to provide an overview of the command-line steps that needs to be taken to expand a VMFS volume:
VMware vSphere 5.5 Cookbook

Now that we know what the order of the steps would be from the flowchart, let’s delve right into the procedure:

  1. Identify the datastore you want to expand using the following command, and make a note of the corresponding NAA ID:
    esxcli storage vmfs extent list

    VMware vSphere 5.5 Cookbook

    Here, the NAA ID corresponding to the DS01 datastore is naa.6000eb30adde4c1b0000000000000083.

  2. Verify if the ESXi sees the new size of the LUN backing the datastore by issuing the following command:
    esxcli storage core device list -d naa.6000eb30adde4c1b0000000000000083

    VMware vSphere 5.5 Cookbook

  3. Get the current partition table information using the following command:Syntax:
    partedUtil getptbl "Devfs Path of the device"

    Command:

    partedUtil getptbl /vmfs/devices/disks/ naa.6000eb30adde4c1b0000000000000083

    VMware vSphere 5.5 Cookbook

  4. Calculate the new last sector value. Moving the last sector value closer to the total sector value is necessary in order to use additional space.The formula to calculate the last sector value is as follows:

    (Total number of sectors) – (Start sector value) = Last sector value

    So, the last sector value to be used is as follows:

    (31457280 – 2048) = 31455232

  5. Resize the VMFS partition by issuing the following command:Syntax:
    partedUtil resize "Devfs Path" PartitionNumber NewStartingSector NewEndingSector

    Command:

    partedUtil resize /vmfs/devices/disks/ naa.6000eb30adde4c1b0000000000000083 1 2048 31455232

    VMware vSphere 5.5 Cookbook

  6. Issue the following command to grow the VMFS filesystem:Command syntax:
    vmkfstools –-growfs <Devfs Path: Partition Number> <Same Devfs Path: Partition Number>

    Command:

    vmkfstools --growfs /vmfs/devices/disks/ naa.6000eb30adde4c1b0000000000000083:1 
    /vmfs/devices/disks/ naa.6000eb30adde4c1b0000000000000083:1

    VMware vSphere 5.5 Cookbook

Once the command is executed successfully, it will take you back to the root prompt. There is no on-screen output for this command.

How it works…

Expanding a VMFS datastore refers to the act of increasing its size within its own extent. This is possible only if there is free space available immediately after the extent. The maximum size of a LUN is 64 TB, so the maximum size of a VMFS volume is also 64 TB.

The virtual machines hosted on this VMFS datastore can continue to be in the power-on state while this task is being accomplished.

Summary

This article walks you through the process of creating and managing VMFS datastores.

Resources for Article:


Further resources on this subject:


LEAVE A REPLY

Please enter your comment!
Please enter your name here