nova-manage network create network_size

Bug #1046605 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Joe Gordon

Bug Description

My network-create command in one of my dev setups used to look like this:

nova-manage network create --label=public --num_networks=1 --bridge xenbr0 \
  --gateway=10.127.0.1 --dns1=10.6.23.4 --dns2=10.6.23.5 \
   --fixed_range_v4=10.127.0.0/24 --fixed_cidr=10.127.0.144/28

Now i have to define --network_size or the network manager throws a ValueError:

nova-manage network create --label=public --num_networks=1 \
  --network_size=256 --bridge xenbr0 --gateway=10.127.0.1 \
  --dns1=10.6.23.4 --dns2=10.6.23.5 \
  --fixed_range_v4=10.127.0.0/24 --fixed_cidr=10.127.0.144/28

So this creates a network - 10.127.0.0/24 (gateway 10.127.0.1, broadcast 10.127.0.255) and a fixed ip allocation of just 16 ips 10.127.0.144-10.127.0.159 - which is exactly what I want this dev setup.

But the syntax changed, such tath I need to specify the network_size explicitly even though I'm giving it the fixed_range_v4 cidr

Change was in commit e00a398f84562f1a0da69c8c0fd33db538365dc3

Revision history for this message
clayg (clay-gerrard) wrote :

Sorry, value error, cause None can't convert to an int - and the network starts in the wrong place with my updated command anyway:

mysql> select * from networks\G
*************************** 1. row ***************************
         created_at: 2012-09-05 22:55:02
         updated_at: NULL
         deleted_at: NULL
            deleted: 0
                 id: 1
           injected: 0
               cidr: 10.127.0.0/28
            netmask: 255.255.255.240
             bridge: xenbr0
            gateway: 10.127.0.1
          broadcast: 10.127.0.15
               dns1: 10.6.23.4
               vlan: NULL
 vpn_public_address: NULL
    vpn_public_port: NULL
vpn_private_address: NULL
         dhcp_start: 10.127.0.2
         project_id: NULL
               host: NULL
            cidr_v6: NULL
         gateway_v6: NULL
              label: public
         netmask_v6: NULL
   bridge_interface: NULL
         multi_host: 0
               dns2: 10.6.23.5
               uuid: a0764070-f196-48f4-85a0-68333e9345a7
           priority: NULL
          rxtx_base: NULL
1 row in set (0.00 sec)

Revision history for this message
clayg (clay-gerrard) wrote :

So this has got to be the worst bug report ever, I'm really sorry about that - i was frustrated and in a rush - horrible excuse, sorry.

FWIW, I had some time to look at it now and here's the correct network create command to accomplish the same as my original:

nova-manage network create --label=public --num_networks=1 \
  --network_size=256 --bridge xenbr0 --gateway=10.127.0.1 \
  --dns1=10.6.23.4 --dns2=10.6.23.5 \
  --fixed_range_v4=10.127.0.0/24 --fixed_cidr=10.127.0.144/28

So this creates a network - 10.127.0.0/24 (gateway 10.127.0.1, broadcast 10.127.0.255) and a fixed ip allocation of just 16 ips 10.127.0.144-10.127.0.159 - which is exactly what I want in my dev setup.

Really aside from the syntax of the command changing such that it is no longer working to calculate the network_size from the cidr (this is for the network, the fixed_range_v4 cidr as opposed allocatable fixed_ips from the fixed_cidr) - there's not much of a bug here.

summary: - nova-manage network create num_networks
+ nova-manage network create network_size
description: updated
Revision history for this message
Russell Bryant (russellb) wrote :

Targeted to folsom-rc1 so that it's on the release radar since it looks like a regression in folsom

Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → folsom-rc1
Joe Gordon (jogo)
Changed in nova:
assignee: nobody → Joe Gordon (joe-gordon0)
Revision history for this message
Joe Gordon (jogo) wrote :

Tested with the following command to work in devstack (FlatManager)

nova-manage network create --label=public --fixed_range_v4=10.127.0.0/24 --num_networks=1
 --gateway=10.127.0.1
  --dns1=10.6.23.4 --dns2=10.6.23.5 --fixed_cidr=10.127.0.144/28

Got:

int() argument must be a string or a number, not 'NoneType'
2012-09-07 22:13:46 TRACE nova Traceback (most recent call last):
2012-09-07 22:13:46 TRACE nova File "/usr/local/bin/nova-manage", line 7, in <module>
2012-09-07 22:13:46 TRACE nova execfile(__file__)
2012-09-07 22:13:46 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1387, in <module>
2012-09-07 22:13:46 TRACE nova main()
2012-09-07 22:13:46 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 1374, in main
2012-09-07 22:13:46 TRACE nova fn(*fn_args, **fn_kwargs)
2012-09-07 22:13:46 TRACE nova File "/opt/stack/nova/bin/nova-manage", line 479, in create
2012-09-07 22:13:46 TRACE nova net_manager.create_networks(context.get_admin_context(), **kwargs)
2012-09-07 22:13:46 TRACE nova File "/opt/stack/nova/nova/network/manager.py", line 1375, in create_networks
2012-09-07 22:13:46 TRACE nova kwargs[key] = int(kwargs[key])
2012-09-07 22:13:46 TRACE nova TypeError: int() argument must be a string or a number, not 'NoneType'

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/12612

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12612
Committed: http://github.com/openstack/nova/commit/7483115f1b231318c7a17222eb9908cc49760236
Submitter: Jenkins
Branch: master

commit 7483115f1b231318c7a17222eb9908cc49760236
Author: Joe Gordon <email address hidden>
Date: Fri Sep 7 22:19:18 2012 +0000

    Handle missing network_size in nova-manage

    In 'nova-manage network create' --network_size should be optional.

    Fixes bug 1046605

    Change-Id: I25ce9acbe664810aa8fe9a3b4a2951c0fac4e41a

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.