vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.19k stars 766 forks source link

Unable to remove an advanced setting for a VM #1040

Closed madhanse closed 12 months ago

madhanse commented 12 months ago

Describe the bug

I tried to use ReconfigVM_Task() function to update vm.config.extraConfig by creating a list excluding this setting. No change in the advanced settings in the vSphere Client.

Reproduction steps

  1. Create a list excluding the setting to remove
  2. Create a vim.vm.ConfigSpec object and add the updated list
  3. Call the ReconfigureVM_Task() to execute the task ...

Expected behavior

Setting removed for the VM

Additional context

No response

prziborowski commented 12 months ago

In order to remove a setting, you provide the setting you wish to remove with a blank value. It is mentioned at https://developer.vmware.com/apis/358/vsphere/doc/vim.vm.ConfigSpec.html#extraConfig

Keys with empty values will be removed.
madhanse commented 12 months ago

Got it thanks.