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
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.
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
It may be a bug. I'd recommend opening a SR with VMware and get confirmation, however.
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).
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.
/Brian
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