Hi all,
I need to enable hot add memory/cpu to reconfigure the VM when it is running.
I'm able to do it by changing the setting of the VM (Edit Setting ->Option->Advanced->Enable /Disable Memory/Cpu hot add).
But i want to enable the Memory/cpu hot add with the help of WorkFlow/Java Code.Any reference code will be helpfull.
Note: I'm using vSphere webservice SDK to develop my application.
Thanks All,
Sanket
Hi,
You can use "cpuHotAddEnabled" and "memoryHotAddEnabled" properties, set them in VirtualMachineConfigSpec and reconfigure the VM using ReconfigVM_Task method. Please note, these properties are available since 4.0 and the VM needs to be powered off while reconfiguring the VM.
VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
vmConfigSpec.setMemoryHotAddEnabled(true);
vmConfigSpec.setCpuHotAddEnabled(true);
ManagedObjectReference task = service.reconfigVMTask(vmMor, vmConfigSpec);
Hope this helps.
Neha
Hi Neha
Thanks for your reply, But no such methods_ "vmConfigSpec.setMemoryHotAddEnabled(true);"_ are available in the VirtualMachineConfigSpec class.
I'm using "vi-sdk-4.0.0-161137 " webservice SDK. So can you suggest me which version of SDK should i use so that my requirement will be fullfilled.
Thanks ,
Sanket.
Are you using Java or C#? If it's C#, it'll look like this:
VirtualMachineConfigSpec myConfig = new VirtualMachineConfigSpec();
myConfig.memoryHotAddEnabled = true;
myConfig.memoryHotAddEnabledSpecified = true;
The "Specified" property is important. It won't work without that.
Hi Neha,Daneil,
Thanks a lot for your replies.It helped me to resolve my issue.
Thanks ,
Sanket.
Hi,
can this be done using vcloud director API's ?
The reason i am asking is, in vchs(vcloud air) we will not have access to vcenter/vsphere but only to Vcloud director.
Thanks
Panikiran