Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • 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 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)

September 15, 2022 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

Reset Root Password in VMware ESXi

October 12, 2023

How to Fix ‘An Operating System Wasn’t Found’...

July 14, 2023

Unmounting an NFS Datastore from VMware ESXi

April 21, 2023

How to Increase Virtual Machine Disk Size in...

April 6, 2023

How to Install Free VMware Hypervisor (ESXi)

January 24, 2023

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 Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Adding Drivers into VMWare ESXi Installation Image
  • Shrinking VMDK Virtual Disk Size on VMWare ESXi
  • How to Access VMFS Datastore from Linux, Windows, or ESXi
  • Hyper-V Virtual Machine Stuck in Stopping/Starting State
  • Recovering a Deleted VMFS Datastore on VMware ESXi/vSphere
  • Match Windows Disks to VMWare VMDK Files
  • Updating Windows VM Templates on VMWare with PowerShell
Footer Logo

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


Back To Top