← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1912513] Re: Port creation fails with error IP already allocated but the IP is available

 

[Expired for neutron because there has been no activity for 60 days.]

** Changed in: neutron
       Status: Incomplete => Expired

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

Title:
  Port creation fails with error IP already allocated but the IP is
  available

Status in neutron:
  Expired

Bug description:
  Description:
  =================
  When trying to create a new port using an available IP in the allocation pool of a VLAN neutron network, creation fails with error:
  IP address 10.41.8.3 already allocated in subnet afb678c6-a152-4f1d-8d77-03b9167520cc

  
  Precondition:
  =================
  A port using the same IP was previously created and then deleted.

  How to reproduce:
  =================
  I have the following network:

  $ openstack network show e30b938b-210d-45c2-894c-95c0c5d08f79
  +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  | Field                     | Value                                                                                                                                          |
  +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  | admin_state_up            | UP                                                                                                                                             |
  | availability_zone_hints   |                                                                                                                                                |
  | availability_zones        |                                                                                                                                                |
  | created_at                | 2020-11-25T10:55:32Z                                                                                                                           |
  | description               |                                                                                                                                                |
  | dns_domain                |                                                                                                                                                |
  | id                        | e30b938b-210d-45c2-894c-95c0c5d08f79                                                                                                           |
  | ipv4_address_scope        | None                                                                                                                                           |
  | ipv6_address_scope        | None                                                                                                                                           |
  | is_default                | False                                                                                                                                          |
  | is_vlan_transparent       | None                                                                                                                                           |
  | location                  | cloud='', project.domain_id=, project.domain_name=, project.id='606e529ab1bc4b18a6d5dbf8735b9815', project.name=, region_name='us-test', zone= |
  | mtu                       | 1500                                                                                                                                           |
  | name                      | test                                                                                                                          |
  | port_security_enabled     | True                                                                                                                                           |
  | project_id                | 606e529ab1bc4b18a6d5dbf8735b9815                                                                                                               |
  | provider:network_type     | vlan                                                                                                                                           |
  | provider:physical_network | physnet1                                                                                                                                       |
  | provider:segmentation_id  | 2220                                                                                                                                           |
  | qos_policy_id             | None                                                                                                                                           |
  | revision_number           | 11                                                                                                                                             |
  | router:external           | External                                                                                                                                       |
  | segments                  | None                                                                                                                                           |
  | shared                    | False                                                                                                                                          |
  | status                    | ACTIVE                                                                                                                                         |
  | subnets                   | afb678c6-a152-4f1d-8d77-03b9167520cc                                                                                                           |
  | tags                      |                                                                                                                                                |
  | updated_at                | 2021-01-20T11:27:57Z                                                                                                                           |
  +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+

  And a subnet 
  $ openstack subnet show afb678c6-a152-4f1d-8d77-03b9167520cc
  +----------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  | Field                | Value                                                                                                                                          |
  +----------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  | allocation_pools     | 10.41.8.3-10.41.8.4                                                                                                                            |
  | cidr                 | 10.41.8.0/29                                                                                                                                   |
  | created_at           | 2020-11-25T10:55:34Z                                                                                                                           |
  | description          |                                                                                                                                                |
  | dns_nameservers      |                                                                                                                                                |
  | dns_publish_fixed_ip | None                                                                                                                                           |
  | enable_dhcp          | True                                                                                                                                           |
  | gateway_ip           | 10.41.8.1                                                                                                                                      |
  | host_routes          |                                                                                                                                                |
  | id                   | afb678c6-a152-4f1d-8d77-03b9167520cc                                                                                                           |
  | ip_version           | 4                                                                                                                                              |
  | ipv6_address_mode    | None                                                                                                                                           |
  | ipv6_ra_mode         | None                                                                                                                                           |
  | location             | cloud='', project.domain_id=, project.domain_name=, project.id='606e529ab1bc4b18a6d5dbf8735b9815', project.name=, region_name='us-test', zone= |
  | name                 | test-subnet                                                                                                                            |
  | network_id           | e30b938b-210d-45c2-894c-95c0c5d08f79                                                                                                           |
  | prefix_length        | None                                                                                                                                           |
  | project_id           | 606e529ab1bc4b18a6d5dbf8735b9815                                                                                                               |
  | revision_number      | 9                                                                                                                                              |
  | segment_id           | None                                                                                                                                           |
  | service_types        |                                                                                                                                                |
  | subnetpool_id        | None                                                                                                                                           |
  | tags                 |                                                                                                                                                |
  | updated_at           | 2021-01-20T11:27:57Z                                                                                                                           |
  +----------------------+------------------------------------------------------------------------------------------------------------------------------------------------+

  Create a port with a fixed ip:
  $ openstack port create --debug --network e30b938b-210d-45c2-894c-95c0c5d08f79 --fixed-ip subnet=test-subnet,ip-address=10.41.8.3 test-port

  Delete the same port 
  $ openstack port delete a7a37bbf-129a-4980-a6e8-268c62ea552d

  Try to create again the same port with same IP and creation fail
  $ openstack port create --debug --network e30b938b-210d-45c2-894c-95c0c5d08f79 --fixed-ip subnet=test-subnet,ip-address=10.41.8.3 test-port
  ConflictException: 409: Client Error for url: https://neutron.test.com:9696/v2.0/ports, IP address 10.41.8.3 already allocated in subnet afb678c6-a152-4f1d-8d77-03b9167520cc

  ipallocations table show that the IP is actually available:

  mysql> select * from ipallocations where network_id="e30b938b-210d-45c2-894c-95c0c5d08f79";
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  | port_id                              | ip_address | subnet_id                            | network_id                           |
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  | 319c6b0d-1970-485a-ade6-914b3fa6abc9 | 10.41.8.4  | afb678c6-a152-4f1d-8d77-03b9167520cc | e30b938b-210d-45c2-894c-95c0c5d08f79 |
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  1 row in set (0.00 sec)

  mysql> select * from ipallocations where subnet_id="afb678c6-a152-4f1d-8d77-03b9167520cc";
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  | port_id                              | ip_address | subnet_id                            | network_id                           |
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  | 319c6b0d-1970-485a-ade6-914b3fa6abc9 | 10.41.8.4  | afb678c6-a152-4f1d-8d77-03b9167520cc | e30b938b-210d-45c2-894c-95c0c5d08f79 |
  +--------------------------------------+------------+--------------------------------------+--------------------------------------+
  1 row in set (0.00 sec)

  Expected output
  =================
  Port is created successfully

  Actual output
  =================
  Port creation fails with:
  ConflictException: 409: Client Error for url: https://neutron.test.com:9696/v2.0/ports, IP address 10.41.8.3 already allocated in subnet afb678c6-a152-4f1d-8d77-03b9167520cc

  Version:
  =================
  This is a cloud bionic-ussuri using ovn deployed using charmed OpenStack

  Charms revisions:

  charm-neutron-api rev 288
  charm-neutron-api-plugin-ovn rev 1
  charm-ovn-central rev 1
  charm-ovn-chassis rev 4 

  neutron pkgs versions:
  ii  neutron-common                  2:16.1.0-0ubuntu1~cloud0 
  ii  neutron-fwaas-common            1:16.0.0-0ubuntu0.20.04.1~cloud0 
  ii  neutron-plugin-ml2              2:16.1.0-0ubuntu1~cloud0  
  ii  neutron-server                  2:16.1.0-0ubuntu1~cloud0  

  Perceived severity
  =================
  Critical

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


References