diff --git a/doc/topics/cloud/vmware.rst b/doc/topics/cloud/vmware.rst index a6426354d4..fe19b327a8 100644 --- a/doc/topics/cloud/vmware.rst +++ b/doc/topics/cloud/vmware.rst @@ -95,6 +95,12 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or host: c4212n-002.domain.com template: False power_on: True + extra_config: + mem.hotadd: 'yes' + guestinfo.saltMaster: 10.20.30.140 + guestinfo.domain: foobar.com + contactGroup: 'Core Infrastructure' + randomKey: randomValue provider @@ -206,3 +212,9 @@ template power_on Specifies whether the new virtual machine should be powered on or not. If ``template: True`` is set, this field is ignored. Default is ``power_on: True``. + +extra_config + Specifies the additional configuration information for the virtual machine. This + describes a set of modifications to the additional options. If the key is already + present, it will be reset with the new value provided. Otherwise, a new option is + added. Keys with empty values will be removed. diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py index 0aab6090a3..12f77c8412 100644 --- a/salt/cloud/clouds/vmware.py +++ b/salt/cloud/clouds/vmware.py @@ -954,6 +954,9 @@ def create(vm_): devices = config.get_cloud_config_value( 'devices', vm_, __opts__, default=None ) + extra_config = config.get_cloud_config_value( + 'extra_config', vm_, __opts__, default=None + ) power = config.get_cloud_config_value( 'power_on', vm_, __opts__, default=False ) @@ -1018,6 +1021,11 @@ def create(vm_): device_specs = _manage_devices(devices, object_ref) config_spec.deviceChange = device_specs + if extra_config: + for key, value in extra_config.iteritems(): + option = vim.option.OptionValue(key=key, value=value) + config_spec.extraConfig.append(option) + # Create the clone specs clone_spec = vim.vm.CloneSpec( template=template,