Comment 4 for bug 1670230

Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Confirmed on stable rocky release, the subnet pool update only allows to expand the existing prefixes:
https://github.com/openstack/neutron/blob/13.0.0/neutron/db/db_base_plugin_v2.py#L89

Note that set command automatically merges the included prefixes:
$ openstack subnet pool show testpool
[...]
| prefixes | 10.0.0.0/23, 20.0.0.0/24 |
$ openstack subnet pool set --pool-prefix 10.0.0.0/22 testpool
$ openstack subnet pool show testpool
[...]
| prefixes | 10.0.0.0/22, 20.0.0.0/24 |
$ openstack subnet pool unset --pool-prefix 10.0.0.0/23 testpool
Subnet pool does not contain prefix 10.0.0.0/23

No need to manually clean the inner prefixes.

The code was added in https://review.openstack.org/#/c/306253/ in a general round to add unset commands where missing, but for subnet pools, I would suggest to remove it, as the operation is not supported (and not needed as shown, expanding a subnet merges it in the newer larger one)