quantum allocate_for_instance() returns non-related subnet info for a port on a network without subnet

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

Bug Description

When I try to launch an instance with a quantum network without subnet, allocate_for_instance() returns non-related subnet info for a port on a network without subnet.

To reproduce this bug, we need to have at least one network with subnet and one network without subnet.

ubuntu@test1:/opt/stack/nova (master)$ quantum net-list
+----------------+--------------------------------------+------+--------+--------+--------------------------------------+----------------------------------+
| admin_state_up | id | name | shared | status | subnets | tenant_id |
+----------------+--------------------------------------+------+--------+--------+--------------------------------------+----------------------------------+
| True | 210d15fe-107a-4449-9891-28fae7ac4436 | net1 | False | ACTIVE | 1f1b9f14-8740-41d9-9e08-b1c7badb67ba | c018797b92a44d32be665a8663a723c3 |
| True | 622a98dd-bd0c-4fb7-a2c5-a639290a5073 | net2 | False | ACTIVE | | c018797b92a44d32be665a8663a723c3 |
+----------------+--------------------------------------+------+--------+--------+--------------------------------------+----------------------------------+
ubuntu@test1:/opt/stack/nova (master)$ quantum subnet-list
+--------------------------------------------+-------------+-----------------+-------------+------------+-------------+--------------------------------------+------------+------+--------------------------------------+----------------------------------+
| allocation_pools | cidr | dns_nameservers | enable_dhcp | gateway_ip | host_routes | id | ip_version | name | network_id | tenant_id |
+--------------------------------------------+-------------+-----------------+-------------+------------+-------------+--------------------------------------+------------+------+--------------------------------------+----------------------------------+
| {"start": "10.0.0.2", "end": "10.0.0.254"} | 10.0.0.0/24 | [] | True | 10.0.0.1 | [] | 1f1b9f14-8740-41d9-9e08-b1c7badb67ba | 4 | | 210d15fe-107a-4449-9891-28fae7ac4436 | c018797b92a44d32be665a8663a723c3 |
+--------------------------------------------+-------------+-----------------+-------------+------------+-------------+--------------------------------------+------------+------+--------------------------------------+----------------------------------+

Then, launch an instance: nova boot --image c5b29b5f-3252-4c18-809b-407dc9eb9d13 --flavor 1 --nic net-id=622a98dd-bd0c-4fb7-a2c5-a639290a5073 s1

nova-compute log says:

Instance network_info: |[VIF({'network': Network({'bridge': '', 'subnets': [Subnet({'ips': [], 'version': 4, 'meta': {}, 'dns': [],
'routes': [], 'cidr': u'10.0.0.0/24', 'gateway': IP({'meta': {}, 'version': 4, 'type': 'gateway', 'address': u'10.0.0.1'})})], 'meta':
{'injected': False, 'tenant_id': u'c018797b92a44d32be665a8663a723c3'}, 'id': u'622a98dd-bd0c-4fb7-a2c5-a639290a5073', 'label': u'net2'}),
'meta': {}, 'id': u'9db0c542-36ae-4565-ac51-de4aee9fee89', 'address': u'fa:16:3e:66:51:97'})]|

The port is created on a network without subnet and no subnet is associated with the port.

If there is no subnet, network_info returned by allocate_for_instance() is as follows. It is an expected behavior.

Instance network_info: |[VIF({'network': Network({'bridge': '', 'subnets': [], 'meta': {'injected': False, 'tenant_id': u'c018797b92a44d32be665a8663a723c3'}, 'id': u'622a98dd-bd0c-4fb7-a2c5-a639290a5073', 'label': u'net2'}), 'meta': {}, 'id': u'62c0f806-ca9f-4e91-bd81-41c1fdd29f26', 'address': u'fa:16:3e:b6:19:f5'})]|

Tags: quantum
Akihiro Motoki (amotoki)
Changed in nova:
assignee: nobody → Akihiro Motoki (amotoki)
tags: added: quantum
Mark McLoughlin (markmc)
Changed in nova:
status: New → Confirmed
milestone: none → folsom-rc1
importance: Undecided → High
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/12195

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
assignee: Akihiro Motoki (amotoki) → Vish Ishaya (vishvananda)
Changed in nova:
assignee: Vish Ishaya (vishvananda) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12195
Committed: http://github.com/openstack/nova/commit/0874cb9b69a0e82c527497c5d98b5b19039b5947
Submitter: Jenkins
Branch: master

commit 0874cb9b69a0e82c527497c5d98b5b19039b5947
Author: Akihiro MOTOKI <email address hidden>
Date: Thu Aug 30 23:27:59 2012 +0900

    Make sure to return an empty subnet list for a network without sunbet.

    Fixes bug 1043827.

    This commit fixes a bug that when launching an instance with a quantum
    network without subnet allocate_for_instance() in network/quantumv2/api.py
    returns non-related subnet info as instance_nw_info.
    A port created on a network without subnet is associated with no subnet and
    subnet info in instance_nw_info should be an empty list.

    Change-Id: I2cfb78886ab10dd94eb795f5288b26b77f379998

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
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.