mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added support for accepting extra config options in vm reconfiguration. (#3327)
This commit is contained in:
parent
afc8c42e57
commit
a2ff7fc7ea
1 changed files with 12 additions and 0 deletions
|
@ -839,6 +839,18 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
|
||||||
module, vm_disk, changes)
|
module, vm_disk, changes)
|
||||||
request = VI.ReconfigVM_TaskRequestMsg()
|
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
|
# Change Memory
|
||||||
if 'memory_mb' in vm_hardware:
|
if 'memory_mb' in vm_hardware:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue