Foreman 1.3.2 - unable to add BMC interface

I've upgraded to Foreman 1.3.2 and am having issues adding a BMC interface
to a bare metal host. This has worked in the past (1.2.x), so I'm not sure
what could be going wrong. The failure in the web interface is silent
while the APIv2 works.

Web interface:

Type: BMC
MAC: 00:25:90:ce:4d:6c
Name: vmstore1-bmc
Domain: <my domain>
Subnet: <IPMI subnet>
IP address: 192.168.205.245
Username: <…>
Password: <…>

When I hit submit the host's "show" page loads but the URL retains the
"/edit" path. I've included the non-debug log output [1]. The debug log
output showed no errors and can include if it will help.

APIv2:
curl -k -u OMIT:OMIT -H 'Accept:application/json,version=2' -H
"Content-type: application/json" -X POST
-d
'{"interface":{"mac":"00:25:90:ce:4d:6c","ip":"192.168.205.245","type":"Nic::BMC","name":"vmstore1-bmc","subnet_id":2,"domain_id":1,"username":"OMIT","password":"OMIT","provider":"IPMI"}}'

https://foreman.MYDOMAIN/api/hosts/vmstore1.MYDOMAIN/interfaces

{"bmc":{"attrs":{"username":"OMIT","password":"OMIT","provider":"IPMI"},"created_at":"2014-01-03T19:13:29Z","domain_id":1,"host_id":47,"id":30,"ip":"192.168.205.245","mac":"00:25:90:ce:4d:6c","name":"vmstore1-bmc","subnet_id":2,"updated_at":"2014-01-03T19:13:29Z"}}

Thanks

  • Trey

[1]:

Started PUT "/hosts/vmstore1.MYDOMAIN" for <CLIENT_IP> at 2014-01-03
12:52:04 -0600
Processing by HostsController#update as /
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"8tab0VGPPq0osqSqhh2UhhGTmqDQkyTxUniMqMucGe4=",
"host"=>{"name"=>"vmstore1", "hostgroup_id"=>"16", "environment_id"=>"2",
"puppet_ca_proxy_id"=>"2", "puppet_proxy_id"=>"2", "puppetclass_ids"=>[""],
"managed"=>"1", "progress_report_id"=>"[FILTERED]",
"mac"=>"00:25:90:ca:3a:30", "domain_id"=>"1", "subnet_id"=>"1",
"ip"=>"192.168.202.245",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}, "new_1388775032198"=>{"_destroy"=>"false",
"type"=>"Nic::BMC", "mac"=>"00:25:90:ce:4d:6c", "name"=>"vmstore1-bmc",
"domain_id"=>"1", "subnet_id"=>"2", "ip"=>"192.168.205.245",
"username"=>"OMIT", "password"=>"[FILTERED]", "provider"=>"IPMI"}},
"architecture_id"=>"1", "operatingsystem_id"=>"8",
"provision_method"=>"build", "medium_id"=>"7", "ptable_id"=>"13",
"disk"=>"", "root_pass"=>"[FILTERED]",
"host_parameters_attributes"=>{"0"=>{"name"=>"kickstart_puppet_run",
"value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>"", "id"=>"69"}},
"is_owned_by"=>"", "enabled"=>"1", "model_id"=>"", "comment"=>"",
"overwrite"=>"false"}, "id"=>"vmstore1.MYDOMAIN"}
Create DHCP reservation for vmstore1-bmc-00:25:90:ce:4d:6c/192.168.205.245
Add DNS PTR record for 192.168.205.245/vmstore1-bmc
Add the TFTP configuration for vmstore1.MYDOMAIN
Fetching required TFTP boot files for vmstore1.MYDOMAIN
Redirected to https://foreman.MYDOMAIN/hosts/vmstore1.MYDOMAIN
Completed 302 Found in 817ms (ActiveRecord: 4.0ms)

Started GET "/hosts/vmstore1.MYDOMAIN" for <CLIENT_IP> at 2014-01-03
12:52:05 -0600
Processing by HostsController#show as /
Parameters: {"id"=>"vmstore1.MYDOMAIN"}
Rendered hosts/_overview.html.erb (7.1ms)
Rendered hosts/show.html.erb within layouts/application (41.4ms)
Rendered home/_user_dropdown.html.erb (1.1ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_topbar.html.erb (1.6ms)
Completed 200 OK in 52ms (Views: 44.2ms | ActiveRecord: 3.6ms)

Started GET "/hosts/vmstore1.MYDOMAIN/edit" for <CLIENT_IP> at 2014-01-03
12:52:05 -0600
Processing by HostsController#edit as /
Parameters: {"id"=>"vmstore1.MYDOMAIN"}
Rendered hosts/_progress.html.erb (0.1ms)
Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)
Rendered puppetclasses/_classes.html.erb (477.6ms)
Rendered puppetclasses/_class_selection.html.erb (486.4ms)
Rendered common/_domain.html.erb (4.7ms)
Rendered hosts/_interfaces.html.erb (6.0ms)
Rendered common/os_selection/_architecture.html.erb (3.4ms)
Rendered common/os_selection/_operatingsystem.html.erb (4.7ms)
Rendered hosts/_operating_system.html.erb (12.2ms)
Rendered hosts/_unattended.html.erb (29.1ms)
Rendered puppetclasses/_class_parameters.html.erb (1070.9ms)
Rendered puppetclasses/_classes_parameters.html.erb (1075.5ms)
Rendered common_parameters/_inherited_parameters.html.erb (5.7ms)
Rendered common_parameters/_puppetclass_parameter.html.erb (2.0ms)
Rendered common_parameters/_puppetclasses_parameters.html.erb (4.0ms)
Rendered common_parameters/_parameter.html.erb (1.3ms)
Rendered common_parameters/_parameter.html.erb (1.0ms)
Rendered common_parameters/_parameters.html.erb (4.2ms)
Rendered hosts/_form.html.erb (1636.2ms)
Rendered hosts/edit.html.erb within layouts/application (1637.8ms)
Rendered home/_user_dropdown.html.erb (1.1ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_topbar.html.erb (1.5ms)
Completed 200 OK in 1651ms (Views: 1634.5ms | ActiveRecord: 10.1ms)

Hi, i got the same issue, but managed to hadle it by checking that all the
subnets are right. also pay attention that MAC you are entering is
right/unique i think this helped me.

··· On Friday, January 3, 2014 9:15:56 PM UTC+2, treydock wrote: > > I've upgraded to Foreman 1.3.2 and am having issues adding a BMC interface > to a bare metal host. This has worked in the past (1.2.x), so I'm not sure > what could be going wrong. The failure in the web interface is silent > while the APIv2 works. > > Web interface: > > Type: BMC > MAC: 00:25:90:ce:4d:6c > Name: vmstore1-bmc > Domain: > Subnet: > IP address: 192.168.205.245 > Username: <...> > Password: <...> > > When I hit submit the host's "show" page loads but the URL retains the > "/edit" path. I've included the non-debug log output [1]. The debug log > output showed no errors and can include if it will help. > > APIv2: > curl -k -u OMIT:OMIT -H 'Accept:application/json,version=2' -H > "Content-type: application/json" -X POST \ > -d > '{"interface":{"mac":"00:25:90:ce:4d:6c","ip":"192.168.205.245","type":"Nic::BMC","name":"vmstore1-bmc","subnet_id":2,"domain_id":1,"username":"OMIT","password":"OMIT","provider":"IPMI"}}' > \ > https://foreman.MYDOMAIN/api/hosts/vmstore1.MYDOMAIN/interfaces > > > {"bmc":{"attrs":{"username":"OMIT","password":"OMIT","provider":"IPMI"},"created_at":"2014-01-03T19:13:29Z","domain_id":1,"host_id":47,"id":30,"ip":"192.168.205.245","mac":"00:25:90:ce:4d:6c","name":"vmstore1-bmc","subnet_id":2,"updated_at":"2014-01-03T19:13:29Z"}} > > > Thanks > - Trey > > [1]: > > Started PUT "/hosts/vmstore1.MYDOMAIN" for at 2014-01-03 > 12:52:04 -0600 > Processing by HostsController#update as */* > Parameters: {"utf8"=>"✓", > "authenticity_token"=>"8tab0VGPPq0osqSqhh2UhhGTmqDQkyTxUniMqMucGe4=", > "host"=>{"name"=>"vmstore1", "hostgroup_id"=>"16", "environment_id"=>"2", > "puppet_ca_proxy_id"=>"2", "puppet_proxy_id"=>"2", "puppetclass_ids"=>[""], > "managed"=>"1", "progress_report_id"=>"[FILTERED]", > "mac"=>"00:25:90:ca:3a:30", "domain_id"=>"1", "subnet_id"=>"1", > "ip"=>"192.168.202.245", > "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", > "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", > "provider"=>"IPMI"}, "new_1388775032198"=>{"_destroy"=>"false", > "type"=>"Nic::BMC", "mac"=>"00:25:90:ce:4d:6c", "name"=>"vmstore1-bmc", > "domain_id"=>"1", "subnet_id"=>"2", "ip"=>"192.168.205.245", > "username"=>"OMIT", "password"=>"[FILTERED]", "provider"=>"IPMI"}}, > "architecture_id"=>"1", "operatingsystem_id"=>"8", > "provision_method"=>"build", "medium_id"=>"7", "ptable_id"=>"13", > "disk"=>"", "root_pass"=>"[FILTERED]", > "host_parameters_attributes"=>{"0"=>{"name"=>"kickstart_puppet_run", > "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>"", "id"=>"69"}}, > "is_owned_by"=>"", "enabled"=>"1", "model_id"=>"", "comment"=>"", > "overwrite"=>"false"}, "id"=>"vmstore1.MYDOMAIN"} > Create DHCP reservation for vmstore1-bmc-00:25:90:ce:4d:6c/192.168.205.245 > Add DNS PTR record for 192.168.205.245/vmstore1-bmc > Add the TFTP configuration for vmstore1.MYDOMAIN > Fetching required TFTP boot files for vmstore1.MYDOMAIN > Redirected to https://foreman.MYDOMAIN/hosts/vmstore1.MYDOMAIN > Completed 302 Found in 817ms (ActiveRecord: 4.0ms) > > > Started GET "/hosts/vmstore1.MYDOMAIN" for at 2014-01-03 > 12:52:05 -0600 > Processing by HostsController#show as */* > Parameters: {"id"=>"vmstore1.MYDOMAIN"} > Rendered hosts/_overview.html.erb (7.1ms) > Rendered hosts/show.html.erb within layouts/application (41.4ms) > Rendered home/_user_dropdown.html.erb (1.1ms) > Read fragment views/tabs_and_title_records-2 (0.1ms) > Rendered home/_topbar.html.erb (1.6ms) > Completed 200 OK in 52ms (Views: 44.2ms | ActiveRecord: 3.6ms) > > > Started GET "/hosts/vmstore1.MYDOMAIN/edit" for at 2014-01-03 > 12:52:05 -0600 > Processing by HostsController#edit as */* > Parameters: {"id"=>"vmstore1.MYDOMAIN"} > Rendered hosts/_progress.html.erb (0.1ms) > Rendered puppetclasses/_selectedClasses.html.erb (0.0ms) > Rendered puppetclasses/_classes.html.erb (477.6ms) > Rendered puppetclasses/_class_selection.html.erb (486.4ms) > Rendered common/_domain.html.erb (4.7ms) > Rendered hosts/_interfaces.html.erb (6.0ms) > Rendered common/os_selection/_architecture.html.erb (3.4ms) > Rendered common/os_selection/_operatingsystem.html.erb (4.7ms) > Rendered hosts/_operating_system.html.erb (12.2ms) > Rendered hosts/_unattended.html.erb (29.1ms) > Rendered puppetclasses/_class_parameters.html.erb (1070.9ms) > Rendered puppetclasses/_classes_parameters.html.erb (1075.5ms) > Rendered common_parameters/_inherited_parameters.html.erb (5.7ms) > Rendered common_parameters/_puppetclass_parameter.html.erb (2.0ms) > Rendered common_parameters/_puppetclasses_parameters.html.erb (4.0ms) > Rendered common_parameters/_parameter.html.erb (1.3ms) > Rendered common_parameters/_parameter.html.erb (1.0ms) > Rendered common_parameters/_parameters.html.erb (4.2ms) > Rendered hosts/_form.html.erb (1636.2ms) > Rendered hosts/edit.html.erb within layouts/application (1637.8ms) > Rendered home/_user_dropdown.html.erb (1.1ms) > Read fragment views/tabs_and_title_records-2 (0.1ms) > Rendered home/_topbar.html.erb (1.5ms) > Completed 200 OK in 1651ms (Views: 1634.5ms | ActiveRecord: 10.1ms) > >

I have double and tripped checked the subnets and MAC addresses and
everything is correct. It seems like a bug since using the API works just
fine. I just don't yet know how to track down why the web interface is not
allowing BMCs to be added.

What is odd is the logs show the DNS and DHCP records being created for the
BMC interface, but the Nic is never written to the database [1].

Log from Foreman when adding BMC to a host in web interface

Log from Foreman when adding BMC using curl API [2]

[1]:

mysql foreman_production -e 'SELECT * FROM nics WHERE

mac="00:1e:c9:ac:0b:4c" OR ip="192.168.206.102" OR name="kvm1-bmc"'
<no results>

After running API command:

mysql foreman_production -e 'SELECT * FROM nics WHERE

mac="00:1e:c9:ac:0b:4c" OR ip="192.168.206.102" OR name="kvm1-bmc"'

··· +----+-------------------+-----------------+----------+----------+---------+-----------+-----------+--------------------------------------------------------+---------------------+---------------------+ > id | mac | ip | type | name | host_id > subnet_id | domain_id | attrs > created_at | updated_at | +----+-------------------+-----------------+----------+----------+---------+-----------+-----------+--------------------------------------------------------+---------------------+---------------------+ > 38 | 00:1e:c9:ac:0b:4c | 192.168.206.102 | Nic::BMC | kvm1-bmc | 66 > 2 | 1 | --- :username: IPMI_USER :password: IPMI_PASSWORD :provider: IPMI > 2014-01-17 19:58:30 | 2014-01-17 19:58:30 | +----+-------------------+-----------------+----------+----------+---------+-----------+-----------+--------------------------------------------------------+---------------------+---------------------+

[2] :

curl -k -u API_USER:API_PASSWORD
-H ‘Accept:application/json,version=2’ -H “Content-type: application/json”
-X POST -d
'{“interface”:{“mac”:“00:1e:c9:ac:0b:4c”,“ip”:“192.168.206.102”,“type”:“Nic::BMC”,“name”:“kvm1-bmc”,“subnet_id”:2,“domain_id”:1,“username”:“IPMI_USER”,“password”:“IPMI_PASSWORD”,“provider”:“IPMI”}}'

https://foreman.DOMAIN/api/hosts/kvm1.DOMAIN/interfaces

On Sunday, January 5, 2014 2:01:21 AM UTC-6, Andrei Burd wrote:

Hi, i got the same issue, but managed to hadle it by checking that all the
subnets are right. also pay attention that MAC you are entering is
right/unique i think this helped me.

On Friday, January 3, 2014 9:15:56 PM UTC+2, treydock wrote:

I’ve upgraded to Foreman 1.3.2 and am having issues adding a BMC
interface to a bare metal host. This has worked in the past (1.2.x), so
I’m not sure what could be going wrong. The failure in the web interface
is silent while the APIv2 works.

Web interface:

Type: BMC
MAC: 00:25:90:ce:4d:6c
Name: vmstore1-bmc
Domain:
Subnet:
IP address: 192.168.205.245
Username: <…>
Password: <…>

When I hit submit the host’s “show” page loads but the URL retains the
"/edit" path. I’ve included the non-debug log output [1]. The debug log
output showed no errors and can include if it will help.

APIv2:
curl -k -u OMIT:OMIT -H ‘Accept:application/json,version=2’ -H
"Content-type: application/json" -X POST
-d
’{“interface”:{“mac”:“00:25:90:ce:4d:6c”,“ip”:“192.168.205.245”,“type”:“Nic::BMC”,“name”:“vmstore1-bmc”,“subnet_id”:2,“domain_id”:1,“username”:“OMIT”,“password”:“OMIT”,“provider”:“IPMI”}}'

https://foreman.MYDOMAIN/api/hosts/vmstore1.MYDOMAIN/interfaces

{“bmc”:{“attrs”:{“username”:“OMIT”,“password”:“OMIT”,“provider”:“IPMI”},“created_at”:“2014-01-03T19:13:29Z”,“domain_id”:1,“host_id”:47,“id”:30,“ip”:“192.168.205.245”,“mac”:“00:25:90:ce:4d:6c”,“name”:“vmstore1-bmc”,“subnet_id”:2,“updated_at”:“2014-01-03T19:13:29Z”}}

Thanks

  • Trey

[1]:

Started PUT “/hosts/vmstore1.MYDOMAIN” for <CLIENT_IP> at 2014-01-03
12:52:04 -0600
Processing by HostsController#update as /
Parameters: {“utf8”=>“✓”,
“authenticity_token”=>“8tab0VGPPq0osqSqhh2UhhGTmqDQkyTxUniMqMucGe4=”,
“host”=>{“name”=>“vmstore1”, “hostgroup_id”=>“16”, “environment_id”=>“2”,
“puppet_ca_proxy_id”=>“2”, “puppet_proxy_id”=>“2”, “puppetclass_ids”=>[""],
“managed”=>“1”, “progress_report_id”=>"[FILTERED]",
“mac”=>“00:25:90:ca:3a:30”, “domain_id”=>“1”, “subnet_id”=>“1”,
“ip”=>“192.168.202.245”,
“interfaces_attributes”=>{“new_interfaces”=>{"_destroy"=>“false”,
“type”=>“Nic::Managed”, “mac”=>"", “name”=>"", “domain_id”=>"", “ip”=>"",
“provider”=>“IPMI”}, “new_1388775032198”=>{"_destroy"=>“false”,
“type”=>“Nic::BMC”, “mac”=>“00:25:90:ce:4d:6c”, “name”=>“vmstore1-bmc”,
“domain_id”=>“1”, “subnet_id”=>“2”, “ip”=>“192.168.205.245”,
“username”=>“OMIT”, “password”=>"[FILTERED]", “provider”=>“IPMI”}},
“architecture_id”=>“1”, “operatingsystem_id”=>“8”,
“provision_method”=>“build”, “medium_id”=>“7”, “ptable_id”=>“13”,
“disk”=>"", “root_pass”=>"[FILTERED]",
“host_parameters_attributes”=>{“0”=>{“name”=>“kickstart_puppet_run”,
“value”=>"[FILTERED]", “_destroy”=>“false”, “nested”=>"", “id”=>“69”}},
“is_owned_by”=>"", “enabled”=>“1”, “model_id”=>"", “comment”=>"",
“overwrite”=>“false”}, “id”=>“vmstore1.MYDOMAIN”}
Create DHCP reservation for vmstore1-bmc-00:25:90:ce:4d:6c/
192.168.205.245
Add DNS PTR record for 192.168.205.245/vmstore1-bmc
Add the TFTP configuration for vmstore1.MYDOMAIN
Fetching required TFTP boot files for vmstore1.MYDOMAIN
Redirected to https://foreman.MYDOMAIN/hosts/vmstore1.MYDOMAIN
Completed 302 Found in 817ms (ActiveRecord: 4.0ms)

Started GET “/hosts/vmstore1.MYDOMAIN” for <CLIENT_IP> at 2014-01-03
12:52:05 -0600
Processing by HostsController#show as /
Parameters: {“id”=>“vmstore1.MYDOMAIN”}
Rendered hosts/_overview.html.erb (7.1ms)
Rendered hosts/show.html.erb within layouts/application (41.4ms)
Rendered home/_user_dropdown.html.erb (1.1ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_topbar.html.erb (1.6ms)
Completed 200 OK in 52ms (Views: 44.2ms | ActiveRecord: 3.6ms)

Started GET “/hosts/vmstore1.MYDOMAIN/edit” for <CLIENT_IP> at 2014-01-03
12:52:05 -0600
Processing by HostsController#edit as /
Parameters: {“id”=>“vmstore1.MYDOMAIN”}
Rendered hosts/_progress.html.erb (0.1ms)
Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)
Rendered puppetclasses/_classes.html.erb (477.6ms)
Rendered puppetclasses/_class_selection.html.erb (486.4ms)
Rendered common/_domain.html.erb (4.7ms)
Rendered hosts/_interfaces.html.erb (6.0ms)
Rendered common/os_selection/_architecture.html.erb (3.4ms)
Rendered common/os_selection/_operatingsystem.html.erb (4.7ms)
Rendered hosts/_operating_system.html.erb (12.2ms)
Rendered hosts/_unattended.html.erb (29.1ms)
Rendered puppetclasses/_class_parameters.html.erb (1070.9ms)
Rendered puppetclasses/_classes_parameters.html.erb (1075.5ms)
Rendered common_parameters/_inherited_parameters.html.erb (5.7ms)
Rendered common_parameters/_puppetclass_parameter.html.erb (2.0ms)
Rendered common_parameters/_puppetclasses_parameters.html.erb (4.0ms)
Rendered common_parameters/_parameter.html.erb (1.3ms)
Rendered common_parameters/_parameter.html.erb (1.0ms)
Rendered common_parameters/_parameters.html.erb (4.2ms)
Rendered hosts/_form.html.erb (1636.2ms)
Rendered hosts/edit.html.erb within layouts/application (1637.8ms)
Rendered home/_user_dropdown.html.erb (1.1ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_topbar.html.erb (1.5ms)
Completed 200 OK in 1651ms (Views: 1634.5ms | ActiveRecord: 10.1ms)