Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Creating and Managing VMFS Datastores

Save for later
  • 5 min read
  • 05 Mar 2015

article-image

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:
creating-and-managing-vmfs-datastores-img-0

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:
    creating-and-managing-vmfs-datastores-img-1
  4. Right-click on the datastore you intend to expand and click on Increase Datastore Capacity...:
    creating-and-managing-vmfs-datastores-img-2
  5.  Select the LUN backing the datastore and click on Next:
    creating-and-managing-vmfs-datastores-img-3
  6.  Use the Partition Configuration drop-down menu to select the free space left in DS01 to expand the datastore:
    creating-and-managing-vmfs-datastores-img-4
  7. On the Ready to Complete screen, review the information and click on Finish to expand the datastore:
    creating-and-managing-vmfs-datastores-img-5

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:
creating-and-managing-vmfs-datastores-img-6

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


    creating-and-managing-vmfs-datastores-img-7

    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


    creating-and-managing-vmfs-datastores-img-8

  3. Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at AU $19.99/month. Cancel anytime
  4. 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


    creating-and-managing-vmfs-datastores-img-9

  5. 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
  6. 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


    creating-and-managing-vmfs-datastores-img-10

  7. 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


    creating-and-managing-vmfs-datastores-img-11


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: