VMware Cloud Community
r_babanin
Contributor
Contributor
Jump to solution

vSphere 5. vCPU Sockets and Cores per CPU bug (PowerCLI)

Hello!

I've a test lab on vSphere 5 (with all of the recent updates installed) and I'm trying to make VMs using PowerCLI (v5.0.1). The VM is powered OFF.

1. I've created VM using this string:

New-VM –Name Test_VM –ResourcePool Resources –Datastore LUN1 –DiskMB 512 –MemoryMB 512 –NumCpu 4 –Floppy –CD –NetworkName VL348 –Confirm:$false

When creating the VM using latest PowerCLI there is no way to set number of CPU sockets or cores. The only way to create the VM with more than one core or CPU is to use the -NumCpu parameter (total number of cores!).

2. The I've logged in to vSphere Client and checked the CPU configuration of the recently created VM. And the Client shows me an error:

01.jpg

02.jpg

03.jpg

The parameter cpuid.corespersocket does not exist.

In the .vmx file of the VM there is no such parameter.

Only numvcpus = "4" exists in the .vmx file.

Moreover it's not possible to change the sockets and cores parameters using Client. The same error as on the first screen appears.

2. Well. Next I've tried to execute this:

$spec=New-Object –Type VMware.Vim.VirtualMAchineConfigSpec –Property @{“NumCoresPerSocket” = 2}

(Get-VM –Name Test_VM).ExtensionData.ReconfigVM_Task($spec)

And checked the configruration:

04.jpg

05.jpg

This commands added the same parameter to the .vmx file.

numvcpus = "4"

cpuid.coresPerSocket = "2"

3. Then I've tried to make changes to my VM (I want to make 4 single-core CPU back) and executed this:

$spec=New-Object –Type VMware.Vim.VirtualMAchineConfigSpec –Property @{“NumCoresPerSocket” = 1}

(Get-VM –Name Test_VM).ExtensionData.ReconfigVM_Task($spec)

And now I have the same error as on the first screen.

In the .vmx file:

numvcpus = "4"

cpuid.coresPerSocket = "1"

4. Then I've tried to use Set-VM command to change NumCpu to 4... Nothing changed. String cpuid.coresPerSocket = "1" still present in the file.

5. Then I've tried to make my VM with 1 Quad-Core CPU. Success!!!

6. Then I've tried to change settings to 2x2Core and back to 1 Quad-Core. Success!

7. Then - back to 4 Single-Core. FAIL!

What did I do wrong?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Which OS did you define for that VM ?

Not all OS support 4 or more vCPU. That first error in the vSphere Client seems to point in that direction.


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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Which OS did you define for that VM ?

Not all OS support 4 or more vCPU. That first error in the vSphere Client seems to point in that direction.


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

0 Kudos
Lessi001
Enthusiast
Enthusiast
Jump to solution

Hi,

what type of license are you using for your ESX Host? Maybe there is a limitation out of this corner - when I look at the first screenshot.

Regards

Andi

There are 10 types of people in this world. Those who understand binary, and those who do not.
0 Kudos
r_babanin
Contributor
Contributor
Jump to solution

Yes. I've found this error.

If you use PowerCLI to manage VMs there is no matter what GuestId selected when you create or alter the VM config. Also default GuestId is Windows XP 32-bit.

GuestId is suitable only for vSphere Client, but you still able to start such "incorrect" VM created with PowerCLI using both the PowerCLI and vSphere Client.

0 Kudos