[nova-manage][floating-ips] There is no way to delete floating ips pool.

Bug #1022237 reported by David Naori
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Mark McLoughlin

Bug Description

Description of problem:
While it is possible to create new pools its impossible to delete them.

# nova-manage floating create --ip_range=3.3.3.0/24 --pool=X

# nova-manage floating delete --ip_range=3.3.3.0/24
(There is no pool arg)

# nova floating-ip-pool-list
+-------+
| name |
+-------+
| X |
| nova |
+-------+

Version-Release number of selected component (if applicable):
openstack-nova-2012.1.1-2.el6.noarch

How reproducible:
100%

Thierry Carrez (ttx)
tags: added: network nova-manage
Revision history for this message
Mark McLoughlin (markmc) wrote :

Yep, the problem here seems to be that we include a pool in the listing even if all floating IPs in it have been deleted

This simple change fixes it for me:

     def floating_ip_get_pools(context):
       session = get_session()
       pools = []
  - for result in session.query(models.FloatingIp.pool).distinct():
  + for result in model_query(context, models.FloatingIp.pool).distinct():
           pools.append({'name': result[0]})
       return pools

Changed in nova:
status: New → In Progress
assignee: nobody → Mark McLoughlin (markmc)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/10268
Committed: http://github.com/openstack/nova/commit/6b69e63683c49900ac24038b60123a93925401db
Submitter: Jenkins
Branch: master

commit 6b69e63683c49900ac24038b60123a93925401db
Author: Mark McLoughlin <email address hidden>
Date: Wed Jul 25 08:50:17 2012 +0100

    Allow floating IP pools to be deleted

    Fixes bug #1022237

    If you delete all the floating IPs associated with a floating IP, the
    pool still shows up in os-floating-ip-pools extension.

    Fix this by using model_query() in the DB layer so that we ignore
    deleted floating IPs.

    Change-Id: I30d2e716e931400ca4b798b51bb26a73a7747808

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
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.