Ask Your Question
0

duplicated VLAN IDs in db, is this is a bug?

asked 2011-01-26 12:28:02 -0500

salvatore-orlando gravatar image

I noticed there is no UNIQUE attribute on the vlan field in the networks table. Users are then allowed to create several networks with the same VLAN ID.

Example: nova-manage network create 10.0.1.0/24 1 256 100 nova-manage network create 10.0.2.0/24 1 256 100

results in two networks (10.0.1.0 and 10.0.2.0) using the same VLAN ID. Is this a desired behaviour? I reckon one of the goals of the VLAN network manager is to isolate traffic between different projects by providing distinct VLAN IDs.

Moreover, this can also create problems on the network node with dnsmasq: when an instance associated with the 10.0.1.0 network starts, dnsmasq will listen on its gateway address on br100; if then an instance associated with the 10.0.2.0 is started, this would kill the previous dnsmasq instance and start another one listening on the second network's gateway, still on br100, probably partially breaking networking for instances in the first network.

If this is actually something that needs to be addressed in the code, VlanManager.create_networks should guarantee the chosen VLAN ID (vlan_start + index) is available, otherwise pick the following ID until a free one is found; alternatively create_networks can return an error if the VLAN ID is already in use.

Thanks in advance, Salvatore

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2011-01-26 20:13:25 -0500

vishvananda gravatar image

sure. On Jan 26, 2011, at 12:12 PM, Salvatore Orlando wrote:

Question #142918 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+q...

Salvatore Orlando posted a new comment: Hi Vish, thanks for your reply.

I agree that multiple networks for a single project does not really work, and probably does not make really sense as well. My main point was that if nova-manage allows for adding two networks with the same VLAN id, two distinct projects migth end up being assigned the same VLAN id, and this can cause problems.

However, throwing an error if a network with the same VLAN id already exists should prevent this situation.

Shall I report a bug for that?

Salvatore


You received this question notification because you are a member of Nova Core, which is an answer contact for OpenStack Compute (nova).

edit flag offensive delete link more
0

answered 2011-01-26 20:31:17 -0500

salvatore-orlando gravatar image

Done! https://bugs.launchpad.net/nova/+bug/708278 (https://bugs.launchpad.net/nova/+bug/...)

Cheers, Salvatore

edit flag offensive delete link more
0

answered 2011-01-26 20:12:40 -0500

salvatore-orlando gravatar image

Hi Vish, thanks for your reply.

I agree that multiple networks for a single project does not really work, and probably does not make really sense as well. My main point was that if nova-manage allows for adding two networks with the same VLAN id, two distinct projects migth end up being assigned the same VLAN id, and this can cause problems.

However, throwing an error if a network with the same VLAN id already exists should prevent this situation.

Shall I report a bug for that?

Salvatore

edit flag offensive delete link more
0

answered 2011-01-26 16:28:38 -0500

vishvananda gravatar image

in vlan mode, the vlans are incremented automatically when the networks are created by specifying multiple networks when you create them. Multiple neworks for a single project doesn't really work. Perhaps to protect against user error we could throw an errro from nova-manage if a network with the vlan already exists. Multiple networks is something we should probably have to deal with with flatdhcp at the very least. As you said, if there are multiple networks with different rangese, dnsmasq will fail, so the easiest solution may be to actually create a different bridge for each network range and have multiple copies of dnsmasq listening.

Vish

On Jan 26, 2011, at 4:28 AM, Salvatore Orlando wrote:

New question #142918 on OpenStack Compute (nova): https://answers.launchpad.net/nova/+q...

I noticed there is no UNIQUE attribute on the vlan field in the networks table. Users are then allowed to create several networks with the same VLAN ID.

Example: nova-manage network create 10.0.1.0/24 1 256 100 nova-manage network create 10.0.2.0/24 1 256 100

results in two networks (10.0.1.0 and 10.0.2.0) using the same VLAN ID. Is this a desired behaviour? I reckon one of the goals of the VLAN network manager is to isolate traffic between different projects by providing distinct VLAN IDs.

Moreover, this can also create problems on the network node with dnsmasq: when an instance associated with the 10.0.1.0 network starts, dnsmasq will listen on its gateway address on br100; if then an instance associated with the 10.0.2.0 is started, this would kill the previous dnsmasq instance and start another one listening on the second network's gateway, still on br100, probably partially breaking networking for instances in the first network.

If this is actually something that needs to be addressed in the code, VlanManager.create_networks should guarantee the chosen VLAN ID (vlan_start + index) is available, otherwise pick the following ID until a free one is found; alternatively create_networks can return an error if the VLAN ID is already in use.

Thanks in advance, Salvatore


You received this question notification because you are a member of Nova Core, which is an answer contact for OpenStack Compute (nova).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-01-26 12:28:02 -0500

Seen: 49 times

Last updated: Jan 26 '11