Snapshot size is incorrect in PowerCLI output of Get-Snapshot cmd
search cancel

Snapshot size is incorrect in PowerCLI output of Get-Snapshot cmd

book

Article ID: 369926

calendar_today

Updated On:

Products

VMware vCenter Server 7.0

Issue/Introduction

1. Discrepancy in snapshot size shown on vCenter and actual size consumed.
2. PowerCLI Get-snapshot displays incorrect snapshot size. 

Environment

PowerCLI 10.1.1.8827524

vCenter Server 7.x 

Resolution

1.The Snapshot size displayed on vCenter is combination of all Base disk + existing Snapshot, this is expected though the space consumed by recent snapshot would be much less.

  • SSH to host where that VM is running.
  • cd to VM folder.
  • Run : du -sh *flat.vmdk

This will match with snapshot size shown on vCenter. 


2. As the PowerCLI commands only return the size of the snapshot at the time it was created, rather than the size of the snapshot disk after additional data has been added.


To work around this, you need to run $vm.ExtensionData.RefreshStorageInfo() to refresh snapshot size.

PS C:\Users\Administrator> $vm = get-vm TestVM
PS C:\Users\Administrator> $vm.ExtensionData.RefreshStorageInfo()
PS C:\Users\Administrator> Get-Snapshot -vm $vm | fl *

This should return the actual size consumed by Snapshot.