-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add host-name DHCP option to fixedaddress records #49
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
Small nitpick, this can go in. However, I have a concern. DHCP module uses record comparison to find conflicts in subnets and it does take hostname into account if entered. This can cause issues on existing installations. There is not much we can do about it tho, all records would need to have host-name entries entered via some migration script or something.
Have you tested this in production?
Thank you lzap. Sorry about the messy code. First line of ruby code for me. |
Sure ok let's get this in. Would you mind pushing and amending the two nitpicks I have? Then this can go in. |
Hey @mporrato, is there any update with this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DHCP module uses record comparison to find conflicts in subnets and it does take hostname into account if entered.
All I can find is this:
if options[:mac] != existing_host.mac || options[:hostname] != existing_name | |
raise Proxy::DHCP::Collision, "Record #{options[:ip]} conflicts with an existing record." | |
end |
And that doesn't look like it would affect anything.
So I'd be ok with merging this.
Sorry for the late reply: I missed the notification. |
Thank you for that update. Do you still see value in this PR for other users? |
55096a1
to
edb32df
Compare
I took the liberty of rebasing and fixing the Rubocop violations. |
@ekohl yes, I believe this is definitely needed in order to make the Infoblox smart proxy work more like the standard dhcp smart proxy, and also the issues about nextserver and bootfile should be addressed, but this is off-topic for this PR: I can provide more details about those if needed. |
I'd like to hear about those yes. |
@ekohl this is the hook script I created to address all those issues: https://gist.github.com/mporrato/d1cfed082c5bc0e2a458306607cc2b3f If I recall correctly, the issues were related to hosts without a bootfile or nextserver field: those fields were created in the Infoblox FixedAddress object as empty strings instead of being marked as not in use (see my script), causing the infoblox server to send the dhcp option with an empty content instead of omitting it entirely, and therefore leading to boot failures. Hope this helps. |
@timdeluxe any thoughts on this? |
@ekohl Good question. As we use "Host" objects and do not have DHCP ranges, we do not work with "fixedaddress". We don't use fixedaddress right now, so i can't confirm if the issue the PR opens with is a real one. I also can't reproduce right now or the next days, since we/i do not have a time budget to do so at the moment. Looks like @mporrato worked heavily with it (in the past) and recognized it as a problem, so it should be merged. I vote for merging this PR as is after the failing tests have been fixed (which come from the "merge!" code, where you @ekohl also mentioned about above). The problem with the other "empty" DHCP options should be handled as soon someone else can confirm it. @mporrato obviously can't anymore, because he does not have access to his environment anymore. |
@timdeluxe the bootfile and nextserver issues are not directly related to this PR, which is about the host-name option alone. IIRC, bootfile and nextserver are not treated like other dhcp options in infoblox and they are presented in a dedicated tab in the web ui (the bootp tab, if I'm not mistaken) and I'm pretty sure you can override the network level settings on a per-fixedaddress (and probably also per-host) basis. One detail that I forgot to mention but I think might be relevant: we only had this problem with networks were we had to use iPXE to provision the hosts and therefore we had to configure the infoblox network to serve the undionly.kpxe file to regular PXE clients. |
@mporrato Well, the documentation for NIOS 8.5 (we are using right now) reflects what you are saying (DHCP options per single host or fixedaddress and inheritance), the only issue is that our Web-UI doesn't. I don't know why. I checked everywhere to see if there is any option preventing that, but couldn't find any (i am super-admin in the tool, so no permission issue). We can only configure DHCP options / BOOTP down to the network level, not deeper - i don't know why. So i also can not test / confirm any fixes of the plugin regarding that. So if there is anyone willing writing code for this issues AND has an environment to test that, we can work on getting the code into the plugin and released. So far it looks like no one else is having the issue yet. Maybe i repeat myself, but let's work on getting this PR clean. Do you want to fix your code yourself or shall one of us active here in the PR do it? |
The behaviour of DHCP reservations created by the Infoblox smart proxy currently does not match the behaviour of DHCP reservations created by the isc-dhcpd smart proxy: specifically, Infoblox does not seem to send the client host name in the offer (option 12, "host-name") unless the reservation contains an explicit DHCP option for that.
In other words, setting the "name" field when creating the fixedaddress is not enough for Infoblox to send the "host-name" DHCP option.
On the other hand, the isc-dhcpd smart proxy creates reservations with
supersede host-name
, causing the host name to be included in the response.This patch adds an explicit "host-name" option to all fixedaddress records, making the Infoblox smart proxy behave more like the isc-dhcpd one.