Bug 2068489

Summary: THT parameter DnsServers is being overwritten by neutron inventory data
Product: Red Hat OpenStack Reporter: James Parker <jparker>
Component: openstack-tripleo-heat-templatesAssignee: Harald Jensås <hjensas>
Status: CLOSED ERRATA QA Contact: Joe H. Rahme <jhakimra>
Severity: urgent Docs Contact:
Priority: high    
Version: 17.0 (Wallaby)CC: drosenfe, hjensas, igallagh, jamsmith, jparoly, jpretori, jschluet, lbezdick, mburns, morazi, oblaut, pweeks, ramishra, rdiazcam, sbaker
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-14.3.1-0.20220617150351.66bbda8.el9ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2081120 (view as bug list) Environment:
Last Closed: 2022-09-21 12:19:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2081120    

Description James Parker 2022-03-25 13:44:45 UTC
Description of problem:
The THT parameter DnsServers is being overwritten by neutron inventory data.  When the parameter is supplied it is correctly set in the deployments group_vars:

(undercloud) [stack@undercloud-0 ~]$ grep -R -A 1 ctlplane_dns_nameservers ~/overcloud-deploy/overcloud/config-download/overcloud/group_vars/
/home/stack/overcloud-deploy/overcloud/config-download/overcloud/group_vars/ComputeSriov:ctlplane_dns_nameservers:
/home/stack/overcloud-deploy/overcloud/config-download/overcloud/group_vars/ComputeSriov-- 10.0.0.1
--
/home/stack/overcloud-deploy/overcloud/config-download/overcloud/group_vars/Controller:ctlplane_dns_nameservers:
/home/stack/overcloud-deploy/overcloud/config-download/overcloud/group_vars/Controller-- 10.0.0.1

But the deployment uses the value generated by neutron data. If a value in undercloud.conf is not supplied it will result in nothing being configured in the respective role's resolv.conf.

(undercloud) [stack@undercloud-0 ~]$ grep -R ctlplane_dns_nameservers ~/overcloud-deploy/overcloud/config-download/overcloud/tripleo-ansible-inventory.yaml
    ctlplane_dns_nameservers: &id001 []
    ctlplane_dns_nameservers: *id001

Version-Release number of selected component (if applicable):
17

How reproducible:
100%

Steps to Reproduce:
1. Deploy environment using DnsServer THT parameter as mechanism for setting up DNS servers to use for deployment
2.
3.

Actual results:
Deployment will not configure a DNS Server and will fail overcloud deployment if any step requires communication with an external service that requires DNS resolution e.g. an NTP server.

Expected results:
Parameter should either be deprecated and Docs updated accordingly or deployment should honor the parameter.

Additional info:

Comment 1 Harald Jensås 2022-03-25 15:37:39 UTC
We have used the dns_nameservers from the subnets for a long time by default:
https://review.opendev.org/c/openstack/tripleo-heat-templates/+/579582

It has been possible to override with DnsServers in THT parameters, but ideally the 'DEFAULT/undercloud_nameservers' or '%SUBNET_SECTION%/dns_nameservers' options in undercloud.conf should be used to define the DNS servers.

Since network config is applied during node provisioning, prior to creating a heat stack we cannot use the DnsServers parameter in 17.


I have proposed two patches upstream to deprecate and remove the parameter.

https://review.opendev.org/835247 - Deprecate DnsServers THT parameter
https://review.opendev.org/835248 - Remove DnsServers THT parameter


We also need to document this in OSP17 docs.

Comment 2 Brendan Shephard 2022-04-13 09:57:10 UTC
*** Bug 2074815 has been marked as a duplicate of this bug. ***

Comment 3 Ricardo Diaz 2022-04-18 09:04:44 UTC
Configure '%SUBNET_SECTION%/dns_nameservers' option in undercloud.conf works for me:

...

[mysubnet-subnet]

...
# DNS nameservers for the Neutron-managed subnet for the Overcloud
# instances on this network. If no nameservers are defined for the
# subnet, the nameservers defined for undercloud_nameservers will be
# used. (list value)
dns_nameservers = <NAMESERVER_1>,<NAMESERVER_2>
...

As a result:

[user@compute-0 ~]$ cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
# Generated by NetworkManager
nameserver NAMESERVER_1
nameserver NAMESERVER_2

Comment 8 Yaniv Kaul 2022-06-02 09:10:57 UTC
This is an urgent/high BZ. One patch (upstream) is merged, the other (https://review.opendev.org/c/openstack/tripleo-heat-templates/+/835248/) did not have any (visible) activity for a while. What's the next step here?

TIA,
Y.

Comment 9 Harald Jensås 2022-06-02 09:55:25 UTC
(In reply to Yaniv Kaul from comment #8)
> This is an urgent/high BZ. One patch (upstream) is merged, the other
> (https://review.opendev.org/c/openstack/tripleo-heat-templates/+/835248/)
> did not have any (visible) activity for a while. What's the next step here?
> 

I think this being urgent is misleading. This bugzilla is tracking the THT change, which I don see as urgent.
It looks like consensus upstream is not to backport the second patch to Wallaby (OSP-17).

I have proposed the Wallaby backport for the patch deprecating the DnsServers THT parameter.

It is urgent that the documentation change (see comment #7) is completed.

@igallagh - https://issues.redhat.com/browse/RHOSPDOC-933 is the doc issue, reach out if you have questions. Thanks!

Comment 10 Harald Jensås 2022-06-21 20:35:08 UTC
Moving this to modified.
The change[1] to deprecate the option has been backported.
The change[2] to remove the option has negative feedback in upstream reviews as a backport candidate. I.e the option won't be removed before OSP18.

We have a documentation bug[3] filed to ensure the needful is documented.

[1] https://review.opendev.org/c/openstack/tripleo-heat-templates/+/844383
[2] https://review.opendev.org/c/openstack/tripleo-heat-templates/+/835248
[3] https://issues.redhat.com/browse/RHOSPDOC-933

Comment 19 errata-xmlrpc 2022-09-21 12:19:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543

Comment 20 Red Hat Bugzilla 2023-12-16 04:25:06 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days