Repository navigation
Conversation
Proxmox VE (configdrive2) writes the nameservers once, with an
underscore, on the loopback stanza:
auto lo
iface lo inet loopback
dns_nameservers 192.0.2.53 192.0.2.54
dns_search example.com
auto eth0
iface eth0 inet static
...
The DNSNS regex only matches "dns-nameservers" and the loopback block
is never related to the other interfaces, so instances get no DNS
servers at all.
Accept both "dns-nameservers" and "dns_nameservers", and use the
nameservers found on the loopback stanza for every NIC that has none
of its own. The loopback block no longer produces a NetworkDetails
entry with only nameservers in it. dns_search is still ignored, as
NetworkDetails has no field for search domains.
Fixes: cloudbase#56
Signed-off-by: luxend <luxend@instantnode.eu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #56
Problem
Proxmox VE configdrive2 writes the nameservers once, with an underscore, under the loopback stanza (configdrive2_network):
Windows guests end up with no DNS servers.
Cause
debiface.py#L55only matchesdns-nameservers.loblock, whichparse()treats as a separate entry. That gives aNetworkDetailswith only nameservers set, which_preprocess_nicslater rejects as incomplete. The real NICs never get the nameservers.Fix
dns[-_]nameservers.dns-nameservers(OpenStack/Nova style) still take precedence. The loopback block no longer produces aNetworkDetailsentry.dns_searchis still ignored, becauseNetworkDetailshas no field for search domains.This covers the regex part of #116 without the
netshchange inosutils/windows.py.Tests
test_parse_loopback_dns(Proxmox shape, two NICs) andtest_parse_loopback_dns_iface_dns_wins(per-interface nameservers win over the loopback ones) incloudbaseinit/tests/utils/test_debiface.py. Both fail on master and pass with this change.test_debiface,test_networkconfig,test_baseopenstackserviceandtest_nocloudserviceall pass, and flake8 with hacking 6.1.0 is clean.