Support creating from existing neutron subnetpool
Right now, Kuryr has an option (neutron.pool.name) to specify the name of subnetpool, however, it is only used for handling overlapping cidr. This BP proposes to extend this option to support existing subnetpool. The logic is as following:
1. If pool name is specified, check if there is a subnetpool with the given name. If yes, use it. If no, create it.
2. When the pool is released, don't delete the subnetpool if it is a pre-existed subnetpool.
The implementation should be similar as existing-
Blueprint information
- Status:
- Complete
- Approver:
- Antoni Segura Puimedon
- Priority:
- Medium
- Drafter:
- hongbin
- Direction:
- Approved
- Assignee:
- hongbin
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- hongbin
- Completed by
- hongbin
Related branches
Related bugs
Sprints
Whiteboard
Currently, creating two networks with the same cidr will give a error:
$ docker network create --driver=kuryr --ipam-driver=kuryr --subnet 10.2.0.0/16 --gateway=10.2.0.1 --ip-range 10.2.0.0/24 foo
$ docker network create --driver=kuryr --ipam-driver=kuryr --subnet 10.2.0.0/16 --gateway=10.2.0.1 --ip-range 10.2.0.0/24 foo2
Error response from daemon: IpamDriver.
This error is because 'foo' and 'foo2' will try to create subnetpool with the same name (kuryrPool-
$ docker network create --driver=kuryr --ipam-driver=kuryr --subnet 10.2.0.0/16 --gateway=10.2.0.1 --ip-range 10.2.0.0/24 -o neutron.
In summary, the option 'neutron.pool.name' is currently used to specify a custom name for the subnetpool to be created.
This proposal is about extending this option to specify an existing subnetpool. I expect the usage pattern is as following:
$ neutron net-create test
$ neutron subnetpool-create --pool-prefix 10.2.0.0/16 testpool
$ neutron subnet-create --subnetpool testpool test 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.
The goal is allow users to pre-create resources (network/
Gerrit topic: https:/
Addressed by: https:/
[WIP] Support creating from existing subnetpool
Addressed by: https:/
Add prefix to specified name of subnetpool
Gerrit topic: https:/
Addressed by: https:/
[WIP] Support creating network with pool uuid
Addressed by: https:/
Add support for specified v6 subnetpool
Addressed by: https:/
[WIP] Process v6 pool's uuid option in create_network