Aramaki
Contributor
Contributor

How to verify if a VM has hotplug enabled?

Jump to solution

Hello,

i am trying to create a workflow which is supposed to change the amount of vCPUs and/or Memory on a VM.

(for those who get suspicious: I am continuing/editing the work of Munel, another user in here)

Since we have different kinds of VMs, i need to verify if a VM is capable of hotplugging the CPUs and memory.

Right now the workflow is designed in a way, that it first tries to change the values and if this runs into an error, it verifies if the errorcode is telling that the vhardware is not hotplug enabled and then shuts the vm down or throws an exception.

This is not a very nice solution and needs to be changed.

Is there a way to verify the hotplug capability before actually trying to change the vhardware?

Thanks in advance

Andreas

0 Kudos
1 Solution

Accepted Solutions
mmarinov
VMware Employee
VMware Employee

Hi Andreas,

In order to verify if a VM has a hot pluggability enabled you have the following options:

Check if the memory hot adding is enabled:

virtual_machine_instance.config.memoryHotAddEnabled

Check if the CPU hot adding is enabled

virtual_machine_instance.config.cpuHotAddEnabled

Check if the CPU hot removing is enabled

virtual_machine_instance.config.cpuHotRemoveEnabled

If you have vSphere client, the above tree options are located within the VM's settings dialog under Options tab -> Memory/CPU hotplug.

Hope this helps,

Martin

Martin Marinov VMware Software Engineer If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

View solution in original post

0 Kudos
3 Replies
mmarinov
VMware Employee
VMware Employee

Hi Andreas,

In order to verify if a VM has a hot pluggability enabled you have the following options:

Check if the memory hot adding is enabled:

virtual_machine_instance.config.memoryHotAddEnabled

Check if the CPU hot adding is enabled

virtual_machine_instance.config.cpuHotAddEnabled

Check if the CPU hot removing is enabled

virtual_machine_instance.config.cpuHotRemoveEnabled

If you have vSphere client, the above tree options are located within the VM's settings dialog under Options tab -> Memory/CPU hotplug.

Hope this helps,

Martin

Martin Marinov VMware Software Engineer If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

View solution in original post

0 Kudos
Aramaki
Contributor
Contributor

Hi Martin,

Thank you for this. Going to try it out today.

One little question:

Is there also a memoryHotRemoveEnabled option?

Or doesn't this need to be verified when removing memory (i hardly doubt that)

Thanks

Andreas

0 Kudos
mmarinov
VMware Employee
VMware Employee

Hi Andreas,

To be honest, I'm not aware of such memory hot remove flag. From what I can see from the VC's public API there is not such functionality exposed. Furthermore the vSphere client also doesn't enable such option.

One note out of the topic. There are, however, two other properties that you should be aware of (in case you are not):


virtual_machine_instance.config.hotPlugMemoryIncrementSize

Memory, in MB that can be added to a running virtual machine must be in increments of this value and needs be a multiple of this value. This value is determined by the virtual machine and is specified only if VcVirtualMachineConfigSpec has been set to true.

virtual_machine_instance.config.hotPlugMemoryLimit

The maximum amount of memory, in MB, than can be added to a running virtual machine. This value is determined by the virtual machine and is specified only if VcVirtualMachineConfigInfo is set to true.

Regards,

--Martin

Martin Marinov VMware Software Engineer If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points