Wrong DNS Servers in /etc/resolv.conf

Bug #1773197 reported by Anda Nicolae on 2018-05-24
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.1
Fix Committed
High
Ananth Suryanarayana
R5.0
Fix Committed
High
Ananth Suryanarayana
Trunk
Fix Committed
High
Ananth Suryanarayana

Bug Description

Hi all,

I have a setup of 3 VMs: one OpenStack node, one Contrail controller node and 1 Contrail compute node.
All 3 VMs use RedHat 7.4. The 3 VMs run on an CentOS7 server.
I have installed Contrail R5.0 on my setup using contrail-ansible-deployer/.

I have created a new ipam, named "myipam", with the following parameters:
DNS Method: Tenant
Tenant DNS Server IPs: 8.8.8.8
Domain Name: google.com

Then, I have created a network, named "mynet", and a subnet inside "mynet" that uses "myipam", with DNS options checked.

In the DNS Server(s) section from mynet I have added 2 DNS servers: "1.1.1.1" and "2.2.2.2".

Afterwards, I have booted a VM in OpenStack, which uses "mynet". Then, I have run inside the VM:
cat /etc/resolv.conf
and it shows:
nameserver 8.8.8.8
search google.com

These are the settings from "myipam". Expected behavior was to use the settings from the DNS Server(s) section from mynet.

However, if I add only 1 server in the DNS Server(s) section from mynet (let this be "1.1.1.1") and then I reboot the VM, I have:
cat /etc/resolv.conf
nameserver 1.1.1.1
search google.com

Thanks,
Anda

Anda Nicolae (anicolae) on 2018-05-24
information type: Proprietary → Public
Jeba Paulaiyan (jebap) on 2018-06-01
tags: added: config
Yuvaraja Mariappan (ymariappan) wrote :

nameservers should be in /etc/resolv.conf is 1.1.1.1 2.2.2.2
since control node is not sending in the proper format[when more than dns servers are configured] ,agent discards it and uses ipams dnsservers info.

agent dhcp discard message:

018-07-18 07:41:35.786 DhcpError: VM 192.168.1.3 : Invalid DHCP option 6 data : 1.1.1.12.2.2.2is invalid controller/src/vnsw/agent/services/dhcp_handler.cc 1169

agent ifmaptable info:

type:virtual-network-network-ipam name:attr(default-domain:admin:myipam,default-domain:admin:mynet) value ipam-subnets subnet ip-prefix:192.168.1.0 ip-prefix-len:24 default-gateway:192.168.1.1 dns-server-address:192.168.1.2 subnet-uuid:de31d280-5d3d-4c1a-8bf8-489b7a110cec enable-dhcp:true addr_from_start:true dhcp-option-list dhcp-option dhcp-option-name:6 dhcp-option-value:1.1.1.12.2.2.2 subnet-name:de31d280-5d3d-4c1a-8bf8-489b7a110cec alloc-unit:1 created:1970-01-01T00:00:00 last-modified:1970-01-01T00:00:00 Adjacencies: virtual-network default-domain:admin:mynet network-ipam default-domain:admin:myipam

control node ifmaptable info:

<iq>
 <value>
  <ipam-subnets>
   <subnet>
    <ip-prefix>192.168.1.0</ip-prefix>
    <ip-prefix-len>24</ip-prefix-len>
   </subnet>
   <default-gateway>192.168.1.1</default-gateway>
   <dns-server-address>192.168.1.2</dns-server-address>
   <subnet-uuid>de31d280-5d3d-4c1a-8bf8-489b7a110cec</subnet-uuid>
   <enable-dhcp>true</enable-dhcp>
   <addr_from_start>true</addr_from_start>
   <dhcp-option-list>
    <dhcp-option>
     <dhcp-option-name>6</dhcp-option-name>
     <dhcp-option-value>1.1.1.12.2.2.2</dhcp-option-value>
     <dhcp-option-value-bytes></dhcp-option-value-bytes>
    </dhcp-option>
   </dhcp-option-list>
   <host-routes />
   <subnet-name>de31d280-5d3d-4c1a-8bf8-489b7a110cec</subnet-name>
   <alloc-unit>1</alloc-unit>
   <created>1970-01-01T00:00:00</created>
   <last-modified>1970-01-01T00:00:00</last-modified>
   <subscriber-tag></subscriber-tag>
  </ipam-subnets>
  <host-routes />
 </value>
</iq>

space should be there between dns-servers in dhcp-option-value

Yuvaraja Mariappan (ymariappan) wrote :

since it has to be fixed control node, reassigning to ananth.

Thanks,
Yuvaraja

Populated configuration format is incorrect, either by the provisioning scripts or by one of the config components that is storing in the db. Can you please have some one from the config team to look into this.

Thanks

Nagendra Prasath (npchandran) wrote :

From Config, DNS entries at dhcp option value looks good. Could you revisit and point us where do you see incorrect config param?

Attached Cassandra dump for your reference.

Cassandra:
 \"subnet_uuid\": \"1e6923d8-7cb1-46ca-b290-b0cd7ce8f19a\", \"dhcp_option_list\": {\"dhcp_option\": [{\"dhcp_option_value\": \"1.
1.1.1 2.2.2.2 3.3.3.3 4.4.4.4\", \"dhcp_option_name\": \"6\"}]},

Config Objects:
        "virtual_network_back_refs": [
            {
                "attr": {
                    "ipam_subnets": [
                        {
                            "addr_from_start": true,
                            "default_gateway": "20.20.20.1",
                            "dhcp_option_list": {
                                "dhcp_option": [
                                    {
                                        "dhcp_option_name": "6",
                                        "dhcp_option_value": "1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4"
                                    }
                                ]
                            },
                            "dns_server_address": "20.20.20.2",
                            "enable_dhcp": true,
                            "subnet": {
                                "ip_prefix": "20.20.20.0",
                                "ip_prefix_len": 24
                            },
                            "subnet_name": "1e6923d8-7cb1-46ca-b290-b0cd7ce8f19a",
                            "subnet_uuid": "1e6923d8-7cb1-46ca-b290-b0cd7ce8f19a"
                        }
                    ]
                },
                "href": "http://192.168.10.56:8082/virtual-network/9b117cd2-9d5a-451f-b47e-8716ebadfd96",
                "to": [
                    "default-domain",
                    "admin",
                    "test-vn2"
                ],
                "uuid": "9b117cd2-9d5a-451f-b47e-8716ebadfd96"
            }

Review in progress for https://review.opencontrail.org/44920
Submitter: Ananth Suryanarayana (<email address hidden>)

Review in progress for https://review.opencontrail.org/44921
Submitter: Ananth Suryanarayana (<email address hidden>)

Review in progress for https://review.opencontrail.org/44922
Submitter: Ananth Suryanarayana (<email address hidden>)

Reviewed: https://review.opencontrail.org/44922
Committed: http://github.com/Juniper/contrail-controller/commit/980fc51feef23abc62fed84a2ee730f44199e561
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 980fc51feef23abc62fed84a2ee730f44199e561
Author: Ananth Suryanarayana <email address hidden>
Date: Tue Jul 24 15:05:24 2018 -0700

Revert incorrect fix from https://review.opencontrail.org/#/c/35856/

There were two issues with the fix made before.

1. All spaces inside link attribute was erased, which is clearly incorrect.
2. JSON supports NULL already. We need to check for null and then set
the link attribute as an empty object if attr data turns out to be null.

Change-Id: I8cdf876196a709571ee4b763c19af7a0d81e85f8
Closes-Bug: 1773197

Reviewed: https://review.opencontrail.org/44920
Committed: http://github.com/Juniper/contrail-common/commit/78c037c10664c1408af7dba4100ba4f548c055ae
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 78c037c10664c1408af7dba4100ba4f548c055ae
Author: Ananth Suryanarayana <email address hidden>
Date: Tue Jul 24 14:58:48 2018 -0700

Revert incorrect fix from https://review.opencontrail.org/#/c/35856/

There were two issues with the fix made before.

1. All spaces inside link attribute was erased, which is clearly incorrect.
2. JSON supports NULL already. We need to check for null and then set
the link attribute as an empty object if attr data turns out to be null.

Change-Id: I8cdf876196a709571ee4b763c19af7a0d81e85f8
Closes-Bug: 1773197

Reviewed: https://review.opencontrail.org/44921
Committed: http://github.com/Juniper/contrail-common/commit/94477b5462c9e20556895585346362592ea2f3aa
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 94477b5462c9e20556895585346362592ea2f3aa
Author: Ananth Suryanarayana <email address hidden>
Date: Tue Jul 24 14:58:48 2018 -0700

Revert incorrect fix from https://review.opencontrail.org/#/c/35856/

There were two issues with the fix made before.

1. All spaces inside link attribute was erased, which is clearly incorrect.
2. JSON supports NULL already. We need to check for null and then set
the link attribute as an empty object if attr data turns out to be null.

Change-Id: I8cdf876196a709571ee4b763c19af7a0d81e85f8
Closes-Bug: 1773197

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments