← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1397087] [NEW] Bulk port create fails with conflict with some addresses fixed

 

Public bug reported:

In the bulk version of the port create request, multiple port creations
may be requested.

If there is a port without specifying an fixed_ip address, one is
assigned to it. If a later port requests the same address, a conflict is
detected and raised. The overall call's succeeds or fails depending on
which addresses from the pool are set to be assigned next, and the order
of the requested ports.

Steps to reproduce:

# neutron net-create test_fixed_ports
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e |
| name                      | test_fixed_ports                     |
| provider:network_type     | vxlan                                |
| provider:physical_network |                                      |
| provider:segmentation_id  | 4                                    |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | d42d65485d674e0a9d007a06182e46f7     |
+---------------------------+--------------------------------------+

# neutron subnet-create test_fixed_ports 10.0.0.0/24
Created a new subnet:
+------------------+--------------------------------------------+
| Field            | Value                                      |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr             | 10.0.0.0/24                                |
| dns_nameservers  |                                            |
| enable_dhcp      | True                                       |
| gateway_ip       | 10.0.0.1                                   |
| host_routes      |                                            |
| id               | 5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a       |
| ip_version       | 4                                          |
| name             |                                            |
| network_id       | af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e       |
| tenant_id        | d42d65485d674e0a9d007a06182e46f7           |
+------------------+--------------------------------------------+

# cat ports.data
{"ports": [
    {
        "name": "A",
        "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
    }, {
        "fixed_ips": [{"ip_address": "10.0.0.2"}],
        "name": "B",
        "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
    }   
]}  

# TOKEN='a valid keystone token'

# curl  -H 'Content-Type: application/json' -H 'X-Auth-Token: '$TOKEN -X POST "http://127.0.1.1:9696/v2.0/ports"; -d@xxxxxxxxxx
{"NeutronError": {"message": "Unable to complete operation for network af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e. The IP address 10.0.0.2 is in use.", "type": "IpAddressInUse", "detail": ""}}

Positive case:

# cat ports.data.rev 
{"ports": [
    {
        "name": "A",
        "fixed_ips": [{"ip_address": "10.0.0.2"}],
        "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
    }, {
        "name": "B",
        "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
    }
]}

# curl  -H 'Content-Type: application/json' -H 'X-Auth-Token: '$TOKEN -X POST "http://127.0.1.1:9696/v2.0/ports"; -d@xxxxxxxxxxxxxx
{"ports": [{"status": "DOWN", "binding:host_id": "", "name": "A", "admin_state_up": true, "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e", "tenant_id": "7b3e2f49d1fc4154ac5af10a4b9862c5", "binding:vif_details": {}, "binding:vnic_type": "normal", "binding:vif_type": "unbound", "device_owner": "", "mac_address": "fa:16:3e:16:1e:50", "binding:profile": {}, "fixed_ips": [{"subnet_id": "5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a", "ip_address": "10.0.0.2"}], "id": "75f5cdb7-5884-4583-9db1-73b946f94a04", "device_id": ""}, {"status": "DOWN", "binding:host_id": "", "name": "B", "admin_state_up": true, "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e", "tenant_id": "7b3e2f49d1fc4154ac5af10a4b9862c5", "binding:vif_details": {}, "binding:vnic_type": "normal", "binding:vif_type": "unbound", "device_owner": "", "mac_address": "fa:16:3e:8a:15:7f", "binding:profile": {}, "fixed_ips": [{"subnet_id": "5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a", "ip_address": "10.0.0.3"}], "id": "0e04e694-e573-474f-9c01-979c4967bdf8", "device_id": ""}]}

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1397087

Title:
  Bulk port create fails with conflict with some addresses fixed

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  In the bulk version of the port create request, multiple port
  creations may be requested.

  If there is a port without specifying an fixed_ip address, one is
  assigned to it. If a later port requests the same address, a conflict
  is detected and raised. The overall call's succeeds or fails depending
  on which addresses from the pool are set to be assigned next, and the
  order of the requested ports.

  Steps to reproduce:

  # neutron net-create test_fixed_ports
  Created a new network:
  +---------------------------+--------------------------------------+
  | Field                     | Value                                |
  +---------------------------+--------------------------------------+
  | admin_state_up            | True                                 |
  | id                        | af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e |
  | name                      | test_fixed_ports                     |
  | provider:network_type     | vxlan                                |
  | provider:physical_network |                                      |
  | provider:segmentation_id  | 4                                    |
  | shared                    | False                                |
  | status                    | ACTIVE                               |
  | subnets                   |                                      |
  | tenant_id                 | d42d65485d674e0a9d007a06182e46f7     |
  +---------------------------+--------------------------------------+

  # neutron subnet-create test_fixed_ports 10.0.0.0/24
  Created a new subnet:
  +------------------+--------------------------------------------+
  | Field            | Value                                      |
  +------------------+--------------------------------------------+
  | allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
  | cidr             | 10.0.0.0/24                                |
  | dns_nameservers  |                                            |
  | enable_dhcp      | True                                       |
  | gateway_ip       | 10.0.0.1                                   |
  | host_routes      |                                            |
  | id               | 5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a       |
  | ip_version       | 4                                          |
  | name             |                                            |
  | network_id       | af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e       |
  | tenant_id        | d42d65485d674e0a9d007a06182e46f7           |
  +------------------+--------------------------------------------+

  # cat ports.data
  {"ports": [
      {
          "name": "A",
          "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
      }, {
          "fixed_ips": [{"ip_address": "10.0.0.2"}],
          "name": "B",
          "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
      }   
  ]}  

  # TOKEN='a valid keystone token'

  # curl  -H 'Content-Type: application/json' -H 'X-Auth-Token: '$TOKEN -X POST "http://127.0.1.1:9696/v2.0/ports"; -d@xxxxxxxxxx
  {"NeutronError": {"message": "Unable to complete operation for network af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e. The IP address 10.0.0.2 is in use.", "type": "IpAddressInUse", "detail": ""}}

  Positive case:

  # cat ports.data.rev 
  {"ports": [
      {
          "name": "A",
          "fixed_ips": [{"ip_address": "10.0.0.2"}],
          "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
      }, {
          "name": "B",
          "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e"
      }
  ]}

  # curl  -H 'Content-Type: application/json' -H 'X-Auth-Token: '$TOKEN -X POST "http://127.0.1.1:9696/v2.0/ports"; -d@xxxxxxxxxxxxxx
  {"ports": [{"status": "DOWN", "binding:host_id": "", "name": "A", "admin_state_up": true, "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e", "tenant_id": "7b3e2f49d1fc4154ac5af10a4b9862c5", "binding:vif_details": {}, "binding:vnic_type": "normal", "binding:vif_type": "unbound", "device_owner": "", "mac_address": "fa:16:3e:16:1e:50", "binding:profile": {}, "fixed_ips": [{"subnet_id": "5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a", "ip_address": "10.0.0.2"}], "id": "75f5cdb7-5884-4583-9db1-73b946f94a04", "device_id": ""}, {"status": "DOWN", "binding:host_id": "", "name": "B", "admin_state_up": true, "network_id": "af3b3cc8-b556-4604-a4fe-ae9bffa8cd9e", "tenant_id": "7b3e2f49d1fc4154ac5af10a4b9862c5", "binding:vif_details": {}, "binding:vnic_type": "normal", "binding:vif_type": "unbound", "device_owner": "", "mac_address": "fa:16:3e:8a:15:7f", "binding:profile": {}, "fixed_ips": [{"subnet_id": "5369fb82-8ff6-4ec5-acf7-1d86d0ec9d2a", "ip_address": "10.0.0.3"}], "id": "0e04e694-e573-474f-9c01-979c4967bdf8", "device_id": ""}]}

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1397087/+subscriptions


Follow ups

References