VMware Cloud Community
NeedToKnowBasis
Enthusiast
Enthusiast
Jump to solution

Retrieving Template Size (Get-Template cmdlet?)

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Does this help?

1.  Re: PowerCLI Template Used Disks Size


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

View solution in original post

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Does this help?

1.  Re: PowerCLI Template Used Disks Size


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

Reply
0 Kudos
NeedToKnowBasis
Enthusiast
Enthusiast
Jump to solution

That should do the trick - Thanks a lot for your help!

Reply
0 Kudos
NeedToKnowBasis
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid not.

The VirtualMachineUsageOnDatastore object properties express the values in bytes.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
NeedToKnowBasis
Enthusiast
Enthusiast
Jump to solution

Okay, that's all good - I just put in a calculation and hopefully that will do the trick. Thanks for your help!

Reply
0 Kudos