OS::Neutron::Subnet changing allocation_pools causes replacement

Bug #1510338 reported by Steve Baker
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
huangtianhua
Kilo
Fix Released
Undecided
Unassigned

Bug Description

Neutron allows an existing subnet to have its allocation pools changed, so heat needs to as well.

file:///home/steveb/dev/localstack/heat/doc/build/html/template_guide/openstack.html#OS::Neutron::Subnet-prop-allocation_pools

tags: added: kilo-backport-potential liberty-backport-potential
Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Revision history for this message
Zane Bitter (zaneb) wrote :

It's not 100% clear that this is the Right Thing - if the subnet has existing ports that are in the old range but not the new one, I suspect Neutron will still fail. I'd suggest that where the old and new CIDRs are disjoint, we should probably still replace them. If the new range is a strict superset of the old one, we should probably always allow it without replacement though. When there's some overlap but it's not a strict superset, there's probably no right answer :/

Revision history for this message
huangtianhua (huangtianhua) wrote :

@Zane Bitter:
The allocation_pools of subnet are ip pools that used to assign ip address automatically to port if user don't specify the ip_address(when port creation), other ips outside the allocation_pools also belong to the subnet, and we can assign them to port if specified when port-create.
And if there is any port in subnet, we can't delete the subnet, this means we can't replace the subnet in this situation.
Also, I think it's not good to do these complex logic validation in heat, if neutron doesn't allow to update the allocation_pools in some situations, we just to raise the error and set to stack to FAILED, right?

In fact, there is an other case I don't know how to do fix when updating the allocation_pools in my patch:
1. subnet-create: If user don't specify 'allocation_pools' property in template, we won't pass the parameter to neutron, so neutron set the allocation_pools with default start ip_address and end ip_address. ------ok
2. to update the allocation_pools with some ranges [{start: ip1, end: ip2}, ...] -------ok
3. to update again, don't specify 'allocation_pools' property in template again, what should I do now? if to pass allocation_pools=[](or None) to neutron, then the subnet will no allocation_pools(the behavior is not the same as creation); if not pass the 'allocation_pools' to neutron, neutron won't update the allocation_pools.

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

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
Zane Bitter (zaneb) wrote :

Ah yeah, I forgot that the subnet is assigned completely implicitly, and there's no way to force a port to move from one Subnet to another (which would make replace work). So you're right, this is probably the best thing to do.

Adding this to my "reasons the Neutron API is awful" file :(

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

Reviewed: https://review.openstack.org/240178
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=46602063c2ad9fb2af28307a3d4d808652883c28
Submitter: Jenkins
Branch: master

commit 46602063c2ad9fb2af28307a3d4d808652883c28
Author: huangtianhua <email address hidden>
Date: Thu Oct 29 17:38:01 2015 +0800

    Allow 'allocation_pools' updatable for neutron subnet

    Allow to update the 'allocation_pools' for neutron
    subnet resource.

    Change-Id: I26f96f712dfa9405814e26a06668db7a608e84b8
    Closes-Bug: #1510338

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/242180

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/242181

Revision history for this message
Zane Bitter (zaneb) wrote :

Note: there was a follow-up bug caused by this patch, bug 1511909.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/242180
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=2f2b4e0bd0d2d309ab1a957c359c5fd49a79fa46
Submitter: Jenkins
Branch: stable/liberty

commit 2f2b4e0bd0d2d309ab1a957c359c5fd49a79fa46
Author: huangtianhua <email address hidden>
Date: Thu Oct 29 17:38:01 2015 +0800

    Allow 'allocation_pools' updatable for neutron subnet

    Allow to update the 'allocation_pools' for neutron
    subnet resource.

    Change-Id: I26f96f712dfa9405814e26a06668db7a608e84b8
    Closes-Bug: #1510338
    (cherry picked from commit 46602063c2ad9fb2af28307a3d4d808652883c28 and
                               b7d70c33d10a1357fd83b43a87d0d39fc1dd0c14)

tags: added: in-stable-liberty
tags: removed: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/242181
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=ac059ddf42832277b953a44320902abe52ae85bd
Submitter: Jenkins
Branch: stable/kilo

commit ac059ddf42832277b953a44320902abe52ae85bd
Author: huangtianhua <email address hidden>
Date: Thu Oct 29 17:38:01 2015 +0800

    Allow 'allocation_pools' updatable for neutron subnet

    Allow to update the 'allocation_pools' for neutron
    subnet resource.

    Change-Id: I26f96f712dfa9405814e26a06668db7a608e84b8
    Closes-Bug: #1510338
    (cherry picked from commit 46602063c2ad9fb2af28307a3d4d808652883c28 and
                               b7d70c33d10a1357fd83b43a87d0d39fc1dd0c14)

tags: added: in-stable-kilo
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

This issue was fixed in the openstack/heat 6.0.0.0b1 development milestone.

Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 5.0.1

This issue was fixed in the openstack/heat 5.0.1 release.

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.