VMware Cloud Community
shokk2
Contributor
Contributor
Jump to solution

CPU and Memory info for Templates?

There doesn't seem to be a NumCpu or MemoryMB property for templates.
How does one get this info?
I've looked at $Template.ExtensionData.ResourceConfig.MemoryAllocation
and $Template.ExtensionData.ResourceConfig.CpuAllocation yet I get nothing back for those parameters.
How would I go about getting that info?
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

It's hidden under Hardware

Get-Template | Select Name,
@{N="CPU";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@{N="Memory";E={$_.ExtensionData.Config.Hardware.MemoryMB}}


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

It's hidden under Hardware

Get-Template | Select Name,
@{N="CPU";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@{N="Memory";E={$_.ExtensionData.Config.Hardware.MemoryMB}}


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

0 Kudos
AviShimon
Contributor
Contributor
Jump to solution

Hi There,

I am trying to get the Templates actual used space as appears in VC console.

I can only get the provisioned, but that's not good enough for my purpose.

can anyone assist ?

Thanks, Avi

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try this

Get-Template | Select Name, 
@
{N="CPU";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@
{N="Memory";E={$_.ExtensionData.Config.Hardware.MemoryMB}},
@
{N="Used Storage (GB)";E={[Math]::Round(($_.ExtensionData.Summary.Storage.Committed/1GB),1)}}


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

AviShimon
Contributor
Contributor
Jump to solution

LucD,

Thanks a Lot

This is exactly what I needed.

Avi.

0 Kudos