I wrote a script with Powercli to get the sum of all VMDK files per Datastore.
Tested it on my workstation (XP) with version 4.0.1.2164 of PowerCLI and it reported the real disk sizes (a disk of 40GB was reported as 40GB and not how much data really was allocated). Then I installed Powercli version 4.1.1.2816 on a Windows 2003 server to automate the script with a scheduled task, but then the script reported the disk sizes with how much they really used on the datastore. So my 40GB virtual disk now showed as 8,5GB instead of the full size.
I got the virtual disk sizes in a loop with get-harddisk -datastore <datastorename> | select capacityKB
I've also tried (get-vm $vm.name).harddisks, but that gave the same output.
Searched all places, but I can't get it to work anymore on the new PowerCLI versions.
Does anyone know how to get the full size of VMDK disks per Datastore ?