Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #10298 - handle destroyed but present interfaces #2355

Closed

Conversation

domcleal
Copy link
Contributor

@domcleal domcleal commented May 6, 2015

When deleting a host and DHCP orchestration is removing reservations for NICs,
it generates a dhcp_record that contains next-server data. Determining the
next-server IP causes the primary interface to be fetched for DNS resolution,
to resolve the next-server hostname:

app/models/host/base.rb:390:in `get_interface_by_flag'
app/models/host/base.rb:253:in `primary_interface'
app/models/host/managed.rb:130:in `dns_ptr_record'
app/models/host/managed.rb:838:in `to_ip_address'
app/models/nic/managed.rb:16:in `to_ip_address'
app/models/concerns/orchestration/dhcp.rb:49:in `boot_server'
app/models/concerns/orchestration/dhcp.rb:72:in `dhcp_attrs'
app/models/concerns/orchestration/dhcp.rb:18:in `dhcp_record'
app/models/concerns/orchestration/dhcp.rb:32:in `del_dhcp'

get_interface_by_flag no longer attempts to modify the interface when it is
being deleted.


Bit of a pain to reproduce the stack trace above. You need a) DHCP orchestration, b) reverse DNS orchestration, c) TFTP orchestration with either the proxy's :tftp_servername set to a hostname or the smart proxy added to Foreman with a hostname (using an IP here will not reproduce it).

When deleting a host and DHCP orchestration is removing reservations for NICs,
it generates a dhcp_record that contains next-server data.  Determining the
next-server IP causes the primary interface to be fetched for DNS resolution,
to resolve the next-server hostname:

    app/models/host/base.rb:390:in `get_interface_by_flag'
    app/models/host/base.rb:253:in `primary_interface'
    app/models/host/managed.rb:130:in `dns_ptr_record'
    app/models/host/managed.rb:838:in `to_ip_address'
    app/models/nic/managed.rb:16:in `to_ip_address'
    app/models/concerns/orchestration/dhcp.rb:49:in `boot_server'
    app/models/concerns/orchestration/dhcp.rb:72:in `dhcp_attrs'
    app/models/concerns/orchestration/dhcp.rb:18:in `dhcp_record'
    app/models/concerns/orchestration/dhcp.rb:32:in `del_dhcp'

get_interface_by_flag no longer attempts to modify the interface when it is
being deleted.
@dLobatog
Copy link
Member

Merged as 8af4be0, thanks @domcleal!

@dLobatog dLobatog closed this May 11, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants