Nova doesn't show enough error message when creating a new network with a duplicate vlan ID.

Bug #1420112 reported by Kahou Lei on 2015-02-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Low
Sivasathurappan Radhakrishnan

Bug Description

This happens when user tries to create a new network with a duplicate vlan ID:

vagrant@ubuntu:~/devstack$ nova network-list
+--------------------------------------+---------+-------------+
| ID | Label | Cidr |
+--------------------------------------+---------+-------------+
| a16f1896-da4c-4978-9776-0b6368129b07 | private | 10.0.0.0/24 |
+--------------------------------------+---------+-------------+

vagrant@ubuntu:~/devstack$ nova network-show a16f1896-da4c-4978-9776-0b6368129b07
+---------------------+--------------------------------------+
| Property | Value
+---------------------+--------------------------------------+
| bridge | br100
| bridge_interface | eth1
| broadcast | 10.0.0.255
| cidr | 10.0.0.0/24
| cidr_v6 | -
| created_at | 2015-02-10T05:52:41.000000
| deleted | False
| deleted_at | -
| dhcp_server | 10.0.0.1
| dhcp_start | 10.0.0.3
| dns1 | 8.8.4.4
| dns2 | -
| enable_dhcp | True
| gateway | 10.0.0.1
| gateway_v6 | -
| host | -
| id | a16f1896-da4c-4978-9776-0b6368129b07
| injected | False
| label | private
| mtu | -
| multi_host | False
| netmask | 255.255.255.0
| netmask_v6 | -
| priority | -
| project_id | -
| rxtx_base | -
| share_address | False
| updated_at | -
| vlan | 100
| vpn_private_address | 10.0.0.2
| vpn_public_address | -
| vpn_public_port | 1000
+---------------------+--------------------------------------+

vagrant@ubuntu:~/devstack$ nova network-create --fixed-range-v4 20.0.0.0/24 --vlan 100 vlan100
ERROR (Conflict): There was a conflict when trying to complete your request. (HTTP 409) (Request-ID: req-634ac773-3fc7-4013-a319-69fbd4f1cca3)

Contrary to other conflict such as subnet conflict, nova returns a clearer error message.

Tags: api Edit Tag help
Kahou Lei (kahou82) on 2015-02-10
Changed in nova:
assignee: nobody → Kahou Lei (kahou82)

@Kahou, can you see errors / stack traces in any of the nova logs? can you please upload them to this bug? Which version of Nova? Are you using Nova Network? (and no Neutron just to confirm).

Changed in nova:
status: New → Incomplete

Looks like you have assigned this to yourself, if you are going to provide a fix/review, please switch it back to "Confirmed"

Kahou Lei (kahou82) wrote :
Download full text (10.0 KiB)

@Davanum, I am using devstack from the master branch and it is a nova network.

Below is the stack trace from nova-net:

2015-02-10 08:34:09.180 ERROR oslo_messaging.rpc.dispatcher [req-8b1e1d6e-c0d8-49d2-b371-c9e8b3095c84 admin admin] Exception during message handling: Detect
ed existing vlan with id 100
Traceback (most recent call last):

  File "/opt/stack/nova/nova/conductor/manager.py", line 412, in _object_dispatch
    return getattr(target, method)(context, *args, **kwargs)

  File "/opt/stack/nova/nova/objects/base.py", line 206, in wrapper
    return fn(self, ctxt, *args, **kwargs)

  File "/opt/stack/nova/nova/objects/network.py", line 177, in create
    db_network = db.network_create_safe(context, updates)

  File "/opt/stack/nova/nova/db/api.py", line 973, in network_create_safe
    return IMPL.network_create_safe(context, values)

  File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 125, in wrapper
    return f(*args, **kwargs)

  File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 2743, in network_create_safe
    raise exception.DuplicateVlan(vlan=values['vlan'])

DuplicateVlan: Detected existing vlan with id 100

2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _
dispatch_and_reply
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _
dispatch
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _
do_dispatch
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/network/manager.py", line 2068, in create_networks
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher self, context, vpn=True, **kwargs)
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/network/manager.py", line 1207, in create_networks
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher return self._do_create_networks(context, **kwargs)
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/network/manager.py", line 1380, in _do_create_networks
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher net.create()
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/objects/base.py", line 191, in wrapper
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher ctxt, self, fn.__name__, args, kwargs)
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/conductor/rpcapi.py", line 370, in object_action
2015-02-10 08:34:09.180 TRACE oslo_messaging.rpc.dispatcher objmethod=objmethod, args=args...

Kahou Lei (kahou82) on 2015-02-10
Changed in nova:
status: Incomplete → Confirmed

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

Changed in nova:
status: Confirmed → In Progress

Change abandoned by Kahou Lei (<email address hidden>) on branch: master
Review: https://review.openstack.org/154698

Changed in nova:
importance: Undecided → Low
Changed in nova:
assignee: Kahou Lei (kahou82) → Nicolas Simonds (nicolas.simonds)
tags: added: api

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/155105
Reason: This patch is very old and appears to not be active any more. I am therefore abandoning it to keep the nova review queue sane. Feel free to restore the change when you're actively working on it again.

Changed in nova:
assignee: Nicolas Simonds (nicolas.simonds) → nobody
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → Sivasathurappan Radhakrishnan (siva-radhakrishnan)

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

Changed in nova:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/339253
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4caabaf864f9bec62c4a78c7e9c4dc31ea5ef063
Submitter: Jenkins
Branch: master

commit 4caabaf864f9bec62c4a78c7e9c4dc31ea5ef063
Author: Sivasathurappan Radhakrishnan <email address hidden>
Date: Thu Jul 7 21:58:32 2016 +0000

    Provide more duplicate VLAN network error info

    When user tries to create a network which VLAN ID is already
    used by another network, Network object will throw a DuplicateVlan
    exception. However, when the exception get propagate to the API level,
    it is only treated as a regular exception. This fix is to treat Duplicate
    Vlan exception as a special exception (similar to DuplicateCidr) so that
    users know more about what kind of duplicated setting they configured.

    Change-Id: Ib2f7bc90957d4ae5647adbbda05a87195549374d
    Closes-Bug: #1420112
    Co-Authored-By: kahou Lei<email address hidden>

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 14.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers