You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IaaSIssues or pull requests relevant for Team1: IaaSSCS is standardizedSCS is standardizedSCS-VP10Related to tender lot SCS-VP10standardsIssues / ADR / pull requests relevant for standardization & certification
While it's easy to connect a VM to a router with an external network (see #167) and then configure the subnet to use well-known DNS servers such as the ones from google, cloudflare or quad9 to have name resolution, this has a few disadvantages:
Maybe we want to have DNS resolution for internal hosts (via designate or neutron designate integration) which we will not get this way
Maybe we want name resolution to work without outbound connections into the internet (e.g. to talk to an internal update mirror)
Maybe we want to talk to an internal server that has higher availabilities and/or lower worst case latencies
Maybe we want to avoid exposing our DNS queries directly to a nameserver outside of our own and our provider's control (privacy concern) even if we have a floating IP
Maybe we don't want to care about researching reliable public DNS servers but rather delegate this to the cloud operator
Recommendation would be that users can leave the --dns-nameserer option out of the subnet creation call.
In that case the expectation would be that freshly created VMs which get IPs via DHCP will also get a nameserver from DHCP that works.
Working means:
It is connected to local DNS/designate service, resolving local names that are configured via designate and or via the neutron/designate integration
It is connected to public DNS service and can resolve names form the public DNS system
While understanding how local DNS works in OpenStack, we got curious because even with --dns-nameservers 9.9.9.9 set on a subnet, resolution of OpenStack local names still worked. Double-checking resolv.conf revealed that no other nameserver was injected.
Looking at tcpdump, something odd stood out:
$ sudo tcpdump -vvvnni eth0 port 53
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:42:14.153148 IP (tos 0x0, ttl 64, id 35577, offset 0, flags [DF], proto UDP (17), length 81)
10.1.0.61.56891 > 9.9.9.9.53: [bad udp cksum 0x1c9e -> 0x1a53!] 32596+ AAAA? cirros-server-3.openstackgate.local. (53)
10:42:14.162337 IP (tos 0x0, ttl 57, id 43106, offset 0, flags [none], proto UDP (17), length 156)
9.9.9.9.53 > 10.1.0.61.56891: [udp sum ok] 32596 NXDomain q: AAAA? cirros-server-3.openstackgate.local. 0/1/0 ns: . [53m24s] SOA a.root-servers.net. nstld.verisign-grs.com. 2024041900 1800 900 604800 86400 (128)
10:42:14.162408 IP (tos 0x0, ttl 64, id 48881, offset 0, flags [DF], proto UDP (17), length 101)
10.1.0.61.52429 > 9.9.9.9.53: [bad udp cksum 0x1cb2 -> 0x8297!] 45630+ AAAA? cirros-server-3.openstackgate.local.openstackgate.local. (73)
10:42:14.169194 IP (tos 0x0, ttl 57, id 6225, offset 0, flags [none], proto UDP (17), length 176)
9.9.9.9.53 > 10.1.0.61.52429: [udp sum ok] 45630 NXDomain q: AAAA? cirros-server-3.openstackgate.local.openstackgate.local. 0/1/0 ns: . [59m9s] SOA a.root-servers.net. nstld.verisign-grs.com. 2024041900 1800 900 604800 86400 (148)
10:42:14.169290 IP (tos 0x0, ttl 64, id 31926, offset 0, flags [DF], proto UDP (17), length 81)
10.1.0.61.40202 > 9.9.9.9.53: [bad udp cksum 0x1c9e -> 0xbc65!] 14707+ A? cirros-server-3.openstackgate.local. (53)
10:42:14.170213 IP (tos 0x0, ttl 64, id 31926, offset 0, flags [DF], proto UDP (17), length 132)
9.9.9.9.53 > 10.1.0.61.40202: [no cksum] 14707- q: A? cirros-server-3.openstackgate.local. 1/0/0 cirros-server-3.openstackgate.local. [1h] A 10.1.0.56 (104)
10:42:14.172569 IP (tos 0x0, ttl 64, id 17795, offset 0, flags [DF], proto UDP (17), length 68)
10.1.0.61.39649 > 9.9.9.9.53: [bad udp cksum 0x1c91 -> 0xa0eb!] 51333+ PTR? 56.0.1.10.in-addr.arpa. (40)
10:42:14.173893 IP (tos 0x0, ttl 64, id 17795, offset 0, flags [DF], proto UDP (17), length 139)
9.9.9.9.53 > 10.1.0.61.39649: [no cksum] 51333- q: PTR? 56.0.1.10.in-addr.arpa. 1/0/0 56.0.1.10.in-addr.arpa. [1h] PTR cirros-server-3.openstackgate.local. (111)
As we can see, when quad9 replies with NXDOMAIN for names related to the cloud, the reply has a proper UDP checksum ([udp sum ok]) 1, while the replies which contain the correct IP address do not have a UDP checksum ([no cksum]). That is suspicious, because it is not trivial to generate a checksum-less UDP packet on most OSes (and quad9 just runs standard DNS software AFAIK).
This checksum aspect is a hint at something fishy going on in the SDN of OpenStack itself, hence we dig into the generated OpenFlow rules on the hypervisor. We eventually2 find this rule (linebreaks added for readability):
That rule matches on UDP packets to port 533 and then sends them to the controller for further processing.
Initially, I thought that the controller was neutron-ovn-agent, but that was incorrect. After a lot of digging around the neutron code, I eventually found that neutron just inserts DNS records into the northdb, via:
There, the DB lookup for matching DNS records happens and the forged response packet is constructed, if necessary.
Footnotes
Don't mind the [bad udp chksum] on the outbound packets. UDP checksum generation happens after the point where tcpdump hooks. ↩
After going through a couple hundred of lines of openflow and running the openflow engine on brain wetware, cannot recommend that. ↩
Note that to reach this rule, a bunch of preconditions need to be satisfied, such as that the packet must originate from the VMs port. This will thus not affect queries sent to a DNS server running in a VM, for example. ↩
Reacted by Martin Morgenstern, Markus Hentsch and Philipp Hahn
Adding to #229 (comment) after validating a few more things:
In OVN setups:
only if dns, dns_domain_ports or related extensions1 (such as subnet_dns_publish_fixed_ip, dns-integration-domain-keywords etc.) are enabled in the Neutron configuration, then DNS interception flows are configured in OVN
if no such DNS extension is enabled in Neutron, there does not seem to be any interception happening, no network packets without checksum can be observed and ovn-nbctl list DNS does not list any records
In OVS setups:
I tried figuring out how this works in OVS-based setups. However, it does not seem easy to figure out whether the OVS configuration of Neutron is actually supposed to even support the internal DNS resolution.
A page about OpenStack deployment using Juju Charms2 states:
OVN handles instance access to DNS differently to how ML2+OVS does. Please refer to the Internal DNS resolution paragraph in this document for details.
... and the paragraph in question says:
OVN supports Neutron internal DNS resolution.
That kind of suggests that OVS might not support this but it is not clearly stated anywhere.
I redeployed my DevStack with OVS and so far wasn't able to get internal DNS resolution working. The /etc/resolv.conf entries in VMs now also point to the DHCP agent directly. It seems that in any case with OVS no such interception like with OVN will happen.
Update to OVS (2024-04-22):
when using --dns-nameservers on a subnet in an OVS-based setup, the /etc/resolv.conf entry will specify that nameserver; in any other case, the IP address of the DHCP agent will be inserted there instead
this is in contrast to OVN-based setups, where the entry always refers to a genuine DNS server (not the agent) and DNS is simply intercepted using the OVN flow mechanic documented above
if --dns-nameservers is not used and the DHCP agent acts as the DNS server, it can resolve other VMs in the same subnet, however in contrast to OVN-based setups, this will not automatically include the human-readable VM name as DNS record but only the IP address3 in form of host-10-1-0-22.openstacklocal for example
this is pretty useless in comparison since I can use the IP address directly anyway if I know it
OVS
OVN
DHCP agent(s) are specified as DNS server(s) in resolv.conf if no --dns-nameserver was specified.
The entry in resolv.conf always refers to genuine DNS server(s) (likely external) as per dns_servers setting of ml2_conf.ini under the [ovn] section.
Internal DNS only works if --dns-nameserver was not used.
Internal DNS works regardless of subnet-specific settings.
Internal DNS is implemented by the DHCP agent, which resolves it either locally or externally depending on the request.
Internal DNS is implemented by protocol traffic interception via OVN OpenFlow.
Automatic Internal DNS is limited to IP-based FQDNs like host-10-1-0-22.openstacklocal.
Automatic Internal DNS uses the VM names like my-server.openstacklocal.
I was able to verify the behavior of the dns_domain_ports extension according to use cases 1 and 2 1 as well as Designate (use case 3):
Case 1: DNS record through Floating IP assignment and network/port DNS settings
Use case:
dns-domain-ports Neutron extension enabled or any of the superseding ones (see openstack extension list --network)
private tenant network connected via Neutron router to public/external network
zone configured in Designate and dns_domain set accordingly for either tenant network or VM port directly
result: floating ip associated to the server leads to automatic DNS record in Designate
Example:
openstack zone create example.org.
openstack network set --dns-domain example.org. private
openstack server create --network private ... my-server
openstack floating ip create public
openstack server add floating ip my-server 10.0.1.146
openstack recordset list example.org.
# +------+------------------------+------+---------------------------+--------+--------+# | id | name | type | records | status | action |# +------+------------------------+------+---------------------------+--------+--------+# | ... | my-server.example.org. | A | 10.0.1.146 | ACTIVE | NONE |# +------+------------------------+------+---------------------------+--------+--------+
Case 2: Direct DNS record for Floating IP
dns-domain-ports Neutron extension enabled or any of the superseding ones (see openstack extension list --network)
zone configured in Designate and dns_domain set accordingly during floating ip creation
result: floating ip has a static DNS record registered during its creation that exists regardless of whether the floating ip is assigned or not
Example:
openstack zone create example.org.
openstack floating ip create --dns-domain example.org. --dns-name other-server public
openstack recordset list example.org.
# +------+---------------------------+------+------------------------+--------+--------+# | id | name | type | records | status | action |# +------+---------------------------+------+------------------------+--------+--------+# | ... | other-server.example.org. | A | 10.0.1.143 | ACTIVE | NONE |# +------+---------------------------+------+------------------------+--------+--------+
Case 3: DNS records for fixed IPs
Case 3a: static records using the subnet-dns-publish-fixed-ip extension
NOTE: This works independently of whether the network/subnet actually is externally reachable. This is not verified by Neutron in contrast to case 3b!
subnet-dns-publish-fixed-ip Neutron extension enabled or dns-integration-domain-keywords which supersedes it
note: dns-domain-ports is insufficient as it does not include this feature!
zone configured in Designate and dns_domain set accordingly during port creation
result: fixed ip associated to the port leads to automatic DNS record in Designate
Example:
openstack zone create example.org.
openstack network create private-2
openstack subnet create --network private-2 --subnet-range 10.3.0.0/26 --dns-publish-fixed-ip private-2-subnet
openstack port create port1 --dns-domain example.org. --dns-name port1 --network private-2
openstack recordset list example.org.
# +------+------------------------+------+---------------------------+--------+--------+# | id | name | type | records | status | action |# +------+------------------------+------+---------------------------+--------+--------+# | ... | port1.example.org. | A | 10.3.0.22 | ACTIVE | NONE |# +------+------------------------+------+---------------------------+--------+--------+
This also works for servers instead of ports, if the dns_domain is set on the network directly instead, which will propagate to all ports created within automatically:
Example:
openstack zone create example.org.
openstack network create private-2 --dns-domain example.org.
openstack subnet create --network private-2 --subnet-range 10.3.0.0/26 --dns-publish-fixed-ip private-2-subnet
openstack server create --network private-2 ... example-server
openstack recordset list example.org.
# +------+-----------------------------+------+----------------------+--------+--------+# | id | name | type | records | status | action |# +------+-----------------------------+------+----------------------+--------+--------+# | ... | example-server.example.org. | A | 10.3.0.37 | ACTIVE | NONE |# +------+-----------------------------+------+----------------------+--------+--------+
Case 3b: automatic records for externally reachable fixed IPs using dns_domain_ports extension
NOTE: In contrast to case 3a this does not require the subnet-dns-publish-fixed-ip extension or any of its successors. However, Neutron will only apply this case to fixed IPs in networks that are detected as external (see the expandable spoiler below; router:external=ExternalDOES NOT count)!
dns-domain-ports Neutron extension enabled or any of the superseding ones (see openstack extension list --network)
a provider network and subnet usually provisioned by the CSP for specific tenant project with type flat, vlan, vxlan, gre or geneve; the network must count as externally reachable (see below)
the network and subnet must be created by an administrator to set the provider network flags
the network and subnet must belong to the tenant (i.e. project id match) in order for them to be able to create ports in it
zone configured in Designate and dns_domain set accordingly during port creation by the tenant
result: fixed IP address of the port in the externally reachable network receives a static DNS record upon creation
Note that networks with router:external=External explicitly do not count as externally reachable in this context!
Annotated version:
# note that this method returns the inverse of "DNS record will be published"defexternal_dns_not_needed(self, context, network, subnets):
dns_driver=_get_dns_driver()
# If no external driver is registered (e.g. Designate),# do not attempt to publish recordsifnotdns_driver:
returnTrue# If the dns_publish_fixed_ip extension is used anywhere, publish a recordforsubnetinsubnets:
ifsubnet.get('dns_publish_fixed_ip'):
returnFalse# Networks with the external router attribute are exempt from DNS recordsifnetwork['router:external']:
returnTrue# For networks with more than 1 segment, publish DNS (?)segments=segments_db.get_network_segments(context, network['id'])
iflen(segments) >1:
returnFalseprovider_net=segments[0]
# Network type "local" is exempt from DNS recordsifprovider_net['network_type'] ==lib_const.TYPE_LOCAL:
returnTrue# Network type "flat" will always publish DNS records# (unless above checks fail)ifprovider_net['network_type'] ==lib_const.TYPE_FLAT:
returnFalse# Network type "vlan" will publish DNS records, if the segmentation# id is outside of the ranges for project networksifprovider_net['network_type'] ==lib_const.TYPE_VLAN:
returnself._is_vlan_tenant_network(provider_net)
# Network type "gre", "vxlan" and "geneve" will publish DNS records,# if the segmentation id is outside of the ranges for project networksifprovider_net['network_type'] in [
lib_const.TYPE_GRE, lib_const.TYPE_VXLAN,
lib_const.TYPE_GENEVE]:
returnself._is_tunnel_tenant_network(provider_net)
returnTrue
Example:
# (as admnistrator)
openstack network create --provider-network-type flat --project $TENANT_PROJECT --provider-physical-network testphysnet flat-demo
openstack subnet create --network flat-demo --project $TENANT_PROJECT --subnet-range 10.5.0.0/26 flat-demo-subnet
# (as tenant)
openstack port create tenant-port-flat-external --dns-name tenant-port-external --dns-domain example.org. --network flat-demo
openstack recordset list example.org.
# +------+-----------------------------------+------+----------------------+--------+--------+# | id | name | type | records | status | action |# +------+-----------------------------------+------+----------------------+--------+--------+# | ... | tenant-port-external.example.org. | A | 10.5.0.57 | ACTIVE | NONE |# +------+-----------------------------------+------+----------------------+--------+--------+
Summary
The two major extension driver choices compared:
dns_domain_ports
subnet_dns_publish_fixed_ip (or any superseding one)
Automatic DNS records only work on CSP-configured networks (provider networks).
Automatic DNS records also work on tenant-created networks (self-service).
Networks have to match specific criterias2 to allow DNS record creations.
No restriction on network attributes for DNS record creation.
Record creation is implicit if all criterias are met.
Explicit dns_publish_fixed_ip attribute for subnets to trigger behavior.
External reachability of network is partially enforced by the criterias.
External reachability of network is not actually enforced, DNS records might not work at all.
TL;DR: According to the bug report, in OVN setups VMs that have no connectivity to the outside DNS servers will also not receive local DNS responses for internal DNS or Designate (since no DNS traffic passes OVN that it can intercept and manipulate). This is different from OVS where the DHCP agent was always available as a local DNS target regardless of whether the VM actually had external connectivity.
Important learning after debugging the problem that I could not reproduce the subnet-dns-publish-fixed-ip behavior1 as documented upstream:
There is a hierarchy of DNS extensions for ML2 in Neutron2 in which they supersede one another in terms of functionality:
dns-integration
dns-domain-ports (includes dns-integration)
subnet-dns-publish-fixed-ip (includes dns-integration and dns-domain-ports)
dns-integration-domain-keywords (includes all others)
important: the corresponding extension driver for ML2 (as per ml2_conf.ini's extension_drivers= list) is called dns_domain_keywords (without the "integration" part!)
To get the subnet-dns-publish-fixed-ip functionality, either subnet-dns-publish-fixed-ip or dns-integration-domain-keywords (which includes the former) must be activated.
Check that the subnet-dns-publish-fixed-ip Neutron extension is enabled.
In a section further above it illustrates an example how to check enabled extensions:
$ openstack extension list --network -f value -c Alias | grep dns-domain-ports
dns-domain-ports
If that is done for the subnet-dns-publish-fixed-ip extension, the extension name "subnet-dns-publish-fixed-ip" is returned by the API even if only the dns_domain_ports extension driver is active which does not offer the functionality at all. Any subnet created with the flag ends up with dns_publish_fixed_ip attribute set to None and the database table for the flag stays empty.
Only after the entry in /etc/neutron/plugins/ml2/ml2_conf.ini is adjusted to replace the extension driver by one that supports the feature:
This seems to be a bug in Neutron API since it communicates an extension as being active when it actually isn't?
To make matters worse, the documentation explicitly instructs the user to check the API extensions which will mislead them as it happened to me.
Note that API extensions as communicated by openstack extension list are always written with dashes whereas the extension driver's names always use underscores.
TL;DR: According to the bug report, in OVN setups VMs that have no connectivity to the outside DNS servers will also not receive local DNS responses for internal DNS or Designate (since no DNS traffic passes OVN that it can intercept and manipulate). This is different from OVS where the DHCP agent was always available as a local DNS target regardless of whether the VM actually had external connectivity.
Soo... always add 169.254.169.254 or something to your dns nameservers, which would hopefully hit the default route?
Worth noting: [OVN] DNS resolution not forwarded with OVN driver TL;DR: According to the bug report, in OVN setups VMs that have no connectivity to the outside DNS servers will also not receive local DNS responses for internal DNS or Designate (since no DNS traffic passes OVN that it can intercept and manipulate). This is different from OVS where the DHCP agent was always available as a local DNS target regardless of whether the VM actually had external connectivity.
Soo... always add 169.254.169.254 or something to your dns nameservers, which would hopefully hit the default route?
I both reproduced the "bug" as well as verified your suggestion (which seems to work!):
On 2024-09-23 the current guidelines of the standard were discussed with CSP representatives (artcodix, plusserver, among others) in the Lean SCS Operator Coffee.
Below is a summary of the discussion points that I noted down:
Neutron plugins for automated DNS record registration
there are problems with the internal DNS in conjunction with multi-tenant setups where the automatic naming is not powerful enough to prevent all collisions
even the external DNS focused plugins like "subnet-dns-publish-fixed-ip" and "dns-integration-domain-keywords" led to trouble with multi-region setups and collisions
in short, none of the Neutron integrations were without issues, especially in multi-tenant/multi-region setups; the CSPs eventually decided to disable all of them
implementing local DNS recursors
it was argued that the vast majority of customers bring their own DNS configuration anyway, which leaves little incentive for a CSP to provide DNS servers themselves
in the eyes of the CSPs the standard would need to be extremely flexible and lenient when mandating any kind of local DNS implementation by the CSP
DNSSEC
artcodix said that DNSSEC has not been of interest for any customers so far, so there was little motivation to implement it
plusserver reported that there were issues with DNSSEC in conjunction with their central DNS and anycast distribution to individual clouds in the past
although the challenge in actually implementing DNSSEC was rated to be rather small, the technical necessity of mandating DNSSEC via the standard was questioned by the CSPs
Unfortunately, this does not seem to leave a whole lot of options for the standard to include anything more than a few SHOULDs right now.
IaaSIssues or pull requests relevant for Team1: IaaSSCS is standardizedSCS is standardizedSCS-VP10Related to tender lot SCS-VP10standardsIssues / ADR / pull requests relevant for standardization & certification
Activity
garloff commentedon Dec 7, 2022
While it's easy to connect a VM to a router with an external network (see #167) and then configure the subnet to use well-known DNS servers such as the ones from google, cloudflare or quad9 to have name resolution, this has a few disadvantages:
garloff commentedon Dec 7, 2022
Recommendation would be that users can leave the
--dns-namesereroption out of the subnet creation call.In that case the expectation would be that freshly created VMs which get IPs via DHCP will also get a nameserver from DHCP that works.
Working means:
11 remaining items
horazont commentedon Apr 19, 2024
TL;DR: OpenStack injects DNS responses via OVN, which is a documented feature. Don't mind the hundreds of lines of C code directly exposed on port 53 then.
While understanding how local DNS works in OpenStack, we got curious because even with
--dns-nameservers 9.9.9.9set on a subnet, resolution of OpenStack local names still worked. Double-checking resolv.conf revealed that no other nameserver was injected.Looking at tcpdump, something odd stood out:
As we can see, when quad9 replies with NXDOMAIN for names related to the cloud, the reply has a proper UDP checksum (
[udp sum ok]) 1, while the replies which contain the correct IP address do not have a UDP checksum ([no cksum]). That is suspicious, because it is not trivial to generate a checksum-less UDP packet on most OSes (and quad9 just runs standard DNS software AFAIK).This checksum aspect is a hint at something fishy going on in the SDN of OpenStack itself, hence we dig into the generated OpenFlow rules on the hypervisor. We eventually2 find this rule (linebreaks added for readability):
That rule matches on UDP packets to port 533 and then sends them to the controller for further processing.
Initially, I thought that the controller was neutron-ovn-agent, but that was incorrect. After a lot of digging around the neutron code, I eventually found that neutron just inserts DNS records into the northdb, via:
The actual DNS parsing and responding is handled by OVN. When the
controller(..)action is invoked, the OVN controller kicks in and handles the packet. The code for that can be found here: https://github.com/ovn-org/ovn/blob/42ef6e3760cc5bd662e9370310e4ebeaaf948ac5/controller/pinctrl.c#L3264This then, if the action in the userdata (the first four bytes) matches 0x6 (=
ACTION_OPCODE_DNS_LOOKUP), calls intopinctrl_handle_dns_lookup: https://github.com/ovn-org/ovn/blob/42ef6e3760cc5bd662e9370310e4ebeaaf948ac5/controller/pinctrl.c#L2986-L3260There, the DB lookup for matching DNS records happens and the forged response packet is constructed, if necessary.
Footnotes
Don't mind the
[bad udp chksum]on the outbound packets. UDP checksum generation happens after the point where tcpdump hooks. ↩After going through a couple hundred of lines of openflow and running the openflow engine on brain wetware, cannot recommend that. ↩
Note that to reach this rule, a bunch of preconditions need to be satisfied, such as that the packet must originate from the VMs port. This will thus not affect queries sent to a DNS server running in a VM, for example. ↩
horazont commentedon Apr 19, 2024
We should probably talk about the fact that this exposes a daemon which
directly to traffic sent by customer VMs.
markus-hentsch commentedon Apr 19, 2024
Adding to #229 (comment) after validating a few more things:
In OVN setups:
dns,dns_domain_portsor related extensions1 (such assubnet_dns_publish_fixed_ip,dns-integration-domain-keywordsetc.) are enabled in the Neutron configuration, then DNS interception flows are configured in OVNovn-nbctl list DNSdoes not list any recordsIn OVS setups:
I tried figuring out how this works in OVS-based setups. However, it does not seem easy to figure out whether the OVS configuration of Neutron is actually supposed to even support the internal DNS resolution.
A page about OpenStack deployment using Juju Charms2 states:
... and the paragraph in question says:
That kind of suggests that OVS might not support this but it is not clearly stated anywhere.
I redeployed my DevStack with OVS and so far wasn't able to get internal DNS resolution working. The
/etc/resolv.confentries in VMs now also point to the DHCP agent directly. It seems that in any case with OVS no such interception like with OVN will happen.Update to OVS (2024-04-22):
--dns-nameserverson a subnet in an OVS-based setup, the/etc/resolv.confentry will specify that nameserver; in any other case, the IP address of the DHCP agent will be inserted there instead--dns-nameserversis not used and the DHCP agent acts as the DNS server, it can resolve other VMs in the same subnet, however in contrast to OVN-based setups, this will not automatically include the human-readable VM name as DNS record but only the IP address3 in form ofhost-10-1-0-22.openstacklocalfor exampleresolv.confif no--dns-nameserverwas specified.resolv.confalways refers to genuine DNS server(s) (likely external) as perdns_serverssetting ofml2_conf.iniunder the[ovn]section.--dns-nameserverwas not used.host-10-1-0-22.openstacklocal.my-server.openstacklocal.Footnotes
note: extensions often supersede each other and include all functionality of the ones that they are replacing, see https://docs.openstack.org/designate/latest/user/neutron-integration.html#subnet-dns-publish-fixed-ip ↩
https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/yoga/app-ovn.html ↩
https://specs.openstack.org/openstack/charm-specs/specs/pike/implemented/internal-dns.html#problem-description ↩
markus-hentsch commentedon Apr 23, 2024
Practical implementation of External DNS / Designate
After
Details
... adding Designate to DevStack (click to expand)
Add to
neutron.conf(replace$HOST_IPaccording toopenstack endpoint list):I was able to verify the behavior of the
dns_domain_portsextension according to use cases 1 and 2 1 as well as Designate (use case 3):Case 1: DNS record through Floating IP assignment and network/port DNS settings
Use case:
dns-domain-portsNeutron extension enabled or any of the superseding ones (seeopenstack extension list --network)dns_domainset accordingly for either tenant network or VM port directlyExample:
Case 2: Direct DNS record for Floating IP
dns-domain-portsNeutron extension enabled or any of the superseding ones (seeopenstack extension list --network)dns_domainset accordingly during floating ip creationExample:
Case 3: DNS records for fixed IPs
Case 3a: static records using the
subnet-dns-publish-fixed-ipextensionNOTE: This works independently of whether the network/subnet actually is externally reachable. This is not verified by Neutron in contrast to case 3b!
subnet-dns-publish-fixed-ipNeutron extension enabled ordns-integration-domain-keywordswhich supersedes itdns-domain-portsis insufficient as it does not include this feature!dns_domainset accordingly during port creationExample:
This also works for servers instead of ports, if the
dns_domainis set on the network directly instead, which will propagate to all ports created within automatically:Example:
Case 3b: automatic records for externally reachable fixed IPs using
dns_domain_portsextensionNOTE: In contrast to case 3a this does not require the
subnet-dns-publish-fixed-ipextension or any of its successors. However, Neutron will only apply this case to fixed IPs in networks that are detected as external (see the expandable spoiler below;router:external=ExternalDOES NOT count)!dns-domain-portsNeutron extension enabled or any of the superseding ones (seeopenstack extension list --network)dns_domainset accordingly during port creation by the tenantWhat is considered "externally reachable"? (click to expand)
The decision whether a network counts as externally reachable (as per the upstream documentation) is the inverse of the following implementation: neutron/plugins/ml2/extensions/dns_integration.py#L382-L405Note that networks with
router:external=Externalexplicitly do not count as externally reachable in this context!Annotated version:
Example:
Summary
The two major extension driver choices compared:
dns_domain_portssubnet_dns_publish_fixed_ip(or any superseding one)dns_publish_fixed_ipattribute for subnets to trigger behavior.Footnotes
https://docs.openstack.org/neutron/2023.2/admin/config-dns-int-ext-serv.html#configuring-openstack-networking-for-integration-with-an-external-dns-service ↩
https://docs.openstack.org/designate/latest/user/neutron-integration.html#dns-domain-ports ↩
markus-hentsch commentedon Apr 24, 2024
Worth noting: [OVN] DNS resolution not forwarded with OVN driver
TL;DR: According to the bug report, in OVN setups VMs that have no connectivity to the outside DNS servers will also not receive local DNS responses for internal DNS or Designate (since no DNS traffic passes OVN that it can intercept and manipulate). This is different from OVS where the DHCP agent was always available as a local DNS target regardless of whether the VM actually had external connectivity.
markus-hentsch commentedon Apr 25, 2024
DNS extension hierarchy in Neutron
Important learning after debugging the problem that I could not reproduce the
subnet-dns-publish-fixed-ipbehavior1 as documented upstream:There is a hierarchy of DNS extensions for ML2 in Neutron2 in which they supersede one another in terms of functionality:
ml2_conf.ini'sextension_drivers=list) is calleddns_domain_keywords(without the "integration" part!)To get the
subnet-dns-publish-fixed-ipfunctionality, either subnet-dns-publish-fixed-ip or dns-integration-domain-keywords (which includes the former) must be activated.Bug in Neutron?
However, the documentation1 only states:
In a section further above it illustrates an example how to check enabled extensions:
If that is done for the subnet-dns-publish-fixed-ip extension, the extension name "subnet-dns-publish-fixed-ip" is returned by the API even if only the
dns_domain_portsextension driver is active which does not offer the functionality at all. Any subnet created with the flag ends up withdns_publish_fixed_ipattribute set toNoneand the database table for the flag stays empty.Only after the entry in
/etc/neutron/plugins/ml2/ml2_conf.iniis adjusted to replace the extension driver by one that supports the feature:... the extension actually works.
This seems to be a bug in Neutron API since it communicates an extension as being active when it actually isn't?
To make matters worse, the documentation explicitly instructs the user to check the API extensions which will mislead them as it happened to me.
Note that API extensions as communicated by
openstack extension listare always written with dashes whereas the extension driver's names always use underscores.Footnotes
https://docs.openstack.org/designate/latest/user/neutron-integration.html#dns-for-neutron-ports ↩ ↩2
https://docs.openstack.org/designate/latest/user/neutron-integration.html#neutron-dns-extensions ↩
markus-hentsch commentedon Apr 25, 2024
After lots of trial-and-error I was able to reproduce all relevant use cases with Designate and updated #229 (comment) with all findings accordingly.
horazont commentedon Apr 26, 2024
Soo... always add
169.254.169.254or something to your dns nameservers, which would hopefully hit the default route?markus-hentsch commentedon Apr 26, 2024
I looked a bit more into the unexpected behavior mentioned in #229 (comment) and filed a bug in Neutron: https://bugs.launchpad.net/neutron/+bug/2063669
markus-hentsch commentedon Apr 26, 2024
I both reproduced the "bug" as well as verified your suggestion (which seems to work!):
Offline network with default nameserver (OVN)
ping server-2.openstackgate.localdoes not work from server1 via VNC console (/etc/resolv.confcontainsnameserver 8.8.8.8as per Neutron's default). This confirms https://bugs.launchpad.net/neutron/+bug/1902950Offline network with 169.254.169.254 nameserver (OVN)
Re-using the above:
openstack server delete server-1 openstack server delete server-2 openstack subnet set --dns-nameserver 169.254.169.254 offline-subnet openstack server create --network offline ... server-1 openstack server create --network offline ... server-2 openstack console url show server-1Neutron-internal name resolution and
ping server-2.openstackgate.localfrom server-1 now works!markus-hentsch commentedon Apr 29, 2024
I concluded the standard draft in SovereignCloudStack/standards#570 and added a test script.
markus-hentsch commentedon Sep 27, 2024
On 2024-09-23 the current guidelines of the standard were discussed with CSP representatives (artcodix, plusserver, among others) in the Lean SCS Operator Coffee.
Below is a summary of the discussion points that I noted down:
Unfortunately, this does not seem to leave a whole lot of options for the standard to include anything more than a few SHOULDs right now.