Bug 889877

Summary: quantum : two subnets can be created on the same network result with two ip address and gw to the same port
Product: Red Hat OpenStack Reporter: Ofer Blaut <oblaut>
Component: openstack-quantumAssignee: Gary Kotton <gkotton>
Status: CLOSED NOTABUG QA Contact: Ofer Blaut <oblaut>
Severity: low Docs Contact:
Priority: low    
Version: 2.0 (Folsom)CC: rkukura, ykaul
Target Milestone: snapshot3Keywords: Triaged
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-06 06:39:15 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Ofer Blaut 2012-12-23 14:10:43 EST
Description of problem:

quantum : two subnets can be created on the same network result with two ip address and gw to the same port

Version-Release number of selected component (if applicable):


How reproducible:

create one network with two different subnets

Steps to Reproduce:
1.subnet one 50.50.0.0/16
2.subnet two 4.0.0.0/10
3.
  
Actual results:

two fixed ip address are assgined to the same port 

Expected results:

one static ip address per port

Additional info:

Name
    None
ID
    56378df6-b5b3-418e-9a47-552bf2b079a6
Network ID
    6826e10b-cc4d-45a6-85dc-ee39581a9d31
Project ID
    7b1a127d60c44423a166ff7274330d20
Fixed IP
    IP address: 50.50.0.1, Subnet ID 9d0b3427-1bb3-429e-b291-c3e6abef3ba5
    IP address: 4.0.0.1, Subnet ID c64506c3-ab62-430a-8bb1-2467ffbd4819
Mac Address
    fa:16:3e:01:2a:00
Status
    ACTIVE
Admin State
    UP
Device ID
    dhcp449eab81-ba0d-553f-bdae-2ca00ffe2b7e-6826e10b-cc4d-45a6-85dc-ee39581a9d
Comment 2 Bob Kukura 2013-01-03 16:01:41 EST
We need to figure out what should happen when a nova instance is launched and a single network associated with that instance has multiple subnets. A single (flat provider) network with multiple subnets would seem useful, at least in providing parity with nova flat networking. Using such a network should work if a port is preconfigured with a single IP on one of the network's subnets and that port ID is passed in when the nova instance is created.
Comment 3 Gary Kotton 2013-02-05 11:36:09 EST
Hi,
I have created one network with two subnets:

+--------------------------------------+---------+--------------------------------------+
| id                                   | name    | subnets                              |
+--------------------------------------+---------+--------------------------------------+
| 48b10cb0-1610-4a06-96de-e62b8d2bbcae | private | b1b30781-979b-4bc4-95b7-548ac2adc153 |
|                                      |         | ce571d62-294b-452c-a60f-5e54167f1a2e |
+--------------------------------------+---------+--------------------------------------+

--------------------------------------+------+-------------+--------------------------------------------+
| id                                   | name | cidr        | allocation_pools                           |
+--------------------------------------+------+-------------+--------------------------------------------+
| b1b30781-979b-4bc4-95b7-548ac2adc153 |      | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| ce571d62-294b-452c-a60f-5e54167f1a2e |      | 20.0.0.0/24 | {"start": "20.0.0.2", "end": "20.0.0.254"} |
+--------------------------------------+------+-------------+--------------------------------------------+

When I launch a VM via : 
nova boot --image f17 --flavor 1 f1

Only one IP address is assigned for the port (10.0.0.4):
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                       |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| 0c5f174b-386b-4cf9-9c5b-5f727820caba |      | fa:16:3e:9e:39:40 | {"subnet_id": "b1b30781-979b-4bc4-95b7-548ac2adc153", "ip_address": "10.0.0.2"} |
|                                      |      |                   | {"subnet_id": "ce571d62-294b-452c-a60f-5e54167f1a2e", "ip_address": "20.0.0.2"} |
| 2a8b2927-9a1c-4f5b-b714-12d73a93c937 |      | fa:16:3e:58:93:ec | {"subnet_id": "b1b30781-979b-4bc4-95b7-548ac2adc153", "ip_address": "10.0.0.3"} |
| 064ecdcb-b9d1-4aff-8a95-98f829f68ac7 |      | fa:16:3e:18:83:97 | {"subnet_id": "b1b30781-979b-4bc4-95b7-548ac2adc153", "ip_address": "10.0.0.4"} |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+

When doing nova show:
[root@dhcp-4-83 ~(keystone_joe)]$ nova show 3586d32d-ecf7-4e60-a23b-ec5b14c41088
+------------------------+----------------------------------------------------------+
| Property               | Value                                                    |
+------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig      | MANUAL                                                   |
| OS-EXT-STS:power_state | 1                                                        |
| OS-EXT-STS:task_state  | None                                                     |
| OS-EXT-STS:vm_state    | active                                                   |
| accessIPv4             |                                                          |
| accessIPv6             |                                                          |
| config_drive           |                                                          |
| created                | 2013-02-05T18:32:34Z                                     |
| flavor                 | m1.tiny (1)                                              |
| hostId                 | 4ecf3a444b0ef618f7d3e440ea8640bd5b062facaa25756fedb0a184 |
| id                     | 3586d32d-ecf7-4e60-a23b-ec5b14c41088                     |
| image                  | f17 (d63845b7-b095-4c9f-a921-887270cf17d3)               |
| key_name               | None                                                     |
| metadata               | {}                                                       |
| name                   | f1                                                       |
| private network        | 10.0.0.4                                                 |
| progress               | 0                                                        |
| security_groups        | [{u'name': u'default'}]                                  |
| status                 | ACTIVE                                                   |
| tenant_id              | 68e56e8cd3334dbf821d1651ab4e63d1                         |
| updated                | 2013-02-05T18:32:41Z                                     |
| user_id                | 3f6bb7be2f904abab655ebdca720c9b1                         |
+------------------------+----------------------------------------------------------+

Can you please explain how I can reproduce the problem. More specifically please provide the nova command that you used.
Thanks
Gary
Comment 4 Gary Kotton 2013-02-06 06:39:15 EST
Hi,
This is not a bug. The Quantum DHCP port can have more than one subnet. This enables the DHCP agent to provide IP addresses from those subnets.
The Quantum plugin will ensure that only one IP address is allocated per port. At the moment the plugin will select the address from the subnet that has free IP's. Once the first subnet has allocated all of its IP's then IP addresses will be allocated from the additional subnet.
In short not a bug.
Thanks
Gary