`nova-manage fixed list` fails if network has been deleted

Bug #1021810 reported by Byron McCollum
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Tong Li
nova (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Bug 754900 fixes a long standing issue of not deleting from fixed_ips when a network is deleted. However, the manner in which it "deletes" a fixed_ip (by setting the deleted column to true) is inconsistent with how the network is deleted (by actually deleting the record). Running `nova-manage fixed list` does not seem to honor the deleted column of fixed_ips, and proceeds to complain about the non-existent network.

The networks table has a deleted column, but it doesn't seem to be used. For the sake of audit-ability (hence the deleted column), shouldn't deleting a network just mark it as deleted, and all tools modified to honor the deleted state? If audit-ability is handled in another manner, shouldn't the fixed_ips records be deleted, as the associated network is?

Step to reproduce:

$ sudo nova-manage network list

id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
1 10.0.19.0/24 None 10.0.19.3 None None 100 tenant1 99658bf1-f2fc-46ce-9adf-83bd7f7cdb72
2 10.1.19.0/24 None 10.1.19.3 None None 101 tenant2 dd660168-81b8-4b6f-b054-a5d1b8d5b293

$ sudo nova-manage network modify 10.0.19.0/24 --disassociate-project
$ sudo nova-manage network delete 10.0.19.0/24
$ sudo nova-manage network list

id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
2 10.1.19.0/24 None 10.1.19.3 None None 101 tenant2 dd660168-81b8-4b6f-b054-a5d1b8d5b293

$ sudo nova-manage fixed list

network IP address hostname host
Command failed, please check log for more info
2012-07-06 11:04:31 CRITICAL nova [req-1de63acb-5a4b-40f0-9aee-53e86806dbee None None] Network 1 could not be found.
2012-07-06 11:04:31 TRACE nova Traceback (most recent call last):
2012-07-06 11:04:31 TRACE nova File "/usr/bin/nova-manage", line 1746, in <module>
2012-07-06 11:04:31 TRACE nova main()
2012-07-06 11:04:31 TRACE nova File "/usr/bin/nova-manage", line 1733, in main
2012-07-06 11:04:31 TRACE nova fn(*fn_args, **fn_kwargs)
2012-07-06 11:04:31 TRACE nova File "/usr/bin/nova-manage", line 584, in list
2012-07-06 11:04:31 TRACE nova fixed_ip['network_id'])
2012-07-06 11:04:31 TRACE nova File "/usr/lib/python2.7/dist-packages/nova/db/api.py", line 755, in network_get
2012-07-06 11:04:31 TRACE nova return IMPL.network_get(context, network_id)
2012-07-06 11:04:31 TRACE nova File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 120, in wrapper
2012-07-06 11:04:31 TRACE nova return f(*args, **kwargs)
2012-07-06 11:04:31 TRACE nova File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 1933, in network_get
2012-07-06 11:04:31 TRACE nova raise exception.NetworkNotFound(network_id=network_id)
2012-07-06 11:04:31 TRACE nova NetworkNotFound: Network 1 could not be found.
2012-07-06 11:04:31 TRACE nova

Versions:

Ubuntu - 12.04 LTS
Nova - 2012.1+stable~20120612-3ee026e-0ubuntu1.1

description: updated
description: updated
Revision history for this message
Tong Li (litong01) wrote :

The problem is that in nova-manage, the code catches exception.NetworkNotFound and blindly say "Command failed, please check log for more info" regardless what the exception might be.

With latest code as July 17, 2012, in the scenario you described, the following command will both produce that error.

with latest code, July 17, 2012,

$nova-manage fixed list
network IP address hostname host
10.0.0.0/24 10.0.0.0 None None
10.0.0.0/24 10.0.0.1 None None
10.0.0.0/24 10.0.0.2 None None
10.0.0.0/24 10.0.0.3 None None
10.0.0.0/24 10.0.0.4 None None

$nova-manage network list
id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
1 10.0.0.0/24 None 10.0.0.2 8.8.4.4 None None None 0440a6eb-9407-4aeb-a9db-05c38211ee0a

$nova-manage network delete 10.0.0.0/24

$nova-manage fixed list
network IP address hostname host
Command failed, please check log for more info

$ nova-manage network list
id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
Command failed, please check log for more info

The fixes should be in file nova/bin/nova-manage

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nova (Ubuntu):
status: New → Confirmed
Mark McLoughlin (markmc)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
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/9967

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

Reviewed: https://review.openstack.org/9967
Committed: http://github.com/openstack/nova/commit/458a5d61eac5eb5cef34ab301b67fa37271ba407
Submitter: Jenkins
Branch: master

commit 458a5d61eac5eb5cef34ab301b67fa37271ba407
Author: Tong Li <email address hidden>
Date: Wed Jul 18 11:26:12 2012 -0400

    fixes for nova-manage network list if network has been deleted

    this fix addresses the bug #1021810
    Currently command 'nova-manage network list' or
    'nova-manage fixed list' will return 'Command failed.' message when
    there is no network defined or networks get deleted. This fix combined
    with fixes to bug 1025827 will fix both command problem.
    also change the print out message so that it can be translated.
    code structure changes according to the suggestion from comments.

    Change-Id: Id9a1a10217aac971cbbba9db5829c8478892db1a

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