nova-manage network creation doesn't respect CIDR

Bug #740810 reported by justinsb
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Tran

Bug Description

The CIDR network size is not respected when creating a network... this is going to cause user confusion:

root@openstack# bin/nova-manage network create
Possible wrong number of arguments supplied
network create: Creates fixed ips for host by range
        arguments: fixed_range=FLAG, [num_networks=FLAG],
                   [network_size=FLAG], [vlan_start=FLAG],
                   [vpn_start=FLAG], [fixed_range_v6=FLAG]
2011-03-23 08:42:13,991 CRITICAL nova [-] Fixed range in the form of 10.0.0.0/8 is required to create networks.
...

(OK, so I'll specify my CIDR; I'll give openstack 10.3.0.0/16)

root@openstack# bin/nova-manage network create 10.3.0.0/16

(Looks good)

root@openstack# bin/nova-manage network list
network netmask start address DNS
10.3.0.0/24 255.255.255.0 10.3.0.3 None

It created a /24, not a /16 as I asked :-(

Related branches

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 740810] [NEW] nova-manage network creation doesn't respect CIDR

So maybe we should require num_networks and network_size as well....

Vish

On Mar 23, 2011, at 1:50 AM, justinsb wrote:

> Public bug reported:
>
> The CIDR network size is not respected when creating a network... this
> is going to cause user confusion:
>
> root@openstack# bin/nova-manage network create
> Possible wrong number of arguments supplied
> network create: Creates fixed ips for host by range
> arguments: fixed_range=FLAG, [num_networks=FLAG],
> [network_size=FLAG], [vlan_start=FLAG],
> [vpn_start=FLAG], [fixed_range_v6=FLAG]
> 2011-03-23 08:42:13,991 CRITICAL nova [-] Fixed range in the form of 10.0.0.0/8 is required to create networks.
> ...
>
> (OK, so I'll specify my CIDR; I'll give openstack 10.3.0.0/16)
>
> root@openstack# bin/nova-manage network create 10.3.0.0/16
>
> (Looks good)
>
> root@openstack# bin/nova-manage network list
> network netmask start address DNS
> 10.3.0.0/24 255.255.255.0 10.3.0.3 None
>
>
> It created a /24, not a /16 as I asked :-(
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/740810
>
> Title:
> nova-manage network creation doesn't respect CIDR
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> The CIDR network size is not respected when creating a network... this
> is going to cause user confusion:
>
> root@openstack# bin/nova-manage network create
> Possible wrong number of arguments supplied
> network create: Creates fixed ips for host by range
> arguments: fixed_range=FLAG, [num_networks=FLAG],
> [network_size=FLAG], [vlan_start=FLAG],
> [vpn_start=FLAG], [fixed_range_v6=FLAG]
> 2011-03-23 08:42:13,991 CRITICAL nova [-] Fixed range in the form of 10.0.0.0/8 is required to create networks.
> ...
>
> (OK, so I'll specify my CIDR; I'll give openstack 10.3.0.0/16)
>
> root@openstack# bin/nova-manage network create 10.3.0.0/16
>
> (Looks good)
>
> root@openstack# bin/nova-manage network list
> network netmask start address DNS
> 10.3.0.0/24 255.255.255.0 10.3.0.3 None
>
>
> It created a /24, not a /16 as I asked :-(

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

I received some clarification from Vish about why this occurs.

nova-manage looks for num_networks && network_size flags, but if they are left out, it disregards the CIDR arg provided and instead uses the FLAGS.network_size (default to 256) && FLAGS.network_number (default to 1) to carve out the network. The reason for this as explained:

1. large networks such as /16 created without being split into smaller networks will take a very long to create, and the assumption is that nobody would ever use without being split
2. the idea is that you can provide one large subnet such as a /16 and not immediately want to split ALL the networks at the given time, and therefore the num_networks && network_size args are there for you to split off a smaller subset for immediate use and then carve out the rest at a later time.

Since the current behavior is the desired behavior, the problem is simply the conveying of it is confusing. My suggestion is perhaps just some verbosity such as an informative message explaining the default to /24 (when CIDR is larger than /24) , would alleviate some of the confusion.

Revision history for this message
John Tran (jtran) wrote :

Also, for further improvement, I think the network_size && number_networks should not be BOTH required , when attempting to split up a CIDR. one *or* the other should suffice. Also some improved error checking to see 'network_size' should be one of the divisibles of a CIDR such as 256, 128, 64, 32, 16, 8, 4, 2

Revision history for this message
John Tran (jtran) wrote :

Ignore the last comment i made about the network_size && number_networks args should not both be required. It actually doesn't require both , I must've fat fingered my command when testing.

I've submitted a branch that simply adds a warning message to help clarify when the CIDR is over-ridden by the default FLAG.network_size.

Changed in nova:
assignee: nobody → John Tran (jtran)
John Tran (jtran)
Changed in nova:
status: Confirmed → 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.