Support specifying existing subnet uuid/name

Registered by hongbin

Currently, we rely on user-provided cidr to select the subnet from which the port creates. This approach has some limitations, i.e. overlapping cidr. This BP proposes to introduce driver-specific options (e.g. neutron.subnet.name/neutron.subnet.uuid) to allow users to specify a specific subnet.

Blueprint information

Status:
Complete
Approver:
Antoni Segura Puimedon
Priority:
Medium
Drafter:
hongbin
Direction:
Approved
Assignee:
Kien Nguyen
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Kien Nguyen
Completed by
Kien Nguyen

Related branches

Sprints

Whiteboard

Currently, users couldn't create two networks with the same cidr. For example:

$ neutron net-create test
$ neutron subnet-create test 10.2.0.0/24
$ neutron net-create test2
$ neutron subnet-create test2 10.2.0.0/24
$ docker network create -d kuryr --ipam-driver=kuryr --subnet 10.2.0.0/24 --gateway 10.2.0.1 -o neutron.net.name=test foo
$ docker network create -d kuryr --ipam-driver=kuryr --subnet 10.2.0.0/24 --gateway 10.2.0.1 -o neutron.net.name=test2 foo2
Error response from daemon: IpamDriver.RequestPool: Another pool with same cidr exist. ipam and network options not used to pass pool name

This proposal is about introducing an option to specify the subnet so that the ambiguity of two networks with same cidr can be resolved. For example:

$ docker network create ... -o neutron.subnet.uuid=xxx ... --ipam-opt neutron.subnet.uuid=xxx (with ipv4)
$ docker network create ... -o neutron.subnet.v6.uuid=xxx ... --ipam-opt neutron.subnet.v6.uuid=xxx (with ipv6)

For implementation, the main challenge is how to identify the right subnetpool given multiple subnetpools has the same prefixes. The suggested approach is to leverage tagging. In particular, we could tag the subnetpool with the uuid of the specified subnet, so that we could always find it if the subnet's uuid is given.

Gerrit topic: https://review.openstack.org/#q,topic:bp/proposes,n,z

Addressed by: https://review.openstack.org/499493
    Support specifying existing subnet uuid/name

Gerrit topic: https://review.openstack.org/#q,topic:bp/existing-subnet,n,z

Addressed by: https://review.openstack.org/504762
    Search for both name and tag if tag is given.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.