Hello,
I have a VM with 1 socket and 1 core.
However PowerCli reports 1 NumCpu and 2 Cores per socket.
PS> Get-VM -Name MyComputer | Select-Object -Property NumCpu,CoresPerSocket
NumCpu CoresPerSocket
------ --------------
1 2
Any idea about the origin of the wrong PowerShell output ?
PowerCli version is: 13.0.0
UPDATE:
There are in fact more VMs with inconsistent CPU information.
In the output below, the third column is supposed to be an integer.
But sometimes the number of Socket Per Cpu exceeds the total number of Cores (NumCpu).
However, when I look at the console, numbers are different.
For example the VM with a NumCpu of 2 and 4 CoresPerSocket displays 1 CorePerSoket and 2 sockets in the console.
PS> Get-VM |Select-Object -Property NumCpu,CoresPerSocket,@{Label = 'Socket'; Expression = {$_.NumCpu/$_.CoresPerSocket}}
NumCpu CoresPerSocket Socket
------ -------------- ------
12 12 1
...
1 1 1
8 2 4
1 2 0,50
4 2 2
16 2 8
...
2 2 1
2 2 1
1 2 0,50
1 1 1
1 1 1
...
4 4 1
2 2 1
2 4 0,50
16 2 8
...
2 2 1
2 1 2
1 2 0,50
1 1 1
4 4 1
...
In fact when you are having 1 vCPU and there are 2 cores per socket, then you are using half a socket.
Also, the vCPU and the cores/socket you define on a VM are virtual.
The number of cores per pCPU on an ESXi node has nothing to do with that virtual definition on the VM, besides the limit on the number of vCPU and virtual cores/socket you can define.
Not sure what the issue is.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What is the powerstate of the VMS? And if you are on vSPhere 8.*, what is autoCoresPerSocket set to?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
All those VMs are Powered On.
Unfortunately, hosts are still in v6.7.
In fact when you are having 1 vCPU and there are 2 cores per socket, then you are using half a socket.
Also, the vCPU and the cores/socket you define on a VM are virtual.
The number of cores per pCPU on an ESXi node has nothing to do with that virtual definition on the VM, besides the limit on the number of vCPU and virtual cores/socket you can define.
Not sure what the issue is.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Okay! In fact I viewed the CoresPerSocket value as a max value (max number of cores per socket).
That's why I expected the Socket value to be an integer, whether the socket is full or not.
Because in the real world you are not obliged to fill all your sockets on a motherboard...
But your answer make sense and explains the current result.
Thanks for your help Luc 🙂
PS: I also just realized that the Socket value was completely built by myself in the command line... 🙈