Bug 1736019 - openstack subnet create --subnet-pool default --prefix-length 27 doesn't work but neutron subnet-create --name demo-subnet1 --subnetpool default --prefixlen 27 default does
Summary: openstack subnet create --subnet-pool default --prefix-length 27 doesn't work...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstacksdk
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Bernard Cafarelli
QA Contact: Candido Campos
URL:
Whiteboard:
Depends On: 1641421
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-01 14:24 UTC by Bernard Cafarelli
Modified: 2019-11-06 16:54 UTC (History)
12 users (show)

Fixed In Version: python-openstacksdk-0.17.2-0.20180809182657.3ad9dab.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1641421
Environment:
Last Closed: 2019-11-06 16:53:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 674046 0 None None None 2019-08-01 14:26:58 UTC
Red Hat Product Errata RHBA-2019:3747 0 None None None 2019-11-06 16:54:14 UTC

Description Bernard Cafarelli 2019-08-01 14:24:43 UTC
+++ This bug was initially created as a clone of Bug #1641421 +++

Description of problem:

When trying to allocate a prefix length to a subnet created from a subnet pool using the openstack unified command the default length is used every time and the --prefix-length value is ignored. 

It works fine with the neutron command and the use of --prefixlen (as per https://docs.openstack.org/python-neutronclient/pike/cli/neutron-reference.html)

Version-Release number of selected component (if applicable):
python-tripleoclient-9.2.3-4.el7ost.noarch

How reproducible:
Given the following subnetpool:

+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| address_scope_id  |                                      |
| created_at        | 2018-10-22T03:24:26Z                 |
| default_prefixlen | 28                                   |
| default_quota     |                                      |
| description       |                                      |
| id                | 139fd360-975a-4b4f-88bc-38ccdef765cb |
| ip_version        | 4                                    |
| is_default        | False                                |
| max_prefixlen     | 29                                   |
| min_prefixlen     | 26                                   |
| name              | demo-subnetpool                      |
| prefixes          | 192.168.128.0/18                     |
| project_id        | ca3e1d5878764cc8a2aa8c5d2336c1c1     |
| revision_number   | 0                                    |
| shared            | True                                 |
| tags              |                                      |
| tenant_id         | ca3e1d5878764cc8a2aa8c5d2336c1c1     |
| updated_at        | 2018-10-22T03:24:26Z                 |
+-------------------+--------------------------------------+

You should be able to do

openstack subnet create --subnet-pool demo-subnetpool --prefix-length 27 --network my_network my_name

and get a /27 subnet but instead you get a /28 (the default)

Steps to Reproduce:
1. create a subnetpool with max, min, and default prefix settings
neutron subnetpool-create --shared --pool-prefix 192.168.128.0/18  --default-prefixlen 28 --min-prefixlen 26 --max-prefixlen 29 demo-subnetpool
2. attempt to create a subnet from the pool using the openstack unified command, specifying a --prefix-length value
3. the --prefix-length will be ignored and the default is used.
4. doing the same with the neutron command (ie something like neutron subnet-create --name demo-subnet1 --ip_version 4 --subnetpool demo-subnetpool --prefixlen 27 test1) where --prefixlen is set WILL create a subnet with the /27 requested and NOT the default

Actual results:
--prefix-length is ignored and the default is given

Expected results:
--prefix-length is used

Comment 7 errata-xmlrpc 2019-11-06 16:53:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3747


Note You need to log in before you can comment on or make changes to this bug.