[2.x, enhacement, DNS] Default DNS IP for node from interface without gateway

Bug #1786799 reported by Niels van Adrichem
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Mike Pontillo

Bug Description

In addition to the bug described in https://bugs.launchpad.net/maas/+bug/1776604, I have a new use-case that may further complicate the SQL query that selects the primary interface for the DNS hostname.

We have a network design where PXE and initial deployment is performed through a CAT6-wired network. In the interfaces configuration, however, we do not configure this interface and instead configure a number of bonds (generally 2 or 3) existing of 10Gbe interfaces. Often, one of these bonds is exclusively used for storage access and is hence an access-port without tagged VLANs attached, an IP address that is not publicly routable and no gateway configured. Another bond (not a child of the xe/boot interface) contains a tagged VLAN with publicly routable IP address and a gateway configured for management and public access purposes.

In the current ordering of the query in function get_hostname_ip_mapping() of src/maasserver/models/staticipaddress.py, however, the bond interface without publicly routable address nor gateway gets preference over the VLAN interface on top of a bond with publicly routable address and gateway.

Our problem can be solved by adding another variable to the ordering statement of the SQL query, prefering interfaces with gateways configured over interfaces without gateways configured. Please comment on attached file what you think about this, all tests still seem to run. Ultimately, however, it might be better to make the primary interface for DNS resolution configurable.

Revision history for this message
Niels van Adrichem (nvanadrichem) wrote :
Changed in maas:
status: New → Incomplete
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Niels,

So if I understand correctly, you have 2 bonds:

1. With no routable address, where PXE boot happens
2. Publicly routable address, not where PXE happens.

MAAS correctly sets the hostname based DNS to (1) - (as this is where the machine PXE's from), but you want this set to (2) ?

Additionally, I'm wondering which interface is the default gateway interface? Is this (2)? e.g.
maas <user> interface set-default-gateway <system-id> <interface> ? If it is not, what if you change it that way? will that interface get the hostname based DNS name?

Changed in maas:
milestone: none → 2.5.0alpha2
Revision history for this message
Niels van Adrichem (nvanadrichem) wrote :

Hi Andres,

Thank you for looking into this.

I put a snippet of the interface configuration in the attachment as an example. We have 2 bonds, both of which have access networks (VLANs 1010 and 1011) which are not routable, 1 of them has a VLAN with a routable network (VLAN 1122) which we'd like to have the domain name set to, PXE occurs over a separate non-bonded interface which we do not configure for the final installation.

Currently, MAAS sets the primary hostname to either VLAN 1010 or 1011 shown in the attachment, while those are not routable. The routable network on VLAN 1122 gets the hostname bond0.1122.<hostname>.<domainname> instead of <hostname>.<domainname>. A quick patch was to update the boot-interface in the database directly through an SQL-query, though rebooting a machine moved the setting back to the unconfigured eno0 interface due to the PXE attempt at boot time.

For now we solved it in our system with the patch attached to the bug description, though I think in general it may be considered better to set the hostname to what the interface with the primary gateway is (I noticed there is also a primary gateway interface selection occuring in the function get_best_guess_for_default_gateways() in src/maasserver/models/node.py). As a future follow-up on this, a valid feature request could be to maybe make the primary interface for DNS configurable through CLI and web gui (as also our use case is but yet another use-case that may not cover all other use cases).

Changed in maas:
milestone: 2.5.0alpha2 → 2.5.0beta1
Revision history for this message
Niels van Adrichem (nvanadrichem) wrote :

Given the status is still set to incomplete, can I provide more info to confirm the problem?

Changed in maas:
milestone: 2.5.0beta1 → 2.5.0beta2
tags: added: track
summary: - Default DNS IP for node from interface without gateway
+ [2.x, DNS] Default DNS IP for node from interface without gateway
summary: - [2.x, DNS] Default DNS IP for node from interface without gateway
+ [2.x, enhacement, DNS] Default DNS IP for node from interface without
+ gateway
tags: added: wishlist
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Thanks Niels; I think we have all the information we need to further discuss this issue.

I'll copy and paste part of my comment on the merge proposal for bug #1776604; I think this is relevant:

"""
It's risky for us to change this code because effectively this function is a heuristic. It tries to guess the best interface to assign the node's primary hostname to. In cases where it guesses wrong, it's possible that customers have come to rely on the previous behavior. For example, it looks like we may be missing cases where there the PXE interface is configured with a triple-parent, such as:

physical (eth0) -> bond ({eth0, eth1} via bond0) -> vlan (bond0.11) -> bridge (br-vlan11)

In this case it's possible that a customer might be relying on MAAS to return an IP address assigned to bond0, when in fact we /could/ have a good argument that we should change the logic to return an IP address assigned to br-vlan11.
"""

Hence the dilemma: we would love to accept your patch into MAAS, but it's possible that someone else is already be relying on MAAS DNS to point to a management network with no gateway address.

I think the proper solution is what you imply: allow greater configuration of this algorithm, either implicitly (such as "prefer VLANs with a gateway over anything else") or explicitly ("I want this node to use interface X for its default DNS").

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
Revision history for this message
Mike Pontillo (mpontillo) wrote :

@Neils, I wanted to run an idea by you.

What if you could set a particular space to be the default to use when assigning IP addresses? (If you're not familiar with spaces, they're a way to assign a particular "tag" to a VLAN in MAAS to indicate its purpose. Juju and other tools can use spaces as hints or instructions about what networks it's okay to bind a particular service to.)

For example, in your case, you might have a 'provisioning', 'intranet', and 'storage' space. Then you could set your 'intranet' space to be the default space to use for providing DNS names. With each of your VLANs in MAAS labeled with a particular space, MAAS could better infer which to use for the default DNS name - without the need to manually assign default IPs on a per-node basis (which seems a bit cumbersome).

Thoughts?

Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
Revision history for this message
Niels van Adrichem (nvanadrichem) wrote :

@Mike, that sounds perfect! We are deploying our nodes through Juju with bindings on network spaces to constraint to machines with the right networks attached and to configure the applications with the correct networks. Hence, one preferred DNS space would work for us.

Revision history for this message
Andres Rodriguez (andreserl) wrote : Re: [Bug 1786799] Re: [2.x, enhacement, DNS] Default DNS IP for node from interface without gateway

Using spaces doesn’t solve the issue in environments where spaces ar not
being used. This needs to be solved for configurations that doesn’t depend
on them.

On Fri, Sep 7, 2018 at 5:45 PM Mike Pontillo <email address hidden>
wrote:

> @Neils, I wanted to run an idea by you.
>
> What if you could set a particular space to be the default to use when
> assigning IP addresses? (If you're not familiar with spaces, they're a
> way to assign a particular "tag" to a VLAN in MAAS to indicate its
> purpose. Juju and other tools can use spaces as hints or instructions
> about what networks it's okay to bind a particular service to.)
>
> For example, in your case, you might have a 'provisioning', 'intranet',
> and 'storage' space. Then you could set your 'intranet' space to be the
> default space to use for providing DNS names. With each of your VLANs in
> MAAS labeled with a particular space, MAAS could better infer which to
> use for the default DNS name - without the need to manually assign
> default IPs on a per-node basis (which seems a bit cumbersome).
>
> Thoughts?
>
> --
> You received this bug notification because you are subscribed to MAAS.
> https://bugs.launchpad.net/bugs/1786799
>
> Title:
> [2.x, enhacement, DNS] Default DNS IP for node from interface without
> gateway
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maas/+bug/1786799/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=maas; milestone=2.5.0beta2; status=Triaged;
> importance=High; assignee=None;
> Launchpad-Bug-Tags: track wishlist
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: andreserl mpontillo nvanadrichem
> Launchpad-Bug-Reporter: Niels van Adrichem (nvanadrichem)
> Launchpad-Bug-Modifier: Mike Pontillo (mpontillo)
> Launchpad-Message-Rationale: Subscriber (MAAS)
> Launchpad-Message-For: andreserl
>
--
Andres Rodriguez (RoAkSoAx)
Ubuntu Server Developer
MSc. Telecom & Networking
Systems Engineer

Revision history for this message
Mike Pontillo (mpontillo) wrote :

If spaces aren't being used, it's easy to start using them. So I don't think that's a big concern. I think starting out with a spaces-based selection will get us 80-90% there. The (non-mutually-exclusive) alternatives to using spaces, which could be used for the other 10-20% of use cases, would be:

(1) Allow specific configuration of default DNS on a per-node basis. (I agree this should be done - in addition to spaces - but it's a much more cumbersome approach at scale.)

(2) Allow customization of the selection algorithm as a global setting. For example, we could have options such as "Prefer PXE network for DNS" vs. "Prefer default gateway network for DNS", etc.

tags: added: sprint
Changed in maas:
milestone: 2.5.0beta2 → 2.5.0rc1
Changed in maas:
milestone: 2.5.0rc1 → 2.5.0
Changed in maas:
milestone: 2.5.0 → next
milestone: next → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
Revision history for this message
Niels van Adrichem (nvanadrichem) wrote :

After upgrading to 2.8.0 and re-applying this patch to our installation, I found this bug got automatically closed. Are you still intending to solve this in a future version of MAAS?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.