RequestAddress failed when using existing network which subnet have same cidrs with others

Bug #1651318 reported by Dongcan Ye
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-libnetwork
Fix Released
Undecided
Dongcan Ye

Bug Description

Precondition
============
Using kuryr-libnetwork existing neutron network feature

How to reproduce
================
1. Create two networks with two subnets with same cidrs:
# neutron net-create net0
# neutron subnet-create net0 10.9.0.0/24 --name net0_subnet
# neutron net-create net1
# neutron subnet-create net1 10.9.0.0/24 --name net1_subnet

2. Using existing neutron network and boot a container:
# docker network create -d kuryr --ipam-driver=kuryr --subnet=10.9.0.0/24 --gateway=10.9.0.1 -o neutron.net.name=net0 docker_net0

# docker run -it --net=docker_net0 busybox
docker: Error response from daemon: IpamDriver.RequestAddress: Subnet with cidr(10.9.0.0/24) and pool 8d6cce74-15cc-4c47-be3d-40e18d45f566, does not exist..

Dongcan Ye (hellochosen)
Changed in kuryr-libnetwork:
assignee: nobody → Dongcan Ye (hellochosen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kuryr-libnetwork (master)

Fix proposed to branch: master
Review: https://review.openstack.org/414455

Changed in kuryr-libnetwork:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kuryr-libnetwork (master)

Reviewed: https://review.openstack.org/414455
Committed: https://git.openstack.org/cgit/openstack/kuryr-libnetwork/commit/?id=01b5b55e92410768222081df086c4dfa6a378bde
Submitter: Jenkins
Branch: master

commit 01b5b55e92410768222081df086c4dfa6a378bde
Author: Dongcan Ye <email address hidden>
Date: Fri Dec 23 15:06:24 2016 +0800

    Add subnetpool_id tag for existing Neutron subnet

    In existing OpenStack environment, if we have two Neutron
    networks and subnets with same cidrs(this is normal in Neutron),
    then create Docker network using one of the existing Neutron network
    with same cidr, it will fails when we booting an container.
    In current code, we get subnets by cidr, then determine the subnet's
    subnetpool_id whether equal with the given PoolID. As we known,
    the existing Neutron subnet may missing subnetpool_id, so it will
    not get the correct subnet.

    This patch adds subnetpool_id tag for existing Neutron subnet.
    And in RequestAddress we will distinguish the subnet created by
    Kuryr and Neutron. In Neutron case we will determine if the pool_id
    in subnet tags or not.

    NOTE:
    Neutron tags extension for subnet is required by this patch,
    otherwise we will give a warning for users.

    Change-Id: I9500427c9fb3716976b888096f510ecbbd70ac13
    Closes-Bug: #1651318

Changed in kuryr-libnetwork:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to kuryr-libnetwork (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/420610

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to kuryr-libnetwork (master)

Reviewed: https://review.openstack.org/420610
Committed: https://git.openstack.org/cgit/openstack/kuryr-libnetwork/commit/?id=b079b9224b805122ada1b99b4f7976e08877dfb6
Submitter: Jenkins
Branch: master

commit b079b9224b805122ada1b99b4f7976e08877dfb6
Author: Dongcan Ye <email address hidden>
Date: Mon Jan 16 17:30:41 2017 +0800

    Optimize add subnetpool tag

    As per [1], it suggests pass subnet tag extension NotFound
    exception rather than call show extension API, this can
    save API call.

    [1] https://review.openstack.org/#/c/417275/

    Change-Id: I860dd87f69d55cfb98329c5e6d3c34fa3b854c50
    Related-Bug: #1651318

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.