User should not specify more than 5 DNS nameservers per subnet

Bug #2039403 reported by Hua Zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
Fix Committed
Medium
Hua Zhang

Bug Description

When deploying sunbeam on some platforms, you may see the following DNSNameServersExhausted exception [0] when using 'sunbeam configure --accept-defaults --openrc demo-openrc' in a fresh deployment.

Error: Error creating openstack_networking_subnet_v2: Bad request with: [POST http://10.20.21.10:80/openstack-neutron/v2.0/subnets], error message: {"NeutronError": {"type": "DNSNameServersExhausted", "message": "Unable to complete operation for new subnet. The number of DNS nameservers exceeds the limit 5.", "detail": ""}}

For example, this issue can be encountered on the stsstack test bed, because it has more than 5 DNS nameservers.

ubuntu@juju-5d90c3-sunbeam-0:~$ sudo resolvectl status ens3 |grep 'DNS Server'
Current DNS Server: 10.5.0.15
       DNS Servers: 10.5.0.15 10.5.0.4 10.5.0.3 10.5.0.12 10.5.0.11 10.5.0.17

while the default max_dns_nameservers for neutron [1] is 5, so the exception DNSNameServersExhausted was thrown.

sunbeam is reading nameserver from the file /run/systemd/resolve/resolv.conf according to this commit [2], I think the function get_nameservers inside it should not fectch more than 5 DNS nameservers per subnet to avoid this exception.

[0] https://paste.ubuntu.com/p/8Q4HvJDSV4/
[1] https://docs.openstack.org/neutron/latest/configuration/neutron.html
[2] https://github.com/openstack-snaps/snap-openstack/commit/7b7ca702efb490f13624002093e1b0b4cefe3aab

Revision history for this message
Hua Zhang (zhhuabj) wrote :
Changed in snap-openstack:
assignee: nobody → Hua Zhang (zhhuabj)
Revision history for this message
Hua Zhang (zhhuabj) wrote :

This is my self test result after applying this fix on stsstack (stsstack has more than 5 dns servers), it has already avoided the exception DNSNameServersExhausted - https://paste.ubuntu.com/p/YPPRJdyQSn/

Revision history for this message
Guillaume Boutry (gboutry) wrote (last edit ):

Fix proposed by zhhuabj, merged in main.
Will be fixed in 2023.1.3

Changed in snap-openstack:
importance: Undecided → Medium
milestone: none → 2023.1.3
status: New → Fix Committed
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.