Amount of free space reported on the Datastore is incorrect in vCenter Server & ESXi
search cancel

Amount of free space reported on the Datastore is incorrect in vCenter Server & ESXi

book

Article ID: 315204

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • The Datastores view and the Summary tab in vCenter Server report an incorrect amount of free space on the host
  • In a direct vSphere Client connection to an ESXi host, the values may be reported correctly if manually refreshed
  • Even after a manual refresh, the values may eventually be shown incorrectly

Environment

VMware ESXi 7.x
VMware ESXi 8.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x

Cause

vCenter may show free space of datastores in various resource windows which are out of sync from the actual value on the host for a period of five minutes. The hostd agent on each host schedules a thread to monitor the free space on the datastore every five minutes; if the change in value is greater than 100 MB, it re-syncs this value on vCenter Server.

Resolution

Currently, there is no resolution.
 

Workaround

Use one of the following workaround methods.

  1. Refresh the data using a PowerCLI Script
    • Execute a PowerCLI script which invokes the Get-Datastore -Refresh command on an hourly schedule to the host.

      Example:

      C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-Datastore -Refresh
      Name FreeSpaceMB CapacityMB
      ---- ----------- ----------
      isos 138986 554355
      datastore1 2438 236544
      MSCS-share 3298 3584
      LH-iSCSI-0 15660 102144
      LH-iSCSI-1 16612 50944

  2. Change the refresh interval on ESXi hosts prior to ESXi 7.0 U1
    • Edit the configuration file and change the refreshInterval value to the desired interval.
    • To change the refreshInterval value:
      1. Using a text editor, open the /etc/vmware/hostd/config.xml file on the host.
      2. Locate the <datastore> element. This element in the default file is similar to:

        <datastore>

        <!-- <inventory>/etc/vmware/hostd/datastores.xml</inventory> -->


        <!-- <refreshInterval>0</refreshInterval> -->

        <!-- <refetchVMFSDatastoreListInterval>30</refetchVMFSDatastoreListInterval> -->
        </datastore>
      3. Remove the comment indicators and replace the 0 (zero) in the <refreshInterval> element with the desired number of minutes. For example, to set the refresh interval to one hour, change this line:

        <!-- <refreshInterval>0</refreshInterval> -->

        to:

        <refreshInterval>60</refreshInterval>
      4. Save and close the file.
      5. Restart the hostd service for the changes to take effect.

  3. Change the refresh interval on ESXi Hosts on builds 7.0U1 or later
    1. Create a temporary JSON file:

      /bin/configstorecli config current get -c esx -g services -k hostd -outfile tmp.json

    2. Edit the file:

      vi tmp.json

    3. Create datastore section under hostsvc and add refresh_interval option value.

            "hostsvc": {
               "datastore": {
                  "refresh_interval": 60
               },

    4. Apply the file to the database:

      /bin/configstorecli config current set -c esx -g services -k hostd -infile tmp.json

    5. Restart hostd service:

      /etc/init.d/hostd restart

Additional Information

Note:

/etc/vmware/hostd/config.xml is not applicable for ESXi hosts using ConfigStore as ConfigStore was introduced in ESXi 7.0 U1.

For steps on How to change configuration settings for Hostd service in vSphere ESXi 7.0 Update 2 and later, refer to KB 319967.

For more information, see: VMware vSphere PowerCLI Documentation