VMware Cloud Community
keeleral
Enthusiast
Enthusiast

CPU reconfigure workflow to modify "core" not "socket"

When i run a reconfigure on a vm to add or remove CPU i noticed that it always modifies the virtual sockets number in the settings of the vm.  Is there a way to change that so it modifies the cores per socket number instead?

Thanks

Tags (1)
0 Kudos
2 Replies
admin
Immortal
Immortal

I'm not sure you can do this out out of the box, however you could write a resource action that calls a vRO workflow that changes the sockets. You can use resource mappings in 6.2 to map this resource action to virtual machines. The workflow needs a few inputs, 2 for cpuQty and socketQty to use and 1 should be of type VC:VirtualMachine named vcVm. The javascript code looks pretty simple, initially.

var spec = new VcVirtualMachineConfigSpec();

spec.numCPUs = cpuQty;

spec.numCoresPerSocket = socketQty;

vcVm.reconfigVM_Task(spec);

The cpuQty and socketQty are just string inputs. Have a look at this as it will point you in the right direction vRealize Automation 6.2 Documentation Center

However, there seems to be a little more logic needed than just this bit of code as you cannot have more cores per sockets than virtual sockets. So you need to control the input values. This is all possible in vRO but you need to get the spec of the virtual machine first and use actions to populate the input parameters to allow the user to select a valid cpu quantity, based on the vcVm config.

Hope that makes sense

Oli

0 Kudos
keeleral
Enthusiast
Enthusiast

Thanks for your response, i ended up opening a ticket up with support and they said right now other than creating a script to do it after the fact there isn't a way to do it through vRA.  They did say it was already opened as a feature request so i added one as well.

0 Kudos