Public bug reported:

I have multiple network interfaces in OpenStack. Each defines 2
resolvers. This goes over 3 resolvers and on RHEL that leads to the
following traceback:

Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Read 140 bytes from /etc/resolv.conf
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[WARNING]: failed stage init-local
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 2016-09-06 13:26:03,786 - 
util.py[WARNING]: failed stage init-local
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: failed stage init-local
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: failed run of stage 
init-local
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
------------------------------------------------------------
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: Traceback (most recent 
call last):
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/cmd/main.py",
 line 530, in status_wrapper
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: ret = functor(name, args)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/cmd/main.py",
 line 277, in main_init
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/stages.py",
 line 652, in apply_network_config
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: return 
self.distro.apply_network_config(netcfg, bring_up=bring_up)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/__init__.py",
 line 162, in apply_network_config
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: dev_names = 
self._write_network_config(netconfig)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/rhel.py",
 line 71, in _write_network_config
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
self._net_renderer.render_network_state("/", ns)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/net/sysconfig.py",
 line 395, in render_network_state
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: existing_dns_path=dns_path)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/net/sysconfig.py",
 line 338, in _render_dns
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
content.add_nameserver(nameserver)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/parsers/resolv_conf.py",
 line 96, in add_nameserver
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: "'3' maximum name 
servers") % (ns))
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: ValueError: Adding 
u'172.17.48.4' would go beyond the '3' maximum name servers
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
------------------------------------------------------------
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Read 10 bytes from /proc/uptime
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: cloud-init mode 'init' took 0.509 seconds (0.51)
Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources
Sep 06 13:26:03 testing02.novalocal systemd[1]: cloud-init-local.service: main 
process exited, code=exited, status=1/FAILURE
Sep 06 13:26:03 testing02.novalocal systemd[1]: Failed to start Initial 
cloud-init job (pre-networking).
Sep 06 13:26:03 testing02.novalocal systemd[1]: Unit cloud-init-local.service 
entered failed state.
Sep 06 13:26:03 testing02.novalocal systemd[1]: cloud-init-local.service failed.

On Ubuntu the name servers are added to /etc/network/interfaces.d/50
-cloud-init.cfg and resolvconf deals with setting the appropriate
amount.

I believe that instead of raising a ValueError it should instead just
accept the first three it receives. There is currently not a change I
can make in my cloud to limit the amount of resolvers sent down because
not all VM's are on both networks, and having a minimal of two DNS
servers is still best practice.

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


** Tags: centos rhel

-- 
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/1620796

Title:
  Don't fail if attempting to add more resolvers

Status in cloud-init:
  New

Bug description:
  I have multiple network interfaces in OpenStack. Each defines 2
  resolvers. This goes over 3 resolvers and on RHEL that leads to the
  following traceback:

  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Read 140 bytes from /etc/resolv.conf
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[WARNING]: failed stage init-local
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 2016-09-06 13:26:03,786 
- util.py[WARNING]: failed stage init-local
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: failed stage init-local
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: failed run of stage 
init-local
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
------------------------------------------------------------
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: Traceback (most recent 
call last):
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/cmd/main.py",
 line 530, in status_wrapper
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: ret = functor(name, args)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/cmd/main.py",
 line 277, in main_init
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/stages.py",
 line 652, in apply_network_config
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: return 
self.distro.apply_network_config(netcfg, bring_up=bring_up)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/__init__.py",
 line 162, in apply_network_config
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: dev_names = 
self._write_network_config(netconfig)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/rhel.py",
 line 71, in _write_network_config
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
self._net_renderer.render_network_state("/", ns)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/net/sysconfig.py",
 line 395, in render_network_state
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
existing_dns_path=dns_path)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/net/sysconfig.py",
 line 338, in _render_dns
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
content.add_nameserver(nameserver)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: File 
"/usr/lib/python2.7/site-packages/cloud_init-0.7.7-py2.7.egg/cloudinit/distros/parsers/resolv_conf.py",
 line 96, in add_nameserver
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: "'3' maximum name 
servers") % (ns))
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: ValueError: Adding 
u'172.17.48.4' would go beyond the '3' maximum name servers
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: 
------------------------------------------------------------
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: Read 10 bytes from /proc/uptime
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
util.py[DEBUG]: cloud-init mode 'init' took 0.509 seconds (0.51)
  Sep 06 13:26:03 testing02.novalocal cloud-init[362]: [CLOUDINIT] 
handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources
  Sep 06 13:26:03 testing02.novalocal systemd[1]: cloud-init-local.service: 
main process exited, code=exited, status=1/FAILURE
  Sep 06 13:26:03 testing02.novalocal systemd[1]: Failed to start Initial 
cloud-init job (pre-networking).
  Sep 06 13:26:03 testing02.novalocal systemd[1]: Unit cloud-init-local.service 
entered failed state.
  Sep 06 13:26:03 testing02.novalocal systemd[1]: cloud-init-local.service 
failed.

  On Ubuntu the name servers are added to /etc/network/interfaces.d/50
  -cloud-init.cfg and resolvconf deals with setting the appropriate
  amount.

  I believe that instead of raising a ValueError it should instead just
  accept the first three it receives. There is currently not a change I
  can make in my cloud to limit the amount of resolvers sent down
  because not all VM's are on both networks, and having a minimal of two
  DNS servers is still best practice.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to