From d3097bf580e08db1f08ffb0b0adc7459201e5b2f Mon Sep 17 00:00:00 2001 From: Cheuk Lam Date: Thu, 19 May 2016 11:13:00 -0400 Subject: [PATCH] Added support for accepting extra config options in vm reconfiguration. (#3327) --- cloud/vmware/vsphere_guest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cloud/vmware/vsphere_guest.py b/cloud/vmware/vsphere_guest.py index 6658929d9f2..d6e5578588b 100644 --- a/cloud/vmware/vsphere_guest.py +++ b/cloud/vmware/vsphere_guest.py @@ -842,6 +842,18 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name module, vm_disk, changes) request = VI.ReconfigVM_TaskRequestMsg() + # Change extra config + if vm_extra_config: + spec = spec_singleton(spec, request, vm) + extra_config = [] + for k,v in vm_extra_config.iteritems(): + ec = spec.new_extraConfig() + ec.set_element_key(str(k)) + ec.set_element_value(str(v)) + extra_config.append(ec) + spec.set_element_extraConfig(extra_config) + changes["extra_config"] = vm_extra_config + # Change Memory if 'memory_mb' in vm_hardware: