What exact VM and datastore metrics did you compare? Did you use VM used space or VM provisioned space? The provisioned VM space value will be doubled for a VM snapshot, and thin disks will always be counted with their maximum provisioned size and not what they actually use up on the datastore.
Also note that RDM disks may count towards used/provisioned VM space, but as they are not datastores, they won't add to the total datastore space.
You can run the following PowerCLI snippet to get a report on all datastores with their capacity, space used and the sum of all VM+Template used and provisioned space. You may want to filter local datastores or on specific clusters depending on your needs:
Get-Datastore | Sort |
Select Name, CapacityGB,
@{N='Datastore Used Space GB'; E={[math]::Round($_.CapacityGB - $_.FreeSpaceGB)}},
@{N='VM Space Used GB'; E={ [math]::Round((($_ | Get-VM | Select -Expand UsedSpaceGB | measure -Sum).Sum) +
((($_ | Get-Template).ExtensionData.Summary.Storage.Committed | measure -Sum).Sum) / 1GB) } },
@{N='VM Space Provisioned GB'; E={ [math]::Round((($_ | Get-VM | Select -Expand ProvisionedSpaceGB | measure -Sum).Sum) +
((($_ | Get-Template).ExtensionData.Summary.Storage.Uncommitted | measure -Sum).Sum) / 1GB) } } |
FT -autosize
This will result in a list like this (Note: I use a lot of thin provisioned disks, so our VM provisioned space shows significantly higher than actually used space):
Name CapacityGB Datastore Used Space GB VM Space Used GB VM Space Provisioned GB
---- ---------- ----------------------- ---------------- -----------------------
LUN_1 499,75 385 383 824
LUN_2 499,75 263 262 539
LUN_3 499,75 286 284 681
Check the datastores that have a large discrepancy between the Datastore Used Space GB and VM Space Used GB metrics.