VMware Cloud Community
Dlouw
Enthusiast
Enthusiast
Jump to solution

Vcpu per Guest

Hi,

I am looking for a script to run that will give me the total Vcpu's used by all guests accross my cluster.

Any ideas?

Thanks

Deon

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

It looks as if you forgot the verticar bar (pipeline symbol) at the end of the first line.

Get-Cluster production |


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Try something like this

Get-Cluster | 
Select Name,
@{N="Total vCPU";E={Get-VM -Location $_ | Measure-Object -Property NumCpu -Sum | Select -ExpandProperty Sum}}


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

0 Kudos
Dlouw
Enthusiast
Enthusiast
Jump to solution

Hi,

I tried; (But not getting the Vcpu's total for all guests, what am I doing wrong?)

Connect-VIServer Test

Get-Cluster production

Select Name,

@{N="Total vCPU";E={Get-VM -Location $_ | Measure-Object -Property NumCpu -Sum | Select -ExpandProperty Sum}}

I get:

HATotalSlots :

HAUsedSlots :

HAAvailableSlots :

HASlotCpuMHz :

HASlotMemoryMb :

HASlotMemoryGB :

HASlotNumVCpus :

ParentId : Folder-group-h4

ParentFolder : host

HAEnabled : True

HAAdmissionControlEnabled : True

HAFailoverLevel : 0

HARestartPriority : Medium

HAIsolationResponse : DoNothing

VMSwapfilePolicy : WithVM

DrsEnabled : True

DrsMode : FullyAutomated

DrsAutomationLevel : FullyAutomated

Name : Production

CustomFields : {}

ExtensionData : VMware.Vim.ClusterComputeResource

Id : ClusterComputeResource-domain-c7

Uid : /VIServer=xxxxx\xxxxx@xxxxx:443/Cluster=ClusterCompu

teResource-domain-c7/

0 Kudos
LucD
Leadership
Leadership
Jump to solution

It looks as if you forgot the verticar bar (pipeline symbol) at the end of the first line.

Get-Cluster production |


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

0 Kudos
Dlouw
Enthusiast
Enthusiast
Jump to solution

You the man!! thanks

0 Kudos