Use subnetpool to create subnet failed when the min_prefixlen of subnetpool is not set

Bug #1816502 reported by wangwei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Undecided
wangwei

Bug Description

Creating a subnet is failed with a subnetpool when the min_prefixlen of subnetpool is not set.

[root@EXTENV-10-254-8-11 ~]# neutron subnetpool-create ww_v4_subnetpool1 --pool-prefix 172.1.0.0/16
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new subnetpool:
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| address_scope_id | |
| created_at | 2019-02-19T02:07:29Z |
| default_prefixlen | 8 |
| default_quota | |
| description | |
| id | cc490736-d912-4ccd-9919-cfd4f92f34d0 |
| ip_version | 4 |
| is_default | False |
| max_prefixlen | 32 |
| min_prefixlen | 8 |
| name | ww_v4_subnetpool1 |
| prefixes | 172.1.0.0/16 |
| project_id | f0561ceca7874b188e43266c60a65128 |
| revision_number | 0 |
| shared | False |
| tags | |
| tenant_id | f0561ceca7874b188e43266c60a65128 |
| updated_at | 2019-02-19T02:07:29Z |
+-------------------+--------------------------------------+
[root@EXTENV-10-254-8-11 ~]# neutron subnet-create --subnetpool ww_v4_subnetpool1 ww_v4_net1
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Failed to allocate subnet: Insufficient prefix space to allocate subnet size /8.
Neutron server returns request_ids: ['req-63d8430c-fa6e-4113-a59e-62a2bd97bb7e']

I think when the min_prefixlen is not set,it is better to set it to be the prefixken(16) of pool_prefix (172.1.0.0/16) by default.And when the min_prefixlen is set(as the following test result),it should be checked whether it is bigger than the min prefixlen of pool prefix.

[root@EXTENV-10-254-8-11 ~]# neutron subnetpool-create --min-prefixlen 16 --pool-prefix 172.2.0.0/24 ww_v4_subnetpool2
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new subnetpool:
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| address_scope_id | |
| created_at | 2019-02-18T09:33:12Z |
| default_prefixlen | 16 |
| default_quota | |
| description | |
| id | 9da2fc9c-dade-4399-a4a9-fd22df45d3b7 |
| ip_version | 4 |
| is_default | False |
| max_prefixlen | 32 |
| min_prefixlen | 16 |
| name | ww_v4_subnetpool2 |
| prefixes | 172.2.0.0/24 |
| project_id | f0561ceca7874b188e43266c60a65128 |
| revision_number | 0 |
| shared | False |
| tags | |
| tenant_id | f0561ceca7874b188e43266c60a65128 |
| updated_at | 2019-02-18T09:33:12Z |
+-------------------+--------------------------------------+
[root@EXTENV-10-254-8-11 ~]#
[root@EXTENV-10-254-8-11 ~]# neutron subnet-create --subnetpool ww_v4_subnetpool2 ww_v4_net1
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Failed to allocate subnet: Insufficient prefix space to allocate subnet size /16.
Neutron server returns request_ids: ['req-09744170-b8fb-42e9-ba77-1d63fa75de29']

wangwei (emma2019)
Changed in neutron:
assignee: nobody → wangwei (emma2019)
status: New → In Progress
Revision history for this message
James Denton (james-denton) wrote :

A fix for this merged a few weeks ago and may need to be backported:

https://bugs.launchpad.net/neutron/+bug/1754062
https://review.openstack.org/#/c/550558/

Revision history for this message
James Denton (james-denton) wrote :

My apologies - I do see it is a different bug. Disregard my previous comment!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: wangwei (emma2019) → Ryan Tidwell (ryan-tidwell)
Changed in neutron:
assignee: Ryan Tidwell (ryan-tidwell) → wangwei (emma2019)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by "Rodolfo Alonso <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/637811

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.