Can't create a network with network-create when vlan is set

Bug #1167779 reported by Haiwei Xu on 2013-04-11
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-novaclient
Undecided
Haiwei Xu

Bug Description

When I tried to create a network with "nova network-create" in Vlan mode,
I found the error as follows:

$ nova network-create --fixed-range-v4 11.0.0.0/24 --vlan 123 net1
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-418aed88-57dd-495e-bc1f-5ede146137ca)

The error message in the nova-network log is:

2013-04-10 06:59:57 ERROR [nova.openstack.common.rpc.amqp] Exception during message handling
Traceback (most recent call last):
 File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 430, in _process_data
   rval = self.proxy.dispatch(ctxt, version, method, **args)
 File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch
   return getattr(proxyobj, method)(ctxt, **kwargs)
 File "/opt/stack/nova/nova/network/manager.py", line 1811, in create_networks
   self, context, vpn=True, **kwargs)
 File "/opt/stack/nova/nova/network/manager.py", line 1058, in create_networks
   return self._do_create_networks(context, **kwargs)
 File "/opt/stack/nova/nova/network/manager.py", line 1187, in _do_create_networks
   network = self.db.network_create_safe(context, net)
 File "/opt/stack/nova/nova/db/api.py", line 797, in network_create_safe
   return IMPL.network_create_safe(context, values)
 File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 96, in wrapper
   return f(*args, **kwargs)
 File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 2165, in network_create_safe
   raise exception.DuplicateVlan(vlan=values['vlan'])
 DuplicateVlan: Detected existing vlan with id 100
 2013-04-10 06:59:57 ERROR [nova.openstack.common.rpc.common] Returning exception Detected existing vlan with id 100 to caller
 2013-04-10 06:59:57 ERROR [nova.openstack.common.rpc.common] ['Traceback (most recent call last):\n', ' File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 430, in _process_data\n rval = self.proxy.dispatch(ctxt, version, method, **args)\n', ' File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch\n return getattr(proxyobj, method)(ctxt, **kwargs)\n', ' File "/opt/stack/nova/nova/network/manager.py", line 1811, in create_networks\n self, context, vpn=True, **kwargs)\n', ' File "/opt/stack/nova/nova/network/manager.py", line 1058, in create_networks\n return self._do_create_networks(context, **kwargs)\n', ' File "/opt/stack/nova/nova/network/manager.py", line 1187, in _do_create_networks\n network = self.db.network_create_safe(context, net)\n', ' File "/opt/stack/nova/nova/db/api.py", line 797, in network_create_safe\n return IMPL.network_create_safe(context, values)\n', ' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 96, in wrapper\n return f(*args, **kwargs)\n', ' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 2165, in network_create_safe\n raise exception.DuplicateVlan(vlan=values[\'vlan\'])\n', 'DuplicateVlan: Detected existing vlan with id 100\n']
 2013-04-10 06:59:57 DEBUG [nova.openstack.common.rpc.amqp] UNIQUE_ID is 60352d18f62541a190186ce07bb82779.

Whatever the vlanid is set, the same error happens.
I red the source and found the vlan option wasn't red by the novaclient correctly. I will give the patch soon.

Haiwei Xu (xu-haiwei) on 2013-04-11
Changed in python-novaclient:
assignee: nobody → Haiwei Xu (xu-haiwei)

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

Changed in python-novaclient:
status: New → In Progress

Reviewed: https://review.openstack.org/26726
Committed: http://github.com/openstack/python-novaclient/commit/c23081201779365354bc01346100d5422f43c2ea
Submitter: Jenkins
Branch: master

commit c23081201779365354bc01346100d5422f43c2ea
Author: Haiwei Xu <email address hidden>
Date: Thu Apr 11 18:00:00 2013 +0900

    Make --vlan option work in network-create in VLAN mode

    When creating a network with network-create, DuplicateVlan exception
    happens whatever the --vlan option is set. This is because --vlan
    option isn't read correctly by novaclient. This patch fixes this
    bug.

    Fixes bug 1167779

    Change-Id: I3bf0e8d96d995632698f5aa1b1a07ead9e553c70

Changed in python-novaclient:
status: In Progress → Fix Committed
Igor Laskovy (igor-laskovy) wrote :

Hi all!
When can expect this Fix at CloudArchive repository for Grizzly release?

Changed in python-novaclient:
status: Fix Committed → Fix Released
Nicolae Paladi (n-paladi) wrote :

a very similar issue when creating a vlan with nova-manage:

nova-manage --config-file=/etc/nova/nova.conf network create public 10.1.173.0/24 1 256
2013-08-07 16:34:07.655 4948 INFO nova.network.driver [-] Loading network driver 'nova.network.linux_net'
/usr/lib/python2.6/site-packages/nova/openstack/common/db/sqlalchemy/session.py:376: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
Command failed, please check log for more info
2013-08-07 16:34:08.019 CRITICAL nova [req-ec84355d-9160-44fa-b302-f2158a681654 None None] Detected existing vlan with id 100
2013-08-07 16:34:08.019 4948 TRACE nova Traceback (most recent call last):
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/bin/nova-manage", line 1263, in <module>
2013-08-07 16:34:08.019 4948 TRACE nova main()
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/bin/nova-manage", line 1255, in main
2013-08-07 16:34:08.019 4948 TRACE nova fn(*fn_args, **fn_kwargs)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/bin/nova-manage", line 494, in create
2013-08-07 16:34:08.019 4948 TRACE nova net_manager.create_networks(context.get_admin_context(), **kwargs)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 1812, in create_networks
2013-08-07 16:34:08.019 4948 TRACE nova self, context, vpn=True, **kwargs)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 1056, in create_networks
2013-08-07 16:34:08.019 4948 TRACE nova return self._do_create_networks(context, **kwargs)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 1184, in _do_create_networks
2013-08-07 16:34:08.019 4948 TRACE nova network = self.db.network_create_safe(context, net)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/api.py", line 804, in network_create_safe
2013-08-07 16:34:08.019 4948 TRACE nova return IMPL.network_create_safe(context, values)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 96, in wrapper
2013-08-07 16:34:08.019 4948 TRACE nova return f(*args, **kwargs)
2013-08-07 16:34:08.019 4948 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 2165, in network_create_safe
2013-08-07 16:34:08.019 4948 TRACE nova raise exception.DuplicateVlan(vlan=values['vlan'])
2013-08-07 16:34:08.019 4948 TRACE nova DuplicateVlan: Detected existing vlan with id 100
2013-08-07 16:34:08.019 4948 TRACE nova

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

Other bug subscribers