Creating a network with VlanManager fails

Bug #1046778 reported by Rohit Karajgi
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya

Bug Description

1. Set the network manager as VlanManager
2. Create a network using nova-manage
    $ nova-manage network create --label private --fixed_range_v4 10.0.0.0/24 --num_networks 1 --network_size 256 --vlan 100

Command fails with the following stack trace:

2012-09-06 03:52:40 CRITICAL nova [req-e65dfede-18b3-4623-9e1c-c6a96111e2fe None None] The sum between the number of networks and the vlan start cannot be greater than 4094
2012-09-06 03:52:40 TRACE nova Traceback (most recent call last):
2012-09-06 03:52:40 TRACE nova File "/usr/local/bin/nova-manage", line 7, in <module>
2012-09-06 03:52:40 TRACE nova execfile(__file__)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1387, in <module>
2012-09-06 03:52:40 TRACE nova main()
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1374, in main
2012-09-06 03:52:40 TRACE nova fn(*fn_args, **fn_kwargs)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 479, in create
2012-09-06 03:52:40 TRACE nova net_manager.create_networks(context.get_admin_context(), **kwargs)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/nova/network/manager.py", line 2019, in create_networks
2012-09-06 03:52:40 TRACE nova raise ValueError(_('The sum between the number of networks and'
2012-09-06 03:52:40 TRACE nova ValueError: The sum between the number of networks and the vlan start cannot be greater than 4094
2012-09-06 03:52:40 TRACE nova
The sum between the number of networks and the vlan start cannot be greater than 4094
2012-09-06 03:52:40 TRACE nova Traceback (most recent call last):
2012-09-06 03:52:40 TRACE nova File "/usr/local/bin/nova-manage", line 7, in <module>
2012-09-06 03:52:40 TRACE nova execfile(__file__)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1387, in <module>
2012-09-06 03:52:40 TRACE nova main()
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1374, in main
2012-09-06 03:52:40 TRACE nova fn(*fn_args, **fn_kwargs)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 479, in create
2012-09-06 03:52:40 TRACE nova net_manager.create_networks(context.get_admin_context(), **kwargs)
2012-09-06 03:52:40 TRACE nova File "/opt/stack/nova/nova/network/manager.py", line 2019, in create_networks
2012-09-06 03:52:40 TRACE nova raise ValueError(_('The sum between the number of networks and'
2012-09-06 03:52:40 TRACE nova ValueError: The sum between the number of networks and the vlan start cannot be greater than 4094
2012-09-06 03:52:40 TRACE nova

Problem is that nova-manage does not convert the unicodes for network_size, num_networks and vlan_start to "integer", hence the conditions in VlanManage.create_network() fail.
This should be handled properly by nova-manage.

Revision history for this message
Rohit Karajgi (rohitk) wrote :

Below patch can fix the above issue.

diff --git a/bin/nova-manage b/bin/nova-manage
index c1426e2..f856d8b 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -475,6 +475,14 @@ class NetworkCommands(object):
                        if v and k != "self"))
         if multi_host is not None:
             kwargs['multi_host'] = multi_host == 'T'
+ if num_networks is not None:
+ kwargs['num_networks'] = int(num_networks)
+ if network_size is not None:
+ kwargs['network_size'] = int(network_size)
+ if vlan_start is not None:
+ kwargs['vlan_start'] = int(vlan_start)
+ if vpn_start is not None:
+ kwargs['vpn_start'] = int(vpn_start)
         net_manager = importutils.import_object(FLAGS.network_manager)
         net_manager.create_networks(context.get_admin_context(), **kwargs)

Changed in nova:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Vish Ishaya (vishvananda)
milestone: none → folsom-rc1
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/12733

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

Reviewed: https://review.openstack.org/12733
Committed: http://github.com/openstack/nova/commit/3531288bc3959932eac586f582fa168b983083c2
Submitter: Jenkins
Branch: master

commit 3531288bc3959932eac586f582fa168b983083c2
Author: Vishvananda Ishaya <email address hidden>
Date: Mon Sep 10 12:46:25 2012 -0700

    Convert to ints in VlanManager.create_networks

    Fixes bug 1046778

    Change-Id: I17647b0e495964c305e54221bf3fcfd6bdbc1547

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.