diff options
author | Alexander Sakhnov <asakhnov@mirantis.com> | 2011-07-12 17:25:42 +0400 |
---|---|---|
committer | Alexander Sakhnov <asakhnov@mirantis.com> | 2011-07-12 17:25:42 +0400 |
commit | db356e04fa79fc77a21017f2120580805a57010b (patch) | |
tree | 08a31f24f4c4a6677ec3a5112401b7bbb52c3cbf | |
parent | 76fbcb9bfd88a56c5a3419bf227cca28334f6844 (diff) | |
download | nova-db356e04fa79fc77a21017f2120580805a57010b.tar.gz nova-db356e04fa79fc77a21017f2120580805a57010b.tar.xz nova-db356e04fa79fc77a21017f2120580805a57010b.zip |
Fix 809316 bug which prevent cloudpipe to get valid IP.
-rw-r--r-- | Authors | 1 | ||||
-rw-r--r-- | nova/network/manager.py | 11 |
2 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,5 @@ Alex Meade <alex.meade@rackspace.com> +Alexander Sakhnov <asakhnov@mirantis.com> Andrey Brindeyev <abrindeyev@griddynamics.com> Andy Smith <code@term.ie> Andy Southgate <andy.southgate@citrix.com> diff --git a/nova/network/manager.py b/nova/network/manager.py index d7ac460ae..7b92b61d4 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -124,7 +124,7 @@ class RPCAllocateFixedIP(object): used since they share code to RPC.call allocate_fixed_ip on the correct network host to configure dnsmasq """ - def _allocate_fixed_ips(self, context, instance_id, networks): + def _allocate_fixed_ips(self, context, instance_id, networks, **kwargs): """Calls allocate_fixed_ip once for each network.""" green_pool = greenpool.GreenPool() @@ -136,13 +136,14 @@ class RPCAllocateFixedIP(object): args = {} args['instance_id'] = instance_id args['network_id'] = network['id'] + args['vpn'] = kwargs.pop('vpn') green_pool.spawn_n(rpc.call, context, topic, {'method': '_rpc_allocate_fixed_ip', 'args': args}) else: # i am the correct host, run here - self.allocate_fixed_ip(context, instance_id, network) + self.allocate_fixed_ip(context, instance_id, network, vpn=kwargs.pop('vpn')) # wait for all of the allocates (if any) to finish green_pool.waitall() @@ -371,13 +372,14 @@ class NetworkManager(manager.SchedulerDependentManager): instance_id = kwargs.pop('instance_id') project_id = kwargs.pop('project_id') type_id = kwargs.pop('instance_type_id') + vpn = kwargs.pop('vpn') admin_context = context.elevated() LOG.debug(_("network allocations for instance %s"), instance_id, context=context) networks = self._get_networks_for_instance(admin_context, instance_id, project_id) self._allocate_mac_addresses(context, instance_id, networks) - self._allocate_fixed_ips(admin_context, instance_id, networks) + self._allocate_fixed_ips(admin_context, instance_id, networks, vpn=vpn) return self.get_instance_nw_info(context, instance_id, type_id) def deallocate_for_instance(self, context, **kwargs): @@ -646,7 +648,7 @@ class NetworkManager(manager.SchedulerDependentManager): 'address': address, 'reserved': reserved}) - def _allocate_fixed_ips(self, context, instance_id, networks): + def _allocate_fixed_ips(self, context, instance_id, networks, **kwargs): """Calls allocate_fixed_ip once for each network.""" raise NotImplementedError() @@ -812,6 +814,7 @@ class VlanManager(RPCAllocateFixedIP, FloatingIP, NetworkManager): address = self.db.fixed_ip_associate_pool(context, network['id'], instance_id) + vif = self.db.virtual_interface_get_by_instance_and_network(context, instance_id, network['id']) |