Cannot launch an instance when quantum public network is specified

Bug #1039419 reported by Akihiro Motoki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Akihiro Motoki
neutron
Fix Released
Critical
Akihiro Motoki

Bug Description

Quantum supports a concept of public network.

When I tried to launch an instance with 'public' network is specified as --nic option, validate_networks() failed with NetworkNotFound exception. Since validate_networks calls quantumclient.list_networks() with tenant_id filter, no network matches 'public' network. We need to modify list_networks() filter to support public network.

allocate_for_instance() uses a similar logic and needs to be fixed.

$ quantum net-list -c id -c name -c shared
+--------------------------------------+------+--------+
| id | name | shared |
+--------------------------------------+------+--------+
| 82d1d4c1-fc98-4d17-b515-884b9ee814ac | net1 | False |
| f0935ba1-2715-4c13-9e9b-2c52a5552eb7 | pub1 | True |
+--------------------------------------+------+--------+

$ nova boot --image 3009a5de-7315-406b-ac44-dd75bff3dc3c --flavor 1 --nic net-id=f0935ba1-2715-4c13-9e9b-2c52a5552eb7 s3

2012-08-21 13:46:29 ERROR nova.api.openstack [req-674a2723-61fb-42fd-bf1b-719d95bad1e0 demo invisible_to_admin] Caught error: Network f0935ba1-2715-4c13-9e9b-2c52a5552eb7
could not be found.
2012-08-21 13:46:29 TRACE nova.api.openstack Traceback (most recent call last):
2012-08-21 13:46:29 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 78, in __call__
[...]
2012-08-21 13:46:29 TRACE nova.api.openstack File "/opt/stack/nova/nova/network/quantumv2/api.py", line 161, in validate_networks
2012-08-21 13:46:29 TRACE nova.api.openstack raise exception.NetworkNotFound(network_id=id_str)
2012-08-21 13:46:29 TRACE nova.api.openstack NetworkNotFound: Network f0935ba1-2715-4c13-9e9b-2c52a5552eb7 could not be found.
2012-08-21 13:46:29 TRACE nova.api.openstack

Tags: quantum
Akihiro Motoki (amotoki)
Changed in nova:
assignee: nobody → Akihiro Motoki (amotoki)
dan wendlandt (danwent)
Changed in quantum:
milestone: none → folsom-rc1
assignee: nobody → Akihiro Motoki (amotoki)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Mark McLoughlin (markmc) wrote :

Marking Confirmed, but it's not clear to me yet whether this will require a change in Nova or whether we're just going to have quantumclient.list_networks() include the public network

Changed in nova:
milestone: none → folsom-rc1
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

For this bug a change in nova will be required.
list_networks on python-quantuclient already returns shared networks as well, but when nova calls quantum it explictly filters for tenant_id, thus excluding shared networks from the response.

I think Akihiro is going to change the nova-quantum API in order to make two calls which combined will return tenant's and shared networks.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11796

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Akihiro Motoki (amotoki) wrote :

In addition to Salvatore's comment, I would like to explain the reason nova calls list_networks() with tenant_id filter.

When list_networks() is called with a regular user, it returns networks owned by the current tenant and public networks. It is no problem.

When it is called with admin role, list_networks() returns networks owned by other tenants in addition to the above. To eliminate networks owned by other tenants, nova calls list_networks() with tenant_id filter. But by this filter, public networks are also eliminated.

In my patch, nova calls list_networks() twice: One call is with tenant_id filter and the other call with shared=True.

Mark McLoughlin (markmc)
tags: added: quantum
dan wendlandt (danwent)
Changed in quantum:
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11796
Committed: http://github.com/openstack/nova/commit/8e09b93f4ff4c782e6552638f0099b92523000ab
Submitter: Jenkins
Branch: master

commit 8e09b93f4ff4c782e6552638f0099b92523000ab
Author: Akihiro MOTOKI <email address hidden>
Date: Tue Aug 21 23:07:11 2012 +0900

    Add public network support when launching an instance.

    Fixes bug 1039419.

    A concept of public network has been implemented in Quantum.
    To launch an instance connected to public network, we need to check public
    network (whose 'shared' attribute is True) in addition to network owned by
    the current tenant.

    Change-Id: I128e68a8b9404056f74153bf8f576cfa8b438e19

Changed in nova:
status: In Progress → Fix Committed
dan wendlandt (danwent)
Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-rc1 → 2012.2
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.