Skip to content

qa/dnsmasq: use managed dnsmasq instead of editing resolv.conf - #69371

Merged
cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-76961
Jun 30, 2026
Merged

cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-76961

Conversation

@cbodley

@cbodley cbodley commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

this task was manually editing /etc/resolv.conf to configure dns names. on ubuntu 24, these changes were getting clobbered by NetworkManager or systemd service restarts

instead, manage dnsmasq depending on host distro. rpm-based distros use NetworkManager's dnsmasq plugin, while deb-based distros use systemd-resolved to point at the local dnsmasq

Fixes: https://tracker.ceph.com/issues/76961

Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added the tests label Jun 9, 2026
@cbodley
cbodley force-pushed the wip-76961 branch 2 times, most recently from eff53f3 to 5f8f621 Compare June 10, 2026 14:18
@cbodley

cbodley commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley
cbodley force-pushed the wip-76961 branch 2 times, most recently from 9a45c28 to 24b5b5f Compare June 18, 2026 18:25
@cbodley cbodley changed the title qa/dnsmasq: configure systemd-resolved instead of resolv.conf qa/dnsmasq: configure NetworkManager plugin instead of resolv.conf Jun 18, 2026
@cbodley
cbodley force-pushed the wip-76961 branch 4 times, most recently from cf80491 to 68bd68e Compare June 19, 2026 14:26
@cbodley
cbodley marked this pull request as ready for review June 19, 2026 14:27
@cbodley

cbodley commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

i ended up needing two separate strategies for ubuntu vs rocky/centos, because ubuntu is using systemd-resolved by default while rocky/centos uses NetworkManager

ubuntu 24 teuthology.log:

> set -ex
> sudo dd of=/etc/dnsmasq.d/ceph.conf
> sudo restorecon /etc/dnsmasq.d/ceph.conf
sudo: restorecon: command not found
got remote process result: 1
> cat /etc/dnsmasq.d/ceph.conf
# This file is generated by dnsmasq teuthology task
address=/.s3.trial190.front.sepia.ceph.com/10.20.193.190
> sudo mkdir /etc/systemd/resolved.conf.d
> set -ex
> sudo dd of=/etc/systemd/resolved.conf.d/dnsmasq.conf
> sudo restorecon /etc/systemd/resolved.conf.d/dnsmasq.conf
sudo: restorecon: command not found
got remote process result: 1
> sudo systemctl restart dnsmasq
> sudo systemctl restart systemd-resolved
> cat /etc/systemd/resolved.conf.d/dnsmasq.conf
# This file is generated by dnsmasq teuthology task
[Resolve]
DNS=127.0.0.1
Domains=~s3.trial190.front.sepia.ceph.com
> ping -c 4 s3.trial190.front.sepia.ceph.com
PING s3.trial190.front.sepia.ceph.com (10.20.193.190) 56(84) bytes of data.
64 bytes from trial190.front.sepia.ceph.com (10.20.193.190): icmp_seq=1 ttl=64 time=0.012 ms
64 bytes from trial190.front.sepia.ceph.com (10.20.193.190): icmp_seq=2 ttl=64 time=0.010 ms
64 bytes from trial190.front.sepia.ceph.com (10.20.193.190): icmp_seq=3 ttl=64 time=0.011 ms
64 bytes from trial190.front.sepia.ceph.com (10.20.193.190): icmp_seq=4 ttl=64 time=0.009 ms

--- s3.trial190.front.sepia.ceph.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3099ms

rocky 10 teuthology.log:

> set -ex
> sudo dd of=/etc/NetworkManager/dnsmasq.d/ceph.conf
> sudo restorecon /etc/NetworkManager/dnsmasq.d/ceph.conf
> cat /etc/NetworkManager/dnsmasq.d/ceph.conf
# This file is generated by dnsmasq teuthology task
address=/.s3.trial108.front.sepia.ceph.com/10.20.193.108
> set -ex
> sudo dd of=/etc/NetworkManager/conf.d/dnsmasq.conf
> sudo restorecon /etc/NetworkManager/conf.d/dnsmasq.conf
> sudo systemctl restart NetworkManager
> cat /etc/NetworkManager/conf.d/dnsmasq.conf
# This file is generated by dnsmasq teuthology task
[main]
dns=dnsmasq
> ping -c 4 s3.trial108.front.sepia.ceph.com
PING s3.trial108.front.sepia.ceph.com (10.20.193.108) 56(84) bytes of data.
64 bytes from trial108.front.sepia.ceph.com (10.20.193.108): icmp_seq=1 ttl=64 time=0.009 ms
64 bytes from trial108.front.sepia.ceph.com (10.20.193.108): icmp_seq=2 ttl=64 time=0.017 ms
64 bytes from trial108.front.sepia.ceph.com (10.20.193.108): icmp_seq=3 ttl=64 time=0.011 ms
64 bytes from trial108.front.sepia.ceph.com (10.20.193.108): icmp_seq=4 ttl=64 time=0.010 ms

--- s3.trial108.front.sepia.ceph.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3054ms

@cbodley cbodley changed the title qa/dnsmasq: configure NetworkManager plugin instead of resolv.conf qa/dnsmasq: use managed dnsmasq instead of editing resolv.conf Jun 19, 2026
@cbodley cbodley added the rgw label Jun 19, 2026
@cbodley
cbodley requested review from a team and kshtsk June 19, 2026 14:39
@cbodley

cbodley commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

The following tests FAILED:
320 - run-tox-qa (Failed)

flake8: commands[0] /ceph/qa> flake8 --select=F,E9 --exclude=venv,.tox
./tasks/dnsmasq.py:6:1: F401 're' imported but unused
./tasks/dnsmasq.py:165:5: F841 local variable 'testdir' is assigned to but never used

cbodley added 2 commits June 22, 2026 10:34
this task was manually editing /etc/resolv.conf to configure dns names.
on ubuntu 24, these changes were getting clobbered by NetworkManager or
systemd service restarts

instead, manage dnsmasq depending on host distro. rpm-based distros use
NetworkManager's dnsmasq plugin, while deb-based distros use
systemd-resolved to point at the local dnsmasq

Fixes: https://tracker.ceph.com/issues/76961

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@kshtsk

kshtsk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I'd love to try this patch running, but is this possible when there is no network manager used or it is disabled.

@cbodley

cbodley commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

I'd love to try this patch running, but is this possible when there is no network manager used or it is disabled.

@kshtsk good question, i've only been concerned about the distro images used for upstream qa

@cbodley
cbodley merged commit 283108e into ceph:main Jun 30, 2026
6 checks passed
@cbodley
cbodley deleted the wip-76961 branch June 30, 2026 12:30
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