← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2039550] Re: [IPAM] During port bulk creation, if a "fixed_ip" request is incorrect, the previous IPAM allocations generated are not deleted

 

Reviewed:  https://review.opendev.org/c/openstack/neutron/+/898549
Committed: https://opendev.org/openstack/neutron/commit/71a7abb498fded6d8d60453074efdef9657f416e
Submitter: "Zuul (22348)"
Branch:    master

commit 71a7abb498fded6d8d60453074efdef9657f416e
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Sat Oct 14 18:37:43 2023 +0000

    Remove any IPAM allocation if port bulk creation fails
    
    During the port bulk creation, if an IPAM allocation fails (for
    example, if the IP address is outside of the subnet CIDR), the
    other IPAM allocations already created are deleted before raising
    the exception.
    
    Closes-Bug: #2039550
    Change-Id: I7fd6e38016d099c03f80874bfa1fb8bdaff8bd2c


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  [IPAM] During port bulk creation, if a "fixed_ip" request is
  incorrect, the previous IPAM allocations generated are not deleted

Status in neutron:
  Fix Released

Bug description:
  Related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2244365

  During the port bulk creation, before the port DB registers are
  created, there is a method that pre-creates the port MAC address and
  the IPAM allocations [1]. If one of the requested "fixed_ips" is
  incorrect (for example, the IP address is out of the subnet CIDR), the
  method will raise an exception. However, the IPAM allocations created
  previously will remain in the DB.

  Steps:
  $ openstack create network net1
  $ openstack subnet create --subnet-range 10.0.50.0/24 --network net1 snet1
  $ OS_TOKEN=`openstack token issue | grep "| id" | tr -s " " | cut -f4 -d" "`
  $ curl -H "X-Auth-Token:$OS_TOKEN" -X POST http://192.168.10.100:9696/networking/v2.0/ports
      -d '{"ports": [
        {"network_id": <net_id>,
         "fixed_ips": [{"subnet_id": <subnet_id>, "ip_address": "10.0.50.10"}]},
        {"network_id": <net_id>,
         "fixed_ips": [{"subnet_id": <subnet_id>, "ip_address": "10.0.51.20"}]}]}'

  
  Note that the second IP address 10.0.51.20 is not in the subnet CIDR 10.0.50.0/24. The IPAM allocation for 10.0.50.10 (the first request), will remain in the DB.

  [1]https://github.com/openstack/neutron/blob/2bc9c3833627da0dfdf901e15f78b9be397014e0/neutron/plugins/ml2/plugin.py#L1621-L1660

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



References