[nova-manage][floating] Deletion process should continue when failing due to ip not found.

Bug #1021222 reported by David Naori
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Russell Bryant

Bug Description

Description of problem:

nova-mange floating delete fails when deleting ip range and one of the addresses does not exists.

* The command should print a warning and continue deleting the rest of the range.

e.g:

 # nova-manage floating create --ip_range=1.1.1.0/24
 # nova-manage floating delete 1.1.1.1
 # nova-manage floating delete 1.1.1.0/24

2012-07-05 12:12:33 CRITICAL nova [req-74930806-579b-4fdd-98e4-1d43ebc0743a None None] Floating ip not found for address 1.1.1.1.
2012-07-05 12:12:33 TRACE nova Traceback (most recent call last):
2012-07-05 12:12:33 TRACE nova File "/usr/bin/nova-manage", line 1746, in <module>
2012-07-05 12:12:33 TRACE nova main()
2012-07-05 12:12:33 TRACE nova File "/usr/bin/nova-manage", line 1733, in main
2012-07-05 12:12:33 TRACE nova fn(*fn_args, **fn_kwargs)
2012-07-05 12:12:33 TRACE nova File "/usr/bin/nova-manage", line 664, in delete
2012-07-05 12:12:33 TRACE nova str(address))
2012-07-05 12:12:33 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/api.py", line 266, in floating_ip_destroy
2012-07-05 12:12:33 TRACE nova return IMPL.floating_ip_destroy(context, address)
2012-07-05 12:12:33 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 120, in wrapper
2012-07-05 12:12:33 TRACE nova return f(*args, **kwargs)
2012-07-05 12:12:33 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 701, in floating_ip_destroy
2012-07-05 12:12:33 TRACE nova session=session)
2012-07-05 12:12:33 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 120, in wrapper
2012-07-05 12:12:33 TRACE nova return f(*args, **kwargs)
2012-07-05 12:12:33 TRACE nova File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 774, in floating_ip_get_by_address
2012-07-05 12:12:33 TRACE nova raise exception.FloatingIpNotFoundForAddress(address=address)
2012-07-05 12:12:33 TRACE nova FloatingIpNotFoundForAddress: Floating ip not found for address 1.1.1.1.
2012-07-05 12:12:33 TRACE nova

 # nova-manage floating list
None 1.1.1.2 None nova eth1
.
.
.
None 1.1.1.254 None nova eth1

Revision history for this message
David Naori (davidnaori3) wrote :
Revision history for this message
Russell Bryant (russellb) wrote :

Thanks for the patch! To get merged, it must be submitted through gerrit. See the developer section on http://wiki.openstack.org/HowToContribute for more information

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Russell Bryant (russellb)
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/9657

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

Reviewed: https://review.openstack.org/9657
Committed: http://github.com/openstack/nova/commit/42e785561e9c747cab41d74dbe90cad56e8eea14
Submitter: Jenkins
Branch: master

commit 42e785561e9c747cab41d74dbe90cad56e8eea14
Author: Russell Bryant <email address hidden>
Date: Wed Jul 11 13:57:41 2012 -0400

    Always attempt to delete entire floating IP range.

    Fix bug 1021222.

    This patch tweaks nova-manage to always attempt to delete all addresses
    in the specified IP range, even if an error is encountered. This is an
    easy way to handle a case where a range was created, but then a subset
    of that range was deleted. Otherwise, deleting the rest of the range is
    a pain.

    An example of this would be:

      # nova-manage floating create --ip_range=1.1.1.0/24
      # nova-manage floating delete 1.1.1.1
      # nova-manage floating delete 1.1.1.0/24

    Previously this would fail. Now it works.

    Change-Id: Ia01c04dee5383f597976c6a79d9a0d9e19985898

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
Sean Dague (sdague)
no longer affects: nova/essex
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.