Brian_Markussen
Enthusiast
Enthusiast

vRA 7.3: How to reconfigure CPU/Core/Socket for VM Item?

HI,

By default vRA configures number of vCPU as number of sockets. In some cases I need 2 sockets and 4 cores = total of 8 vCPU's (Windows 7 limitation).

I use System.getModule("com.vmware.library.vcaccafe.request").requestResourceAction(operation,inputs) action with properties below to reconfigure VM.

//Create a properties object for the inputs
vmProperties = new Properties();

// Mandatory inputs:
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.Requestor" , "service@domain.local");
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.Storages" , "[]");
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.Networks" , "[]");
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.ExecutionSelector" , 1);
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.CpuCount" , newCpuCount.toString());
vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.PropertyBag" , '[{"PropertyName": "VirtualMachine.Core.Count","PropertyValue": "2"}');

vmProperties.put("provider-Cafe.Shim.VirtualMachine.Reconfigure.MemorySize" , newMemorySizeMb.toString());

Core.Count is ignored!

How do I solve this issue?

Findings:

If I use the “VirtualMachine.Core.Count” custom property on the VM in the blueprint and do a new deployment, the VM will have the number of cores per socket as configured. This works.

If I do a “Reconfigure task” on an VM Item in vRA and set custom property “VirtualMachine.Core.Count” it is ignored.

Use case:

                    Windows 7 only supports 2 sockets.

                    Windows server 2008 Enterprise supports only 8 sockets.

/Brian

6 Replies
daphnissov
Immortal
Immortal

When you do a reconfigure, is VirtualMachine.Core.Count already set prior to the reconfigure, or are you trying to add that property during the reconfigure? If it's the former, it may be a bug with the reconfigure action not parsing that custom property because, as you've discovered, it is accepted during machineProvisioned.

0 Kudos
Brian_Markussen
Enthusiast
Enthusiast

     When you do a reconfigure, is VirtualMachine.Core.Count already set prior to the reconfigure, or are you trying to add that property during the reconfigure? If it's the former, it may be a bug with      the reconfigure action not parsing that custom property because, as you've discovered, it is accepted during machineProvisioned.

If the VirtualMachine.Core.Count is set in the Blueprint during provisioning the number of cores per socket is set accordingly.

I can't change the number of cores per sockets by a reconfigure task. This is true both if the VirtualMachine.Core.Count was set during provisioning or if it was ommited.

If I set the VirtualMachine.Core.Count costum property during reconfigure task it is ignored.

Is this by design or a bug?

Is there a work around?

/Brian

0 Kudos
daphnissov
Immortal
Immortal

It may be a bug. I'd recommend opening a SR with VMware and get confirmation, however.

0 Kudos
hawks76
Enthusiast
Enthusiast

We have a custom action that looks like this:

var totalNumberofCpus = vcpu * vcores
var spec = new VcVirtualMachineConfigSpec();
spec.numCPUs = totalNumberofCpus;
spec.numCoresPerSocket = vcores;

var task = vm.reconfigVM_Task(spec);  // VirtualMachine
return task;

vm is a vc:virtualmachine object

Works like a champ in our enviroment (7.3).

0 Kudos
Brian_Markussen
Enthusiast
Enthusiast

Hi Hawks76,

I ended up implementing it as you describe.

The problem is that this is done on the vc:virtualmachine and not the vcac:virtualmachine.

  1. In our case this is not optimal, as we have several vRO's in a master/worker setup.
  2. vRA inventory is not updated until the next inventory collection. This is not reliable in a larger environment and in our case it is normal to take about an hour.
  3. The costum property "VirtualMachine.Core.Count" of the Blueprint Virtual machine should configure the cores per cpu. This works for new deploymets, but not for reconfigure tasks.

/Brian

0 Kudos
Brian_Markussen
Enthusiast
Enthusiast

Opened a Service Request at VMware.

I got the answer that  VirtualMachine.Core.Count is not surposed to work in a reconfigure task. This is by design.

/Brian