Increase or expand the datastore directly from the ESXi host
search cancel

Increase or expand the datastore directly from the ESXi host

book

Article ID: 409657

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to increase the datastore capacity when vCenter UI is not available or down

Environment

VMware vSphere ESXi

Cause

Alternate method of increasing the datastore capacity when vCenter UI is not available or down.

Resolution

  1. Log in directly to one of the ESXi host that has access to the datastore through the GUI (Host Client) using root credentials.
  2. Navigate to Storage > Datastores and select the datastore you are trying to expand or increase.
    1. Right-click on the datastore and select Increase Capacity. Alternatively, select the Increase capacity button.


      You should be prompted to select one of two options:

      Add an extent to existing VMFS datastore
      Expand an existing VMFS datastore extent

      Note: The first option is to create a multi-extent datastores by spanning (adding) a new volume to the existing datastore. The second option is to increase the capacity for the existing device itself. In this example, the second option is used:
       
  3. Select the VMFS partition as highlighted in the image and use the side-scroller to indicate the range of the expansion that would need to be done and click Next.


    Note: Sometimes, the volume expansion from the host client might fail with the following error :- 
    'Failed to expand VMFS datastore - Cannot parse "NaN" as a long value'. 

    a) Login to the ssh session of the ESXi host and validate the usableSectors using the below commands.

    b) Run 'partedUtil getptbl /vmfs/devices/disks/naa.xxxxxxxxxxxxxxxxxxx'

    Sample output: 
    diskSize (42949672960) AlternateLBA (21474836479) LastUsableLBA (21474836446) NewLastUsableLBA (42949672926)
    gpt
    2673493 255 63 42949672960
    1 2048 21474836446 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
     

    c) Run 'partedUtil getUsableSectors /vmfs/devices/disks/naa.xxxxxxxxxxxxxxxxxxx' to get the details of the usable sectors of this device

    Sample output:
    diskSize (42949672960) AlternateLBA (21474836479) LastUsableLBA (21474836446) NewLastUsableLBA (42949672926)
    34 42949672926

    In this case we can see that the disk size is 42949672960 but the available disk space for actual usage is 42949672926
    In such cases, when we expand the datastore using the host client we need to leave few MBs in the end instead of using the complete capacity for expansion.
  4. Click Finish. You should now be able to view the datastore expansion as completed.

  5. Immediately under Storage option, rescan for storage adapters, new storage devices and VMFS volumes for all hosts from vCenter.
    Or by commands on all hosts:
    $ esxcli storage core adapter rescan --all 
    $ vmkfstools -V

Important: 
As this was done directly on the ESXi host, VMware recommends doing a cluster level storage rescan so that all of the ESXi host accessing the same datastore are sync with the expansion that was recently completed. If a cluster level rescan is not done from the vCenter Server, there is a good chance that the vCenter Server might not readily detect the changes which may lead to disparity in the current space/usage of the datastore. VMware recommends to always do a cluster level rescan on the vCenter Server level when the datastore is increased or expanded directly from the ESXi host.