I just ran into an interesting problem that I didn't even know was a thing, until just now.
I am trying to find a Postman query, or an SWQL query that I can modify into Postman, that will correctly report total disk size used for virtual machines that have existing checkpoints on Hyper-V hosts. I have to be able to do this via API because we pull this data into another program we run.
We have Hyper-V servers that have VMs that always have several checkpoints (Hyper-V version of snapshots). For business reasons, these VMs must always have multiple checkpoints that they can rollback to.
I was tasked to create a Postman query that would get all of the VMs total disk space actually used on disk. I put together a query, and at first it seemed like it worked, but then it started reporting the total disk size of these VMs as 0 GB. After quite a bit of searching, I found that the way Hyper-V does checkpoints is the attached disk is only the most recent delta file, so a VM with no checkpoints yet will show correct, but once they have checkpoints then SolarWinds reports this incorrectly.
Any query I've done seems to only pull the current delta checkpoint disk file. I started thinking maybe this is impossible for SolarWinds to track, but then I found the Chargeback reports, and the Disk Usage column in the Chargeback report shows the total disk size accurately. This confirms SolarWinds has the data and can do it, I just need to figure out how to get it via API.
I've attached a screenshot showing where SolarWinds reports Storage usage of this guest as 0 GB, even though it's actually a few hundred GB.
Here is the result of a PowerShell command I ran on a different VM showing how Hyper-V reports the current .avhdx delta disk differently than the total disk size.
PS C:\Users\admin\Desktop> .\replica_hdd_size.ps1
Path: C:\Mount\M60-DRaaS1-new\DemoTest\268e38cccb354c73b755f43ed5426ab9\Ide0-0\DRaaS-2022_A379CD60-7EC2-4DD5-8A2F-BC3D6745655B.avhdx
File exists.
Get-Item Length: 4194304 bytes (0 GB)
Get-VHD reports:
Path : C:\Mount\M60-DRaaS1-new\DemoTest\268e38cccb354c73b755f43ed5426ab9\Ide0-0\DRaaS-2022_A379CD60-7EC2-4DD5-8A2F-BC3D6745655B.avhdx
FileSize : 4194304
Size : 53687091200
VhdType : Differencing
ParentPath : C:\Mount\M60-DRaaS1-new\DemoTest\268e38cccb354c73b755f43ed5426ab9\Ide0-0\DRaaS-2022_E07A1296-096D-4AE7-8C64-201FE77D429C.avhdx
Logical FileSize: 0 GB
PS C:\Users\admin\Desktop>
So, again, I realize this is a Hyper-V thing and how it reports when SolarWinds queries it, but I know SolarWinds has the data because it reports it correctly in the Chargeback report. I just need to figure out how to get that Chargeback report data for "Disk Storage Usage (GB)" via an API call. So far I can only find this data in the Chargeback report itself. Even if I could somehow schedule or automate this report to run once a month and export into an Excel file on disk, I might could pull it from there, but it seems the Chargeback reports have to be run manually.