Bug 914759 - nova-dhcpbridge does not support nova.conf and nova-dist.conf at the same time
Summary: nova-dhcpbridge does not support nova.conf and nova-dist.conf at the same time
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: snapshot4
: 2.1
Assignee: Brent Eagles
QA Contact: Kashyap Chamarthy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-22 17:08 UTC by Russell Bryant
Modified: 2022-07-09 06:11 UTC (History)
6 users (show)

Fixed In Version: openstack-nova-2012.2.3-2.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-21 18:16:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1131932 0 None None None Never
OpenStack gerrit 22746 0 None MERGED Change nova-dhcpbridge FLAGFILE to a list of files 2020-10-06 00:16:17 UTC
Red Hat Issue Tracker OSP-16361 0 None None None 2022-07-09 06:11:11 UTC
Red Hat Product Errata RHSA-2013:0657 0 normal SHIPPED_LIVE Moderate: openstack-nova security, bug fix, and enhancement update 2013-03-21 22:12:14 UTC

Description Russell Bryant 2013-02-22 17:08:32 UTC
Description of problem:

The openstack-nova package was recently updated to have a nova-dist.conf file that includes distribution default values for configuration options.  Nova services read both /etc/nova/nova.conf and /usr/share/nova/nova-dist.conf.

Nova also includes a binary called nova-dhcpbridge.  This is executed by dnsmasq.  The configuration file that nova-dhcpbridge uses is passed to it via an environment variable.  The environment variable is populated with the value of the dhcpbridge_flagfile nova configuration option.  The problem is that only one configuration file can be specified in this option.  We need to support two.

My thoughts on fixing this ...

1) Convert the dhcpbridge_flagfile option to a MultiStrOpt, which allows a list of values.

2) Update our nova-dist.conf to set this option with both /usr/share/nova/nova-dist.conf and /etc/nova/nova.conf.

3) Update bin/nova-dhcpbridge to be able to handle receiving multiple configuration files in the FLAGFILE env var.

Comment 1 Russell Bryant 2013-02-22 17:10:26 UTC
I think the code changes (not the nova-dist.conf update) make sense to submit for master upstream.  It probably won't make sense to backport to stable/folsom upstream, so we'll have to carry it as a patch.

Comment 6 Kashyap Chamarthy 2013-03-20 07:18:47 UTC
VERIFIED.


1] Version info:
#-------------#
$ cat /etc/redhat-release ; arch
Red Hat Enterprise Linux Server release 6.4 (Santiago)
x86_64
#-------------#


Verification info:
=================

2] grep the nova-dist.conf file, it's updated with both the values used by dhcpbridge_flagfile ( because now, it's converted to use a MultiStrOpt, so it takes multiple values)

#-------------#
$ sudo grep dhcpbridge_flagfile /usr/share/nova/nova-dist.conf 
dhcpbridge_flagfile = /usr/share/nova/nova-dist.conf
dhcpbridge_flagfile = /etc/nova/nova.conf
#-------------#


3] Relevant code fragment from the patch referenced.

3.1] For the MultiStrOpt:
#-------------#
.
.
    cfg.MultiStrOpt('dhcpbridge_flagfile',
               default='[/etc/nova/nova-dhcpbridge.conf]',
               help='location of flagfile for dhcpbridge'),
.
.
#-------------#

3.2] bin/nova-dhcpbridge indicating the ability to take multiple values via flagfile env var:
#-------------#
.
.
    """Parse environment and arguments and call the approproate action."""
    flagfile = os.environ.get('FLAGFILE', FLAGS.dhcpbridge_flagfile)
    argv = flags.parse_args(sys.argv,
        default_config_files=jsonutils.loads(flagfile))
    logging.setup("nova")

    if int(os.environ.get('TESTING', '0')):
#-------------#


4] Evidence of dnsmasq executing nova-dhcpbridge:
#-------------#
$ ps -ef | grep -i nova-dhcpbridge
nobody   25857     1  0 Feb13 ?        00:01:32 /usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file= --domain=novalocal --pid-file=/var/lib/nova/networks/nova-demonetbr0.pid --listen-address=10.65.207.49 --except-interface=lo --dhcp-range=set:'net1',10.65.207.50,static,120s --dhcp-lease-max=16 --dhcp-hostsfile=/var/lib/nova/networks/nova-demonetbr0.conf --dhcp-script=/usr/bin/nova-dhcpbridge --leasefile-ro
root     25858 25857  0 Feb13 ?        00:01:04 /usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file= --domain=novalocal --pid-file=/var/lib/nova/networks/nova-demonetbr0.pid --listen-address=10.65.207.49 --except-interface=lo --dhcp-range=set:'net1',10.65.207.50,static,120s --dhcp-lease-max=16 --dhcp-hostsfile=/var/lib/nova/networks/nova-demonetbr0.conf --dhcp-script=/usr/bin/nova-dhcpbridge --leasefile-ro
tuser1   63550 78910  0 12:44 pts/6    00:00:00 grep -i nova-dhcpbridge
#-------------#

Comment 8 errata-xmlrpc 2013-03-21 18:16:52 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2013-0657.html


Note You need to log in before you can comment on or make changes to this bug.