L3Policy check for subnet-prefix-length smaller than pool subnet

Bug #1416156 reported by puppet-py
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
Fix Released
Medium
Krishna Kothapalli

Bug Description

L3Policy can be created with a subnet-prefix-length greater than that of ip-pool subnet.
If this L3Policy is now referred inside a L2Policy which in turn used to create a PTG, then PTG creation will fail due failure in creating a subnet
"NoSubnetAvailable: No subnet is available from l3 policy's pool."

Find the sequence of steps:
=========================

test@localhost:~/devstack$ gbp l3policy-create b --ip-pool 1.1.1.0/24 --subnet-prefix-length 16
Created a new l3_policy:
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| description | |
| external_segments | {} |
| id | f4c7258d-76cb-4e5e-bfc8-41f49de56120 |
| ip_pool | 1.1.1.0/24 |
| ip_version | 4 |
| l2_policies | |
| name | b |
| routers | 0d234a6a-9713-4123-8b46-ea4acb9d8213 |
| shared | False |
| subnet_prefix_length | 16 |
| tenant_id | b3094e3ded7e4d6ea7b91b3641214a7a |
+----------------------+--------------------------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l2policy-create new --l3-policy b
Created a new l2_policy:
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| description | |
| id | 53c6c47c-ec65-4b74-80de-5941534d900b |
| l3_policy_id | f4c7258d-76cb-4e5e-bfc8-41f49de56120 |
| name | new |
| network_id | a12f6d59-dd80-42ab-9ab7-cf0fc6132b88 |
| policy_target_groups | |
| shared | False |
| tenant_id | b3094e3ded7e4d6ea7b91b3641214a7a |
+----------------------+--------------------------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp policy-target-group-create new --l2-policy new
Service Unavailable (HTTP 503) (Request-ID: req-3f88174f-1dbc-428f-8c86-71c6138756c7)
test@localhost:~/devstack$

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

The fix for this is that the subnet-prefix-length should never be allowed to be more than what can be accommodated in the ip_pool. There is a TODO in the code for this:
https://github.com/stackforge/group-based-policy/blob/master/gbpservice/neutron/db/grouppolicy/group_policy_db.py#L1031-L1040

Changed in group-based-policy:
importance: Undecided → Medium
milestone: none → kilo-gbp-1
assignee: nobody → Krishna Kothapalli (krishna-sunitha)
status: New → Confirmed
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (master)

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

Changed in group-based-policy:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (master)

Reviewed: https://review.openstack.org/153900
Committed: https://git.openstack.org/cgit/stackforge/group-based-policy/commit/?id=3fe372144e8c637dc499003df66ea9d478e10faf
Submitter: Jenkins
Branch: master

commit 3fe372144e8c637dc499003df66ea9d478e10faf
Author: Krishna Kothapalli <email address hidden>
Date: Sun Feb 8 16:17:30 2015 -0800

    L3P check subnet mask smaller than pool subnet

    Closes-Bug: 1416156

    Change-Id: Ie55892a4847dd98de171958848fc008e6cc1981b

Changed in group-based-policy:
status: In Progress → Fix Committed
Changed in group-based-policy:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/160902

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/juno)

Reviewed: https://review.openstack.org/160902
Committed: https://git.openstack.org/cgit/stackforge/group-based-policy/commit/?id=56af834fee36722ca8ff207cd72f11f199f1cf5a
Submitter: Jenkins
Branch: stable/juno

commit 56af834fee36722ca8ff207cd72f11f199f1cf5a
Author: Krishna Kothapalli <email address hidden>
Date: Sun Feb 8 16:17:30 2015 -0800

    L3P check subnet mask smaller than pool subnet

    Closes-Bug: 1416156

    Change-Id: Ie55892a4847dd98de171958848fc008e6cc1981b
    (cherry picked from commit 3fe372144e8c637dc499003df66ea9d478e10faf)

tags: added: in-stable-juno
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.