VMware Cloud Community
NoTr3x
Contributor
Contributor

Editing a VM while it is online

Hi,

i want to edit my VM while it is running.

So I want to change the RAM Size of my virtual Machine. My first taught was to it with a ConfigSpec, but I got an expection, that it is not possible in this state.

It will generate my next try, but how can i manipulate the config over the API? Like vm.summary.config.memorySizeMB = 2048 ?

vRA and PowerCLI do not make any other way, they editing the vmx file over the API. How could the way be for the orchestrator.

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi,

Something like the following should work (the sample sets the RAM size to 4 GB, input parameter is vm of type VC:VirtualMachine)

var spec = new VcVirtualMachineConfigSpec();

spec.memoryMB = 4096; // 4096 MB == 4 GB

vm.reconfigVM_Task(spec);

0 Kudos