Jul 24, 2019

It appears that the default when creating a new VM using vCenter that is to configure a vSocket for each vCPU requested.

Disappointing... I expected that the default should use the 'optimized" topology, and configure the VMs with multiple cores.

Jul 24, 2019

hi, very cool script. one thing I noticed is the power policy is not 100% correct. about 50% of the time it said the the power settings are balanced, but they are are set for high performance. more often then not this was on an HP Blade server.

Jul 25, 2019

Hi Glenn. Thanks for the feedback! Can you do me a favor to test? Run this code snippet and let me know what the results are. Just put in the name of the vCenter you want to connect to and one of the hosts in question.

#start code
$vCenter = "<your_vcenter_name>"
$hostName = "<HP_Blade_Server_Name>"
connect-viserver $vCenter
$hostFilter = @{"Name" = $hostName}
get-view -ViewType HostSystem -Filter $hostFilter | select Name, @{n='HostPowerPolicy';e={$_.Config.PowerSystemInfo.CurrentPolicy.Key}}
#end code

The number that is returned for "HostPowerPolicy" will translate as below. I'd be curious to see if the HP Blades are not reporting it correctly, and defaulting to the power policy of the previous host. Easy fix if that is the case.
"1" {"HighPerformance"}
"2" {"Balanced"}
"3" {"LowPower"}
"4" {"Custom"}

Thanks for your help!

Jul 25, 2019

Hi Mark. I think what is happening is the vcenter gui is not refreshing properly. Running your script I received a balanced notification, I went to vcenter and it is showing balanced. I changed it to high performance and the GUI updates. I then go to the next one your script shows as balanced and it still shows as high performance. I then go directly to the host gui and it shows balanced matching your script. vSphere Client version 6.5.0.23000.
Sorry for the confusion.

Jul 25, 2019

No problem at all! That's good to know in case we see it happen again.

Jul 23, 2019

In testing this in my lab and reading the vCPU rightsizing blog in your document, I don't understand how to set what you output shows for many VMs.
In vCenter Web Client we can adjust CPU & Cores per Socket. Most best practice docs have said keep Cores per socket to 1 except when exceeding NUMa or for workloads like SQL. In my example VM I had 4 CPU (top line) and 1 Cores per socket defined for Server 2019 VM. The script said to change this to 1 CPU (top line) and 4 cores per socket (optimal sockets=1, optimal cores=4). You cannot adjust bottom cores per socket past 1 unless CPU (top line is greater than 1 CPU. Am I missing something here?

Jul 23, 2019

Within the VM config (Edit the VM), you set a total number of CPUs to be assigned to that VM and then set "Cores per Socket" - the Sockets is calculated for you and displayed in the UI right next to the Cores per Socket drop down.

So yes, you need to set the VM to have 4 CPUs with the first dropdown, then set the Cores per Socket drop down to 4 and you will see 'Sockets' next to that drop down change to 1. That's the optimal config: 1 vSocket x 4 Cores per Socket.

For a full history on Cores per Socket see: https://blogs.vmware.com/performance/2017/03/virtual-machine-vcpu-and-vnuma-rightsizing-rules-of-thumb.html

Jul 23, 2019

Wow, Thanks for the tool and articles. This is a lot different from the best practice we have used for so long as Mark mentioned in his blog.

Jul 24, 2019

Jay, I did a bug fix and uploaded a new version (1.0.3), so make sure to use that going forward!