Deleting Flavor currently in use by instance creates error

Bug #994935 reported by rfz
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Josh Kearney
Essex
Fix Released
High
Mark McLoughlin
nova (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned

Bug Description

When deleting an image flavor from horizon or nova-manage, that is currently assigned to a running instance, the following error occurs, and does not allow you to list instances within that project. A quick fix is to set 0 in the delete column in nova.instance_types.

2012-05-04 22:42:41 ERROR nova.api.openstack.wsgi [req-2fb168b2-754e-40e0-a9cd-55b0581c5246 35c31f5ca3a944a3b7c97894f7b0a8d6 9a6d3711310f4b368c4a1311e9dfdb63] Exception handling resource: 'NoneType' object has no attribute '__getitem__'
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 851, in _process_stack
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi action_result = self.dispatch(meth, request, action_args)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 926, in dispatch
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi return method(req=request, **action_args)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/servers.py", line 382, in detail
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi servers = self._get_servers(req, is_detail=True)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/servers.py", line 465, in _get_servers
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi return self._view_builder.detail(req, limited_list)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/views/servers.py", line 123, in detail
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi return self._list_view(self.show, request, instances)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/views/servers.py", line 127, in _list_view
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi server_list = [func(request, server)["server"] for server in servers]
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/views/servers.py", line 61, in wrapped
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi return func(self, request, instance)
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/views/servers.py", line 97, in show
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi "flavor": self._get_flavor(request, instance),
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/views/servers.py", line 172, in _get_flavor
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi flavor_id = instance["instance_type"]["flavorid"]
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi TypeError: 'NoneType' object has no attribute '__getitem__'
2012-05-04 22:42:41 TRACE nova.api.openstack.wsgi

Related branches

Revision history for this message
Sergio Rubio (rubiojr) wrote :

Bitten by this too.

It's worth mentioning that it nukes nova-api. Recreating the flavor doesn't help apparently and 'nova delete' or 'nova list' commands do not work after this.

Josh Kearney (jk0)
Changed in nova:
status: New → In Progress
assignee: nobody → Josh Kearney (jk0)
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/7712

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

Reviewed: https://review.openstack.org/7712
Committed: http://github.com/openstack/nova/commit/31506c0a252f06e283eecc54741f6a3062fbe913
Submitter: Jenkins
Branch: master

commit 31506c0a252f06e283eecc54741f6a3062fbe913
Author: Josh Kearney <email address hidden>
Date: Wed May 23 13:36:37 2012 -0500

    Permit deleted instance types to be queried for active instances.

    Fixes bug 994935.

    This removes the deleted=0 restriction for joining instance_types
    to instances. Active instances may be using old/deleted instance_types,
    so we still need to be able to look up that information for show/detail
    requests.

    Change-Id: Ica72801f19c7e5b04966e53ed3ea4c330df44ed1

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Revision history for this message
Mark McLoughlin (markmc) wrote :

This addresses the issue in essex: https://review.openstack.org/#/c/9710/

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

Reviewed: https://review.openstack.org/9710
Committed: http://github.com/openstack/nova/commit/4c7d671d21816f656068380e3b7a1415d98ba69c
Submitter: Jenkins
Branch: stable/essex

commit 4c7d671d21816f656068380e3b7a1415d98ba69c
Author: Soren Hansen <email address hidden>
Date: Wed May 23 13:36:37 2012 -0500

    Conditionally allow queries for deleted flavours

    Fixes bug #994935

    This is four commits from upstream squashed into one:

       31506c0 Permit deleted instance types to be queried for active
               instances. (By Josh Kearney)
       f6e62c6 API users should not see deleted flavors. (By Dan Prince)
       16d26af Revert "API users should not see deleted flavors." (By Josh
               Kearney)
       5157401 Do not always query deleted instance_types. (By Brian Lamar)

    It may seem strange to include both the change and the reversion of the
    change, but a) this is the most accurate way to reflect the history of
    the changes and b) the reversion actually includes new tests.

    Change-Id: Id231e9518ac176e29cc6241fff81705910dc9e9e

Dave Walker (davewalker)
Changed in nova (Ubuntu):
status: New → Fix Released
Changed in nova (Ubuntu Precise):
status: New → Confirmed
Revision history for this message
Adam Gandelman (gandelman-a) wrote : Verification report.

Please find the attached test log from the Ubuntu Server Team's CI infrastructure. As part of the verification process for this bug, Nova has been deployed and configured across multiple nodes using precise-proposed as an installation source. After successful bring-up and configuration of the cluster, a number of exercises and smoke tests have be invoked to ensure the updated package did not introduce any regressions. A number of test iterations were carried out to catch any possible transient errors.

Please Note the list of installed packages at the top and bottom of the report.

For records of upstream test coverage of this update, please see the Jenkins links in the comments of the relevant upstream code-review(s):

Trunk review: https://review.openstack.org/7712
Stable review: https://review.openstack.org/9710

As per the provisional Micro Release Exception granted to this package by the Technical Board, we hope this contributes toward verification of this update.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Test coverage log.

tags: added: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package nova - 2012.1.3+stable-20120827-4d2a4afe-0ubuntu1

---------------
nova (2012.1.3+stable-20120827-4d2a4afe-0ubuntu1) precise-proposed; urgency=low

  * New upstream snapshot, fixes FTBFS in -proposed. (LP: #1041120)
  * Resynchronize with stable/essex (4d2a4afe):
    - [5d63601] Inappropriate exception handling on kvm live/block migration
      (LP: #917615)
    - [ae280ca] Deleted floating ips can cause instance delete to fail
      (LP: #1038266)

nova (2012.1.3+stable-20120824-86fb7362-0ubuntu1) precise-proposed; urgency=low

  * New upstream snapshot. (LP: #1041120)
  * Dropped, superseded by new snapshot:
    - debian/patches/CVE-2012-3447.patch: [d9577ce]
    - debian/patches/CVE-2012-3371.patch: [25f5bd3]
    - debian/patches/CVE-2012-3360+3361.patch: [b0feaff]
  * Resynchronize with stable/essex (86fb7362):
    - [86fb736] Libvirt driver reports incorrect error when volume-detach fails
      (LP: #1029463)
    - [272b98d] nova delete lxc-instance umounts the wrong rootfs (LP: #971621)
    - [09217ab] Block storage connections are NOT restored on system reboot
      (LP: #1036902)
    - [d9577ce] CVE-2012-3361 not fully addressed (LP: #1031311)
    - [e8ef050] pycrypto is unused and the existing code is potentially insecure
      to use (LP: #1033178)
    - [3b4ac31] cannot umount guestfs (LP: #1013689)
    - [f8255f3] qpid_heartbeat setting in ineffective (LP: #1030430)
    - [413c641] Deallocation of fixed IP occurs before security group refresh
      leading to potential security issue in error / race conditions
      (LP: #1021352)
    - [219c5ca] Race condition in network/deallocate_for_instance() leads to
      security issue (LP: #1021340)
    - [f2bc403] cleanup_file_locks does not remove stale sentinel files
      (LP: #1018586)
    - [4c7d671] Deleting Flavor currently in use by instance creates error
      (LP: #994935)
    - [7e88e39] nova testsuite errors on newer versions of python-boto (e.g.
      2.5.2) (LP: #1027984)
    - [80d3026] NoMoreFloatingIps: Zero floating ips available after repeatedly
      creating and destroying instances over time (LP: #1017418)
    - [4d74631] Launching with source groups under load produces lazy load error
      (LP: #1018721)
    - [08e5128] API 'v1.1/{tenant_id}/os-hosts' does not return a list of hosts
      (LP: #1014925)
    - [801b94a] Restarting nova-compute removes ip packet filters (LP: #1027105)
    - [f6d1f55] instance live migration should create virtual_size disk image
      (LP: #977007)
    - [4b89b4f] [nova][volumes] Exceeding volumes, gigabytes and floating_ips
      quotas returns general uninformative HTTP 500 error (LP: #1021373)
    - [6e873bc] [nova][volumes] Exceeding volumes, gigabytes and floating_ips
      quotas returns general uninformative HTTP 500 error (LP: #1021373)
    - [7b215ed] Use default qemu-img cluster size in libvirt connection driver
    - [d3a87a2] Listing flavors with marker set returns 400 (LP: #956096)
    - [cf6a85a] nova-rootwrap hardcodes paths instead of using
      /sbin:/usr/sbin:/usr/bin:/bin (LP: #1013147)
    - [2efc87c] affinity filters don't work if scheduler_hints is None
      (LP: #1007573)
  ...

Read more...

Changed in nova (Ubuntu Precise):
status: Confirmed → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-2 → 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.