Merge pull request #28789 from nmadhok/2015.8-customization-fix

Provide ability to enable/disable customization for newly create VMs using VMware salt-cloud driver
This commit is contained in:
Nicole Thomas 2015-11-11 15:48:57 -07:00
commit 098d48ad26
2 changed files with 9 additions and 1 deletions

View file

@ -393,3 +393,8 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or
``hardware_version``
Specify the virtual hardware version for the vm/template that is supported by the
host.
``customization``
Specify whether the new virtual machine should be customized or not. If
``customization: False`` is set, the new virtual machine will not be customized.
Default is ``customization: True``.

View file

@ -2059,6 +2059,9 @@ def create(vm_):
hardware_version = config.get_cloud_config_value(
'hardware_version', vm_, __opts__, search_global=False, default=None
)
customization = config.get_cloud_config_value(
'customization', vm_, __opts__, search_global=False, default=True
)
if 'clonefrom' in vm_:
# Clone VM/template from specified VM/template
@ -2193,7 +2196,7 @@ def create(vm_):
config=config_spec
)
if devices and 'network' in list(devices.keys()) and 'Windows' not in object_ref.config.guestFullName:
if customization and (devices and 'network' in list(devices.keys())) and 'Windows' not in object_ref.config.guestFullName:
global_ip = vim.vm.customization.GlobalIPSettings()
if 'dns_servers' in list(vm_.keys()):