Skip to content

Commit

Permalink
QuantumManager will start dnsmasq during startup. Fixes bug 977759
Browse files Browse the repository at this point in the history
Added _setup_network_on_host method, which calls update_dhcp
if quantum_use_dhcp is set.

Change-Id: I193212037873001a03da7b7a484f61a5c13b5de8
  • Loading branch information
Mandar Vaze authored and GheRivero committed May 10, 2012
1 parent 1209af4 commit 26dc6b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -122,6 +122,7 @@ Likitha Shetty <likitha.shetty@citrix.com>
Loganathan Parthipan <parthipan@hp.com>
Lorin Hochstein <lorin@nimbisservices.com>
Lvov Maxim <usrleon@gmail.com>
Mandar Vaze <mandar.vaze@vertex.co.in>
Mandell Degerness <mdegerne@gmail.com>
Mark McClain <mark.mcclain@dreamhost.com>
Mark McLoughlin <markmc@redhat.com>
Expand Down
17 changes: 17 additions & 0 deletions nova/network/quantum/manager.py
Expand Up @@ -88,6 +88,7 @@ def __init__(self, q_conn=None, ipam_lib=None, *args, **kwargs):
def init_host(self):
# Initialize general L3 networking
self.l3driver.initialize()
super(QuantumManager, self).init_host()
# Initialize floating ip support (only works for nova ipam currently)
if FLAGS.quantum_ipam_lib == 'nova.network.quantum.nova_ipam_lib':
LOG.debug("Initializing FloatingIP support")
Expand All @@ -107,6 +108,22 @@ def init_host(self):
for c in cidrs:
self.l3driver.initialize_network(c)

# Similar to FlatDHCPMananger, except we check for quantum_use_dhcp flag
# before we try to update_dhcp
def _setup_network_on_host(self, context, network):
"""Sets up network on this host."""
network['dhcp_server'] = self._get_dhcp_ip(context, network)
self.l3driver.initialize_gateway(network)

if FLAGS.quantum_use_dhcp and not FLAGS.fake_network:
dev = self.driver.get_dev(network)
self.driver.update_dhcp(context, dev, network)
if FLAGS.use_ipv6:
self.driver.update_ra(context, dev, network)
gateway = utils.get_my_linklocal(dev)
self.db.network_update(context, network['id'],
{'gateway_v6': gateway})

def _update_network_host(self, context, net_uuid):
"""Set the host column in the networks table: note that this won't
work with multi-host but QuantumManager doesn't support that
Expand Down

0 comments on commit 26dc6b7

Please sign in to comment.