Can't found network on instance launch

Asked by Nicolas d

Hi,

To test instance with quantum and melange, I use this script : https://github.com/openstack-dev/devstack/blob/master/exercises/quantum.sh
All the tenants, networks are created ok (I check the DB) but it failed with errors : https://gist.github.com/2430940
The network uuid in the log is in the DB.

Other conf files here : https://gist.github.com/2342747

Thanks for the help

--- Nicolas

Question information

Language:
English Edit question
Status:
Expired
For:
neutron Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Brad Hall (bgh) said :
#1

Can you show whats in the networks table of the ovs_quantum database?

echo 'select * from networks;' | mysql -u <user> -p ovs_quantum

Revision history for this message
Nicolas d (nicolas2b) said :
#2

Hi,

There : https://gist.github.com/2431153. I also include nova networks and melange ip_blocks (all have infos with the related uuid)

Thanks

--- Nicolas

Revision history for this message
Brad Hall (bgh) said :
#3

It looks like the project_id that it is using in validate_networks() (in nova/network/quantum/manager.py) isn't matching.. I think it should probably take the project_id from the networks table. I'll look more closely at it tonight and send you a patch if you're willing to try it out.

Revision history for this message
Nicolas d (nicolas2b) said :
#4

Yes, send me a patch and I try it. I want to help to get quantum working so I willing to try other patch if necessary.

Revision history for this message
Brad Hall (bgh) said :
#5

OK.. this isn't the right fix long term (we're moving away from relying on the database) but it should work for your case for right now:

diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py
index 3337094..71eea23 100644
--- a/nova/network/quantum/manager.py
+++ b/nova/network/quantum/manager.py
@@ -647,8 +647,9 @@ class QuantumManager(manager.FloatingIP, manager.FlatManager
         if networks is None:
             return

- project_id = context.project_id
         for (net_id, _i) in networks:
+ net = db.network_get_by_uuid(context.elevated(), net_id)
+ project_id = net['project_id']
             # TODO(bgh): At some point we should figure out whether or
             # not we want the verify_subnet_exists call to be optional.
             if not self.ipam.verify_subnet_exists(context, project_id,

Revision history for this message
Brad Hall (bgh) said :
#6

Sorry, launchpad screwed up the indentation.. the two '+' lines should be indented four spaces in from the "for" line.

Revision history for this message
Nicolas d (nicolas2b) said :
#7

Hi,

With the patch, the VM start, but failed in "networking" state. Log of nova-compute here : https://gist.github.com/2473287

Revision history for this message
Brad Hall (bgh) said :
#8

OK, new patch to try. If this one doesn't solve it then I'll need to spend some time testing it internally with melange. Thanks for trying this out!

diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py
index 3337094..59aa69e 100644
--- a/nova/network/quantum/manager.py
+++ b/nova/network/quantum/manager.py
@@ -647,12 +647,21 @@ class QuantumManager(manager.FloatingIP, manager.FlatManag
         if networks is None:
             return

- project_id = context.project_id
         for (net_id, _i) in networks:
+ net = db.network_get_by_uuid(context.elevated(), net_id)
             # TODO(bgh): At some point we should figure out whether or
             # not we want the verify_subnet_exists call to be optional.
- if not self.ipam.verify_subnet_exists(context, project_id,
- net_id):
+ exists = False
+ # Try both the network project id and the context project id
+ for x in [net['project_id'], context.project_id]:
+ project_id = x
+ try:
+ if self.ipam.verify_subnet_exists(context, project_id,
+ net_id):
+ exists = True
+ except:
+ pass
+ if not exists:
                 raise exception.NetworkNotFound(network_id=net_id)
             is_tenant_net = self.q_conn.network_exists(project_id, net_id)
             is_provider_net = self.q_conn.network_exists(

Revision history for this message
Nicolas d (nicolas2b) said :
#9

Sadly, still the same error. The log of compute here : https://gist.github.com/2473802. (if you need other log, ask ! I'm also on irc with pseudo nicolas2b, for "real-time" debugging)

Revision history for this message
Launchpad Janitor (janitor) said :
#10

This question was expired because it remained in the 'Open' state without activity for the last 15 days.