nova-manage network create does not properly register gateway_v6

Bug #802849 reported by Koji Iida
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned

Bug Description

I tested rev1218.

nova-manage network create cannot register gateway_v6 when using FlatManager and use_ipv6 flag is true.

* Default value of gateway_v6 causes error

# ./nova/bin/nova-manage --use_ipv6 --network_manager=nova.network.manager.FlatManager network create 10.1.7.0/24 1 16 1000 1000 fd00:1::/48
Command failed, please check log for more info
2011-06-28 16:17:50,455 CRITICAL nova [-] range contains more than 9223372036854775807 (sys.maxint) IP addresses! Use the .size property instead.
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "./nova/bin/nova-manage", line 1249, in <module>
(nova): TRACE: main()
(nova): TRACE: File "./nova/bin/nova-manage", line 1238, in main
(nova): TRACE: fn(*argv)
(nova): TRACE: File "./nova/bin/nova-manage", line 584, in create
(nova): TRACE: label=label)
(nova): TRACE: File "/opt2/nova/nova/network/manager.py", line 333, in create_networks
(nova): TRACE: net['gateway_v6'] = str(list(project_net_v6)[1])
(nova): TRACE: File "/usr/lib/pymodules/python2.6/netaddr/ip/__init__.py", line 932, in __len__
(nova): TRACE: "IP addresses! Use the .size property instead." % _sys.maxint)
(nova): TRACE: IndexError: range contains more than 9223372036854775807 (sys.maxint) IP addresses! Use the .size property instead.
(nova): TRACE:

* Specifying value of gateway_v6 registser incorrect gateway_v6 value.

# ./nova/bin/nova-manage --use_ipv6 --network_manager=nova.network.manager.FlatManager network create 10.1.9.0/28 1 16 1000 1000 fd00:1::/48 fd00:1::1
2011-06-28 16:25:27,321 DEBUG nova.utils [-] backend <module 'nova.db.sqlalchemy.api' from '/opt2/nova/nova/db/sqlalchemy/api.pyc'> from (pid=699) __get_backend /opt2/nova/nova/utils.py:406
root@usv601:/opt2# mysql -u root --password=nova nova --execute "select id,cidr,cidr_v6,gateway_v6 from networks where cidr like '10.1.9.0%';"
+----+-------------+-------------+------------+
| id | cidr | cidr_v6 | gateway_v6 |
+----+-------------+-------------+------------+
| 17 | 10.1.9.0/28 | fd00:1::/64 | d |
+----+-------------+-------------+------------+

gateway_v6 value 'd' is incorrect.

Revision history for this message
Koji Iida (iida-koji) wrote :

Following patch works for me.

=== modified file 'nova/network/manager.py'
--- nova/network/manager.py 2011-06-23 13:57:22 +0000
+++ nova/network/manager.py 2011-06-28 07:35:00 +0000
@@ -328,9 +328,9 @@

                 if gateway_v6:
                     # use a pre-defined gateway if one is provided
- net['gateway_v6'] = str(list(gateway_v6)[1])
+ net['gateway_v6'] = str(gateway_v6)
                 else:
- net['gateway_v6'] = str(list(project_net_v6)[1])
+ net['gateway_v6'] = str(project_net_v6[1])

                 net['netmask_v6'] = str(project_net_v6._prefixlen)

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Thierry Carrez (ttx) wrote :

Was apparently fixed as of rev1323. Please reopen if you disagree.

Changed in nova:
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-4
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-4 → 2011.3
status: Fix Committed → Fix Released
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.