I am trying to find out whether there is a way to retrieve the disk sizes within a VM template and store it as a variable. I am designing a PowerCLI script that would benefit from taking this number into consideration.
It is an import-CSV script and currently the script is only able to weigh the total disk size in GB from the imported CSV file against the Datastore's hard disk size and I am running into problems maintaining a free-space buffer as a result.
Does this help?
If the template is spread over multiple datastores, you will have to make the sum (Measure-Object)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Does this help?
If the template is spread over multiple datastores, you will have to make the sum (Measure-Object)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That should do the trick - Thanks a lot for your help!
Is there a way to get the values from the extensiondata.storage.perdatastoreusage.committed to show up in GB format or will I have to manually calculate that? I tried just adding GB to the end and that yields no output
I'm afraid not.
The VirtualMachineUsageOnDatastore object properties express the values in bytes.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Okay, that's all good - I just put in a calculation and hopefully that will do the trick. Thanks for your help!