‘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: 10Health: HealthyOwner: ESX_01Size: 510.00 GBUsed: 2842.00 GB
Storage policy change for these objects will report a huge resync data.
VMware vSAN 8.x ESA
python query_object_capacity_usage.py --uuid 55fe3b67-xxxx-xxx-xxxx-xxxxxxxxxxxxpython query_object_capacity_usage.py --uuid Filter by object UUID. --rawSize Display the raw capacity data (in bytes). --csv Output data in CSV format (comma-separated).rawSize option to view capacity usage in bytes for detailed analysis.csv option for exporting results in a format suitable for spreadsheet applications.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.ps1Get-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 0New Virtual Machine [vsanDatastore] <Namespace UUID>/New Virtual Machine-000001.vmdk vdisk 262144 0New Virtual Machine [vsanDatastore] <Namespace UUID>/New Virtual Machine_1-000001.vmdk vdisk 0 107374182400New Virtual Machine [vsanDatastore] <Namespace UUID>/New Virtual Machine-Snapshot5.vmem vmem 1050763264 8589934592New Virtual Machine [vsanDatastore] <Namespace UUID>/New Virtual Machine-19faff32.vswp vmswap 262144 0New Virtual Machine2 [vsanDatastore] <Namespace UUID>/New Virtual Machine2.vmx namespace 1338677248 0.vmdk vdisk 4561106944 0New Virtual Machine2 [vsanDatastore] <Namespace UUID>/New Virtual Machine2_1.vmdk vdisk 30637056 0New Virtual Machine2 [vsanDatastore] <Namespace UUID>/New Virtual Machine2-91c6e4c2.vswp vmswap 262144 0New Virtual Machine2 [vsanDatastore] <Namespace UUID>/New Virtual Machine2