Missing dns-nameservers in eth0 with config drive on openstack instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
Cloud Provider: OpenStack (Mitaka)
Distro: Ubuntu 16.04
Cloud-init version: 0.7.9 (cloud-init cfg is distro provider)
Other Info:
Nova Instance booted with Config Drive on a Neutron Network (without DHCP)
Problem:
when a nova instance is booted with config drive on a network with DHCP disabled, the global DNS servers passed in the network_data.json are not rendered to the eth0 interface in the /etc/network/
/etc/network/
auto lo
iface lo inet loopback
dns-nameservers 8.8.8.8
auto eth0
iface eth0 inet static
address 192.168.111.183
netmask 255.255.255.0
post-up route add default gw 192.168.111.1 || true
pre-down route del default gw 192.168.111.1 || true
instead, IMO, it should probably look like this:-
auto lo
iface lo inet loopback
dns-nameservers 8.8.8.8
auto eth0
iface eth0 inet static
address 192.168.111.183
dns-nameservers 8.8.8.8 // Notice this additional dns info in eth0
netmask 255.255.255.0
post-up route add default gw 192.168.111.1 || true
pre-down route del default gw 192.168.111.1 || true
I tried the fix in bug 1693265 i.e https:/
still didn't add the dns-nameservers in the eth0 of the ENI file.
Then, I tried a custom fix (attached nova.diff) to pass the dns_namesevers
in the "networks" value of the network_data.json and that seems to fix the problem for me.
At this point, I am not clear if this is a bug in Nova or Cloud-Init to render the dns servers in ENI file correctly. Please let me know if you need more info.
Affects me, too, on OpenStack Pike & cloud-init 17.2-35- gf576b2a2- 0ubuntu1~ 16.04.2.