Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Virtualization / VMWare / Increasing VMFS Datastore Capacity on VMware ESXi (vSphere)

November 19, 2021 VirtualizationVMWare

Increasing VMFS Datastore Capacity on VMware ESXi (vSphere)

In this article, we’ll look at how to increase the size of a VMFS datastore using the vSphere Web Client interface or VMware ESXi command prompt.

Suppose, when checking the free space on VMFS datastores, you found that one of them is running out of free space. You want to increase the size of your VMFS datastore by adding more storage space.

First of all, you need to extend the size of the LUN on your storage device. The way how to do it depends on the vendor of your storage. If you are using Windows Server iSCSI LUN, you can increase the vhdx through via Server Manager (File and Storage Services -> iSCSI -> select a disk -> Extend iSCSI Virtual Disk). In our example, we have extended the LUN size from 100GB to 105GB.

VMWare ESXi supports two ways of expanding VMFS datastores: by using unused space on the same LUN (we are describing this method in this article) or by adding additional LUN (the method is called an extent). A VMFS extent is a kind of partition that spans multiple LUNs. Data will be written to the second LUN after the first one is full, etc.

Contents:
  • How to Increase VMFS Datastore Using vSphere Web Client?
  • Expanding VMFS Datastore on VMware ESXi from Command Line

How to Increase VMFS Datastore Using vSphere Web Client?

  1. Select Storage in the vSphere Client interface;
  2. Right-click the datastore and select Increase Datastore Capacity;
    Increase VMFS Datastore Capacity with vSphere Web Client
  3. Select a disk (LUN) you want to increase. Note its value in the Expandable column. It should say Yes. It means that this VMFS datastore can be extended.
    If it says No, you can only increase this device capacity using the VMFS Extent by expanding the VMFS datastore to two LUNs.
    select disk or lun to increase size of the vmfs datastore
  4. At the next step, you need to choose how much you want to increase the storage size. By default, the wizard offers to use all available space (Use Free space 5Gb to expand the datastore). You will see a warning that you are expanding the current partition using free space;
    set new vmware vmfs datastore size

    The datastore already occupies one or more extents on this device. Selecting free space adjacent to an extent in the datastore will expand that extent. Selecting any other option will add a new extent to the datastore.
  5. If it suits you, click Next and you will see how much the VMFS datastore will grow (Increase Datastore Size by) and its new size (Future Datastore Size) in the Summary screen.
    ready to increase vmfs datastore capacity
The maximum size of a VMFS datastore for VMFS6 is 64TB. Storage may consist of one LUN or up to 32 extents with a total size up to 64TB.

In some cases, you cannot expand the VMFS datastore from the vSphere Client graphical interface. Most often a problem is related to an inability to increase VMFS storage on a boot disk device. Then you see this error:

Failed to expand VMFS datastore VMFSstore - Cannot change the host configuration.

VMware error: Failed to expand VMFS datastore - Cannot change the host configuration

In this case, you will have to expand the datastore from the VMware ESXi command prompt.

Expanding VMFS Datastore on VMware ESXi from Command Line

  1. Connect to your ESXi host via SSH (on Windows you can use a built-in SSH client);
  2. Rescan storage adapters: esxcli storage core adapter rescan --all
  3. Then identify a disk (LUN) your VMFS datastore is located on: vmkfstools -P /vmfs/volumes/DCx2VMFS1. In our case, the disk looks like /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f.:1 meaning that the VMFS datastore is located in the first partition of the disk;
    vmkfstools get vmfs datastore UUID
  4. Check the partition table of the disk: partedUtil get /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f
    13706 255 63 220200960
    1 2048 209713152 0 0

    In our case, the first partition sector is 2048 and the last one is 209713152.

  5. Then get the number of the last sector available for use. It is the sector the VMFS partition may be expanded to: partedUtil getUsableSectors /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f
  6. In my case the command has returned the following error:
    Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?
    
    Warning: Not all of the space available to /dev/disks/naa.6000f3fdc1175dacd86b623db26e4d1f appears to be used, you can fix the GPT to use all of the space (an extra 10485760 blocks) or continue with the current setting? This will also move the backup table at the end if is not at the end already. diskSize (220200960) AlternateLBA (209715199) LastUsableLBA (209715166) NewLastUsableLBA (220200926)
    

    using partedUtil on vmware esxi command prompt

  7. To fix the error in the GPT table, run the command below: partedUtil fixGpt /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f
    FixGpt tries to fix any problems detected in GPT table.
    Please ensure that you don't run this on any RDM (Raw Device Mapping) disk.
    Are you sure you want to continue (Y/N): Exiting ...
    gpt
    13706 255 63 220200960
    1 2048 209713152 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
  8. Display the number of the last available sector (NewLastUsableLBA) again: partedUtil getUsableSectors /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f In this example, you can expand the partition to sector 220200926;
    partedUtil - get last available sector NewLastUsableLBA
  9. So we have the numbers of the first (2048) and the last (220200926) sectors of the partition. Let’s extend it: partedUtil resize /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f 1 2048 220200926
  10. Then grow the VMFS file system: vmkfstools --growfs /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f:1 /vmfs/devices/disks/naa.6000f3fdc1175dacd86b623db26e4d1f:1
  11. Refresh a list of VMFS datastores: vmkfstools –V
  12. Check the size of the local datastores using this command: df –h
    esxi cli: check vmfs datastore size and free space

As you can see, the VMFS datastore has been successfully expanding by 5 GB. The operation was performed online without unmounting the datastore or stopping the VM.

We also recommend reading the guide on how to shrink VMware virtual machine disk (vmdk) files.

1 comment
4
Facebook Twitter Google + Pinterest
previous post
How to Hide or Show User Accounts from Login Screen on Windows 10/11?
next post
PowerShell: Get, Modify, Create, and Remove Registry Keys or Parameters

Related Reading

Updating VMware ESXi Host from the Command Line

May 11, 2022

How to Change or Disable Session Timeout in...

April 13, 2022

Managing Hyper-V Virtual Machines with PowerShell

March 15, 2022

How to Upgrade VM Hardware Version in VMware...

March 4, 2022

VMware PowerCLI: How to Install and Manage vSphere...

February 28, 2022

1 comment

Steffen March 7, 2022 - 12:59 pm

Great tutorial, especially the command line part. Saved my day! Thank you!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows 7
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012 R2
  • PowerShell
  • VMWare
  • Hyper-V
  • MS Office

Recent Posts

  • Create Organizational Units (OU) Structure in Active Directory with PowerShell

    May 17, 2022
  • Windows Security Won’t Open or Shows a Blank Screen on Windows 10/ 11

    May 17, 2022
  • How to Manually Install Windows Updates from CAB and MSU Files?

    May 16, 2022
  • RDS and RemoteApp Performance Issues on Windows Server 2019/2016

    May 16, 2022
  • Deploying Software (MSI Packages) Using Group Policy

    May 12, 2022
  • Updating VMware ESXi Host from the Command Line

    May 11, 2022
  • Enable or Disable MFA for Users in Azure/Microsoft 365

    April 27, 2022
  • Fix: You’ll Need a New App to Open This Windows Defender Link

    April 27, 2022
  • How to Reset an Active Directory User Password with PowerShell and ADUC?

    April 27, 2022
  • How to Completely Uninstall Previous Versions of Office with Removal Scripts?

    April 26, 2022

Follow us

woshub.com

ad

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Shrinking VMDK Virtual Disk Size on VMWare ESXi
  • How to Stop/Kill a Stuck Virtual Machine on Hyper-V?
  • Match Windows Disks to VMWare VMDK Files
  • How to Install and Configure Free Hyper-V Server 2019/2016?
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine
  • Poor Network Performance on Hyper-V VMs in Windows Server 2019
  • Accessing USB Flash Drive from VMWare ESXi
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top