Hi,
I am looking around a bit and I know that for the physical esx hosts you can get information about the cpu and cores.
When I check the same for vmware guests I get only the cpu info. For licensinng auditing needs and so on it would be useful if this info could be split out like the following:
Get-VM | Select Name, NumvCPUs
Does anybody have a suggestion?
//Pegasjus
Try this
Get-VM | Select Name,
@{N="CPU Sockets";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@{N="Cores per Socket";E={$_.ExtensionData.Config.Hardware.NumCoresPerSocket}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try this
Get-VM | Select Name,
@{N="CPU Sockets";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@{N="Cores per Socket";E={$_.ExtensionData.Config.Hardware.NumCoresPerSocket}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
grrr...
Luc you beat me to it
Hey Luc,
thanks a lot, fast as always!
//Pegasjus
P.S. Cool deep dive presentation in Barcelona (even if I missed some parts)
Hi,
What types of codes are they?
.ExtensionData.Config.Hardware.NumCoresPerSocket
I can't seem to find it when I do get-member?
How can I learn more about these codes?
are they .net framework codes?
Also just to let every one know, it doesn't give you the virtual sockets, instead it gives you the total Cpu sockets, however cores per socket (s) * virtual sockets (v) = total chores per socket (t), therefore t/s=v. you can do this on excel and drag it down and it will give you the virtual sockets.
The ExtensionData property gives you access to the vSphere object itself, not the read-only .Net object.
In this case the ExtensionData property maps to the VirtualMachine object.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Just to add to it, I tried to get the information about which cluster the guests are in but adding @{N="Cluster";E={$Cluster.Name}}, does not help, any ideas?
Try like this
Get-VM | Select Name,
@{N="Cluster";E={Get-Cluster -VM $_ | Select -ExpandProperty Name}},
@{N="CPU Sockets";E={$_.ExtensionData.Config.Hardware.NumCPU}},
@{N="Cores per Socket";E={$_.ExtensionData.Config.Hardware.NumCoresPerSocket}}
It's not the fastest method, but it should work.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hey Luc,
works a charm, as for pace beats manual entry
Thanks.
//Martin