From a2ff7fc7eacf0c696df3d0f376a9054edebca9f3 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) --- lib/ansible/modules/cloud/vmware/vsphere_guest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/ansible/modules/cloud/vmware/vsphere_guest.py b/lib/ansible/modules/cloud/vmware/vsphere_guest.py index 9b4678a212..3471a16cb2 100644 --- a/lib/ansible/modules/cloud/vmware/vsphere_guest.py +++ b/lib/ansible/modules/cloud/vmware/vsphere_guest.py @@ -839,6 +839,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: