Actions
Bug #10212
closedForeman allows multiple nics to have the same fqdn during provisioning
Description
When I create a new host on vSphere 5.1.x with:
eth0: static, primary, name = servername
eth1: dhcp, managed, provision, name = servername
Foreman builds the new host just fine:
Started POST "/hosts" for 7.252.136.32 at 2015-04-20 13:12:12 -0700
2015-04-20 13:12:12 [I] Processing by HostsController#create as */*
2015-04-20 13:12:12 [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"jIQECaYV7hZclakSTE7zrSN/TgmGeHFQxMN1TBpZO9M=", "host"=>{"name"=>"servername", "location_id"=>"1", "hostgroup_id"=>"6",
"compute_resource_id"=>"2", "compute_profile_id"=>"4", "environment_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"t",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "compute_attributes"=>{"cpus"=>"8", "corespersocket"=>"8", "memory_mb"=>"8192", "cluster"=>"Non-Prod/RP-DEV-AG-C01",
"path"=>"/Datacenters/RP-ApolloGlobal-POD/vm/Discovered virtual machine", "guest_id"=>"rhel6_64Guest", "hardware_version"=>"Default", "start"=>"1", "volumes_attributes"=>{"new_volumes"=>
{"_delete"=>"", "datastore"=>"Migration_Lun", "name"=>"Hard disk", "size_gb"=>"10", "thin"=>"true", "eager_zero"=>"false"}, "0"=>{"_delete"=>"", "datastore"=>"rp_dev_ag_c01_asm_c0:t0:l086",
"name"=>"Hard disk", "size_gb"=>"14", "thin"=>"true", "eager_zero"=>"false"}, "1"=>{"_delete"=>"", "datastore"=>"rp_dev_ag_c01_asm_c0:t0:l086", "name"=>"u01", "size_gb"=>"16", "thin"=>"true",
"eager_zero"=>"false"}}, "image_id"=>""}, "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"eth0", "name"=>"servername", "domain_id"=>"1",
"subnet_id"=>"1", "ip"=>"7.252.84.184", "managed"=>"0", "primary"=>"1", "provision"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"141"}},
"1"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"eth1", "name"=>"servername", "domain_id"=>"1", "subnet_id"=>"2", "ip"=>"7.252.188.58", "managed"=>"1", "primary"=>"0",
"provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"193"}}, "new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"",
"identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"admin", "compute_attributes"=>
{"type"=>"VirtualE1000", "network"=>"101"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"1", "provision_method"=>"build", "build"=>"1", "medium_id"=>"7", "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]",
"host_parameters_attributes"=>{"0"=>{"name"=>"auth_type", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}, "1"=>{"name"=>"vmware_tools_version",
"value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}}, "is_owned_by"=>"1-Users", "enabled"=>"1", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image",
"provider"=>"Vmware"}
2015-04-20 13:12:13 [I] Adding Compute instance for servername.domain.com
2015-04-20 13:12:13 [I] Successfully decrypted field for Foreman::Model::Vmware POD_Dev
2015-04-20 13:12:13 [I] Successfully decrypted field for Foreman::Model::Vmware POD_Dev
2015-04-20 13:12:14 [I]
However, after the host is built, if I try to edit anything on the host, I get this error:
Started GET "/hosts/servername.domain.com/edit" for 7.252.136.32 at 2015-04-20 13:39:36 -0700 2015-04-20 13:39:36 [I] Processing by HostsController#edit as HTML 2015-04-20 13:39:36 [I] Parameters: {"id"=>"servername.domain.com"} 2015-04-20 13:39:36 [I] Rendered hosts/_progress.html.erb (0.1ms) 2015-04-20 13:39:36 [I] Import facts for 'servername.domain.com' completed. Added: 149, Updated: 0, Deleted 0 facts 2015-04-20 13:39:36 [I] Rendered config_groups/_config_group.html.erb (43.3ms) 2015-04-20 13:39:36 [W] Saving eth0 NIC for host servername.domain.com failed, skipping because: 2015-04-20 13:39:36 [W] Name has already been taken 2015-04-20 13:39:36 [W] No PXELinux templates were found for this host, make sure you define at least one in your RedHat 6.6 settings 2015-04-20 13:39:36 [W] Saving eth1 NIC for host servername.domain.com failed, skipping because: 2015-04-20 13:39:36 [W] IP address can't be blank 2015-04-20 13:39:36 [W] Name has already been taken 2015-04-20 13:39:36 [W] No PXELinux templates were found for this host, make sure you define at least one in your RedHat 6.6 settings 2015-04-20 13:39:36 [I] Completed 422 Unprocessable Entity in 687ms (Views: 0.4ms | ActiveRecord: 241.6ms) 2015-04-20 13:39:36 [I] Rendered config_groups/_config_group.html.erb (159.2ms)
Started PUT "/hosts/servername.domain.com 7.252.136.32 at 2015-04-20 13:41:08 -0700
2015-04-20 13:41:08 [I] Processing by HostsController#update as */*
2015-04-20 13:41:08 [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"jIQECaYV7hZclakSTE7zrSN/TgmGeHFQxMN1TBpZO9M=", "host"=>{"name"=>"servername", "hostgroup_id"=>"6",
"environment_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"t", "progress_report_id"=>"[FILTERED]", "compute_attributes"=>
{"volumes_attributes"=>{"new_volumes"=>{"thin"=>"false", "eager_zero"=>"false"}, "0"=>{"thin"=>"false", "eager_zero"=>"false"}, "1"=>{"thin"=>"false", "eager_zero"=>"false"}}}, "interfaces_attributes"=>{"0"=>
{"_destroy"=>"0", "mac"=>"00:50:56:93:5a:d2", "name"=>"servername", "domain_id"=>"1", "subnet_id"=>"1", "ip"=>"7.252.84.184", "managed"=>"0", "primary"=>"1", "provision"=>"0", "tag"=>"",
"attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"141"}, "id"=>"89"}, "1"=>{"_destroy"=>"0", "mac"=>"00:50:56:93:70:08", "name"=>"servername", "domain_id"=>"1",
"subnet_id"=>"2", "ip"=>"7.252.188.58", "managed"=>"1", "primary"=>"0", "provision"=>"1", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"193"}, "id"=>"90"},
"new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0",
"virtual"=>"0", "tag"=>"", "attached_to"=>"admin", "compute_attributes"=>{"type"=>"VirtualE1000", "network"=>"101"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"1", "medium_id"=>"7",
"ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "host_parameters_attributes"=>{"0"=>{"name"=>"auth_type", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false",
"nested"=>"", "id"=>"98"}, "1"=>{"name"=>"vmware_tools_version", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"1", "nested"=>"", "id"=>"99"}}, "is_owned_by"=>"1-Users",
"enabled"=>"1", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image", "provider"=>"Vmware", "id"=>"servername.domain.com"}
2015-04-20 13:41:09 [I] Failed to save: Name has already been taken
And in the Web UI, which highlights both provisioned nics:
Some of the interfaces are invalid. Please check the table below.
Actions