Incorrect space usage reported for objects in vSAN ESA Cluster
search cancel

Incorrect space usage reported for objects in vSAN ESA Cluster

book

Article ID: 383485

calendar_today

Updated On:

Products

VMware vSAN 8.x

Issue/Introduction

‘esxcli vsan debug object list’ command output showing discrepancy in the ‘Used’ space and the ‘Size’ for objects.

For Example, a 510 GB disk showing used space of 2842 GB in the vSAN datastore.


Object UUID: bd8c9d5e-eac8-b4e5-4cec-xxxxxxxxxxxx:
Version: 10
Health: Healthy
Owner: ESX_01
Size: 510.00 GB
Used: 2842.00 GB

Storage policy change for these objects will report a huge resync data.

Environment

VMware vSAN 8.x ESA

Resolution

This issue will be addressed in a future release of vSAN ESA.
 
 

Work around

 
 

Option 1

A script attached with this article can be utilized to efficiently retrieve and display the actual usage of each object within the vSAN ESA cluster.

Syntax:
 
To query a specific object by its UUID:
python query_object_capacity_usage.py --uuid 55fe3b67-xxxx-xxx-xxxx-xxxxxxxxxxxx
 
By default, the script will display capacity usage for all objects:
python query_object_capacity_usage.py
 
Options:
  --uuid            Filter by object UUID.
  --rawSize         Display the raw capacity data (in bytes).
  --csv             Output data in CSV format (comma-separated).
 

Note

  • Use the --rawSize option to view capacity usage in bytes for detailed analysis.
  • Use the --csv option for exporting results in a format suitable for spreadsheet applications.

 

Option 2

Prerequisites:

1. PowerShell & VMware PowerCLI Module.
2. ESXi credentials.

Below are the brief steps:
1. Connect to vCenter Server:
    Connect-VIServer -Server <vCenter-IP-or-FQDN> -User [email protected] -Password <password>

2. Download the script from GitHub:
    https://github.com/lamw/vmware-scripts/blob/master/powershell/VSANVMDetailedUsage.ps1

3. Before running the script, customers need to set the host user name within the script:

$ESXiHostUsername = "root"
$ESXiHostPassword = "your_password"

These credentials are used to directly connect to each ESXi host in the vSAN cluster.

4. Run the Script:

. ./VSANVMDetailedUsage.ps1
Get-VSANVMDetailedUsage -Cluster "VsanClusterName"

Or pass a specific VM name

Get-VSANVMDetailedUsage -Cluster "VsanClusterName" -VM "MyVM"

Below is the output example:


Get-VSANVMDetailedUsage -Cluster "VsanClusterName"

VM                        File                                                                                         Type      physicalUsedB reservedCapacityB
--                        ----                                                                                         ----      ------------- -----------------
New Virtual Machine       [vsanDatastore] <Namespace UUID>/New Virtual Machine.vmx                                     namespace        262144                 0
New Virtual Machine       [vsanDatastore] <Namespace UUID>/New Virtual Machine-000001.vmdk                             vdisk            262144                 0
New Virtual Machine       [vsanDatastore] <Namespace UUID>/New Virtual Machine_1-000001.vmdk                           vdisk                 0      107374182400
New Virtual Machine       [vsanDatastore] <Namespace UUID>/New Virtual Machine-Snapshot5.vmem                          vmem         1050763264        8589934592
New Virtual Machine       [vsanDatastore] <Namespace UUID>/New Virtual Machine-19faff32.vswp                           vmswap           262144                 0
New Virtual Machine2      [vsanDatastore] <Namespace UUID>/New Virtual Machine2.vmx                                    namespace    1338677248                 0
New Virtual Machine2      [vsanDatastore] <Namespace UUID>/New Virtual Machine2.vmdk                                   vdisk        4561106944                 0
New Virtual Machine2      [vsanDatastore] <Namespace UUID>/New Virtual Machine2_1.vmdk                                 vdisk          30637056                 0
New Virtual Machine2      [vsanDatastore] <Namespace UUID>/New Virtual Machine2-91c6e4c2.vswp                          vmswap           262144                 0

 

Attachments

query_object_capacity_usage.py get_app