← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1902036] [NEW] resolv.conf is getting updated for RHEL

 

Public bug reported:

I am using an RHEL8.3 with cloud init v19.4 , where I see the [1] are not getting updated after we capture a VM and deploy it.
For an example,

The Base VM has [1] as

[root@imrandemo4 ~]# cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
nameserver 9.0.128.50
nameserver 9.12.16.2

Deployed VM has [1] as

[root@aman ~]# cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
nameserver 9.0.128.50
nameserver 9.12.16.2
nameserver 8.8.8.8

In the deployed VM's configDrive, network_data.json has

[root@aman latest]# python3 -c 'import sys, json; print(json.dumps(json.load(open(sys.argv[1])), indent=4) )' network_data.json
{
    "services": [
        {
            "type": "dns",
            "address": "8.8.8.8"
        },
        {
            "type": "dns",
            "address": "4.4.4.4"
        }
    ],
    "networks": [
        {
            "network_id": "ff77b312-9752-4b94-81cd-0f4ac63247fb",
            "type": "ipv4",
            "services": [
                {
                    "type": "dns",
                    "address": "8.8.8.8"
                },
                {
                    "type": "dns",
                    "address": "4.4.4.4"
                }
            ],
            "netmask": "255.255.240.0",
            "link": "tap149aaec7-aa",
            "routes": [
                {
                    "netmask": "0.0.0.0",
                    "network": "0.0.0.0",
                    "gateway": "x.x.x.x"
                }
            ],
            "ip_address": "xx.xx.xx.xx",
            "id": "network0"
        },
        {
            "network_id": "mgmt",
            "type": "ipv6",
            "services": [],
            "netmask": "ffff:ffff:ffff:ffff::",
            "link": "interface1",
            "routes": [],
            "ip_address": "fe80::f006:69ff:fed5:57cc",
            "id": "network1"
        }
    ],
    "links": [
        {
            "ethernet_mac_address": "fa:63:71:ea:cc:20",
            "mtu": 1500,
            "type": "vif",
            "id": "tap149aaec7-aa",
            "vif_id": "149aaec7-aa24-433b-8f68-767f3e3badc2"
        },
        {
            "ethernet_mac_address": "f2:06:69:d5:57:cc",
            "mtu": null,
            "type": "vif",
            "id": "interface1",
            "vif_id": "mgmt_vif"
        }
    ]
}

Ideally the Base VM DNS must be cleaned and updated with the new DNS
passed as network_data.json.

[1] /etc/resolv.conf

** Affects: cloud-init
     Importance: Undecided
         Status: New

** Attachment added: "clod-init logs"
   https://bugs.launchpad.net/bugs/1902036/+attachment/5428955/+files/cloud-init.tar.gz

** Description changed:

  I am using an RHEL8.3 with cloud init v19.4 , where I see the [1] are not getting updated after we capture a VM and deploy it.
  For an example,
  
  The Base VM has [1] as
  
  [root@imrandemo4 ~]# cat /etc/resolv.conf
  ; Created by cloud-init on instance boot automatically, do not edit.
  ;
  nameserver 9.0.128.50
  nameserver 9.12.16.2
  
  Deployed VM has [1] as
  
- [root@powervc-aman ~]# cat /etc/resolv.conf
+ [root@aman ~]# cat /etc/resolv.conf
  ; Created by cloud-init on instance boot automatically, do not edit.
  ;
  nameserver 9.0.128.50
  nameserver 9.12.16.2
  nameserver 8.8.8.8
  
- 
  In the deployed VM's configDrive, network_data.json has
  
  [root@aman latest]# python3 -c 'import sys, json; print(json.dumps(json.load(open(sys.argv[1])), indent=4) )' network_data.json
  {
-     "services": [
-         {
-             "type": "dns",
-             "address": "8.8.8.8"
-         },
-         {
-             "type": "dns",
-             "address": "4.4.4.4"
-         }
-     ],
-     "networks": [
-         {
-             "network_id": "ff77b312-9752-4b94-81cd-0f4ac63247fb",
-             "type": "ipv4",
-             "services": [
-                 {
-                     "type": "dns",
-                     "address": "8.8.8.8"
-                 },
-                 {
-                     "type": "dns",
-                     "address": "4.4.4.4"
-                 }
-             ],
-             "netmask": "255.255.240.0",
-             "link": "tap149aaec7-aa",
-             "routes": [
-                 {
-                     "netmask": "0.0.0.0",
-                     "network": "0.0.0.0",
-                     "gateway": "x.x.x.x"
-                 }
-             ],
-             "ip_address": "xx.xx.xx.xx",
-             "id": "network0"
-         },
-         {
-             "network_id": "mgmt",
-             "type": "ipv6",
-             "services": [],
-             "netmask": "ffff:ffff:ffff:ffff::",
-             "link": "interface1",
-             "routes": [],
-             "ip_address": "fe80::f006:69ff:fed5:57cc",
-             "id": "network1"
-         }
-     ],
-     "links": [
-         {
-             "ethernet_mac_address": "fa:63:71:ea:cc:20",
-             "mtu": 1500,
-             "type": "vif",
-             "id": "tap149aaec7-aa",
-             "vif_id": "149aaec7-aa24-433b-8f68-767f3e3badc2"
-         },
-         {
-             "ethernet_mac_address": "f2:06:69:d5:57:cc",
-             "mtu": null,
-             "type": "vif",
-             "id": "interface1",
-             "vif_id": "mgmt_vif"
-         }
-     ]
+     "services": [
+         {
+             "type": "dns",
+             "address": "8.8.8.8"
+         },
+         {
+             "type": "dns",
+             "address": "4.4.4.4"
+         }
+     ],
+     "networks": [
+         {
+             "network_id": "ff77b312-9752-4b94-81cd-0f4ac63247fb",
+             "type": "ipv4",
+             "services": [
+                 {
+                     "type": "dns",
+                     "address": "8.8.8.8"
+                 },
+                 {
+                     "type": "dns",
+                     "address": "4.4.4.4"
+                 }
+             ],
+             "netmask": "255.255.240.0",
+             "link": "tap149aaec7-aa",
+             "routes": [
+                 {
+                     "netmask": "0.0.0.0",
+                     "network": "0.0.0.0",
+                     "gateway": "x.x.x.x"
+                 }
+             ],
+             "ip_address": "xx.xx.xx.xx",
+             "id": "network0"
+         },
+         {
+             "network_id": "mgmt",
+             "type": "ipv6",
+             "services": [],
+             "netmask": "ffff:ffff:ffff:ffff::",
+             "link": "interface1",
+             "routes": [],
+             "ip_address": "fe80::f006:69ff:fed5:57cc",
+             "id": "network1"
+         }
+     ],
+     "links": [
+         {
+             "ethernet_mac_address": "fa:63:71:ea:cc:20",
+             "mtu": 1500,
+             "type": "vif",
+             "id": "tap149aaec7-aa",
+             "vif_id": "149aaec7-aa24-433b-8f68-767f3e3badc2"
+         },
+         {
+             "ethernet_mac_address": "f2:06:69:d5:57:cc",
+             "mtu": null,
+             "type": "vif",
+             "id": "interface1",
+             "vif_id": "mgmt_vif"
+         }
+     ]
  }
- 
  
  Ideally the Base VM DNS must be cleaned and updated with the new DNS
  passed as network_data.json.
  
  [1] /etc/resolv.conf

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1902036

Title:
  resolv.conf is getting updated for RHEL

Status in cloud-init:
  New

Bug description:
  I am using an RHEL8.3 with cloud init v19.4 , where I see the [1] are not getting updated after we capture a VM and deploy it.
  For an example,

  The Base VM has [1] as

  [root@imrandemo4 ~]# cat /etc/resolv.conf
  ; Created by cloud-init on instance boot automatically, do not edit.
  ;
  nameserver 9.0.128.50
  nameserver 9.12.16.2

  Deployed VM has [1] as

  [root@aman ~]# cat /etc/resolv.conf
  ; Created by cloud-init on instance boot automatically, do not edit.
  ;
  nameserver 9.0.128.50
  nameserver 9.12.16.2
  nameserver 8.8.8.8

  In the deployed VM's configDrive, network_data.json has

  [root@aman latest]# python3 -c 'import sys, json; print(json.dumps(json.load(open(sys.argv[1])), indent=4) )' network_data.json
  {
      "services": [
          {
              "type": "dns",
              "address": "8.8.8.8"
          },
          {
              "type": "dns",
              "address": "4.4.4.4"
          }
      ],
      "networks": [
          {
              "network_id": "ff77b312-9752-4b94-81cd-0f4ac63247fb",
              "type": "ipv4",
              "services": [
                  {
                      "type": "dns",
                      "address": "8.8.8.8"
                  },
                  {
                      "type": "dns",
                      "address": "4.4.4.4"
                  }
              ],
              "netmask": "255.255.240.0",
              "link": "tap149aaec7-aa",
              "routes": [
                  {
                      "netmask": "0.0.0.0",
                      "network": "0.0.0.0",
                      "gateway": "x.x.x.x"
                  }
              ],
              "ip_address": "xx.xx.xx.xx",
              "id": "network0"
          },
          {
              "network_id": "mgmt",
              "type": "ipv6",
              "services": [],
              "netmask": "ffff:ffff:ffff:ffff::",
              "link": "interface1",
              "routes": [],
              "ip_address": "fe80::f006:69ff:fed5:57cc",
              "id": "network1"
          }
      ],
      "links": [
          {
              "ethernet_mac_address": "fa:63:71:ea:cc:20",
              "mtu": 1500,
              "type": "vif",
              "id": "tap149aaec7-aa",
              "vif_id": "149aaec7-aa24-433b-8f68-767f3e3badc2"
          },
          {
              "ethernet_mac_address": "f2:06:69:d5:57:cc",
              "mtu": null,
              "type": "vif",
              "id": "interface1",
              "vif_id": "mgmt_vif"
          }
      ]
  }

  Ideally the Base VM DNS must be cleaned and updated with the new DNS
  passed as network_data.json.

  [1] /etc/resolv.conf

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1902036/+subscriptions