Dominic Cleal wrote:
It should work if instead, your image uses DHCP to set its hostname, or you update it using the finish script.
Actually it would be better to modify https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/vmware.rb#L354-L366 to pass customization_spec
Something like this
opts = {
"datacenter" => datacenter,
"template_path" => args[:image_id],
"dest_folder" => args[:path].gsub(path_replace, ''),
"power_on" => false,
"start" => args[:start],
"name" => args[:name],
"numCPUs" => args[:cpus],
"memoryMB" => args[:memory_mb],
"datastore" => args[:volumes].first[:datastore],
"network_label" => args[:interfaces].first[:network],
"network_adapter_device_key" => network_adapter_device_key,
'customization_spec' => {
'domain' => args[:domain],
'ipsettings' => {
'ip' => args[:ip],
'gateway' => args[:gateway],
'subnetMask' => args[subnet],
},
},
}
This code with static data works fine. I think it can be creatad like a checkbox "Apply customization specifications"