← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1185190] Re: instance_type data cannot be extracted from sys_meta after instance deleted

 

Reviewed:  https://review.openstack.org/30954
Committed: http://github.com/openstack/nova/commit/04d9fb406783ba5934d9cb249550a92202555bc7
Submitter: Jenkins
Branch:    milestone-proposed

commit 04d9fb406783ba5934d9cb249550a92202555bc7
Author: Chris Behrens <cbehrens@xxxxxxxxxxxx>
Date:   Wed May 29 14:21:00 2013 +0000

    Don't delete sys_meta on instance delete
    
    Unfortunately, we require to access instance_system_metadata to get
    data (specifically at least instance_type data) for instances that have
    been deleted.
    
    There's 2 cases where this is true:
    
    1) nova-api supports showing deleting instances when you specify a
    'changes-since' param.
    2) The _usage_audit_log periodic task pulls all instances during the
    audit period, which includes instances that have been deleted during
    that period.
    
    This reverts commit 17bca438954638d74035d560e826a26a532b3ea3, which was
    attempting to fix a bug where we leave instance_system_metadata entries
    undeleted from the DB.  There's not an easy way to query for the deleted
    sys_meta data in an efficient manner, and leaving the entries undeleted is
    the lesser of the 2 evils for now.
    
    Fixes bug 1185190
    
    Change-Id: I898f0546c49126dcc56a4237120082f95dc82304
    (cherry picked from commit 4885aa28706a1858f4fc51a0d2c661eec05139c0)


** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1185190

Title:
  instance_type data cannot be extracted from sys_meta after instance
  deleted

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  This commit:

  ---
  commit 17bca438954638d74035d560e826a26a532b3ea3
  Author: Joe Gordon <jogo@xxxxxxxxxxxxxxxx>
  Date:   Wed Mar 13 16:58:13 2013 -0700

      Delete InstanceSystemMetadata on instance deletion

      Thanks to no-db-compute only pre-delete instance data is used in
      notifications. So now we can go back to deleting InstanceSystemMetadata
      when an instance is deleted.

      Fixes bug 1153827

      Change-Id: Ic66b998cde2a15a24f302f08c34753a8b57da73d
  ---

  Changed things so that we delete the instance_system_metadata entries
  for an instance when instance_destroy() is called.  However, the
  commit message turns out to be wrong, from what I can tell.  There's 2
  cases that need access to instance_type data that's stored in sys_meta
  AFTER an instance is deleted:

  1) The API.  If you specify 'changes-since', the API will return deleted instances.  The instance_type data needs to be extracted in order to form the API response
  2) _usage_audit_log() task in compute manager.  This task potentially queries for deleted instances in the past day to send audit information for them nightly.

  I don't have a traceback for #1 handy, but:

  Traceback for #2:

  Traceback (most recent call last):
    File "/meow/nova/compute/manager.py", line 3813, in _instance_usage_audit
          include_bandwidth=True
    File "/meow/nova/conductor/api.py", line 308, in notify_usage_exists
      system_metadata, extra_usage_info, include_bandwidth)
    File "/meow/nova/utils.py", line 1089, in wrapper
      return func(*args, **kwargs)
    File "/meow/nova/conductor/manager.py", line 405, in notify_usage_exists
          include_bandwidth)  File "/meow/nova/compute/utils.py", line 224, in notify_usage_exists
      system_metadata=system_metadata, extra_usage_info=extra_info)
    File "/meow/nova/compute/utils.py", line 250, in notify_about_instance_usage
      network_info, system_metadata, **extra_usage_info)
    File "/meow/nova/notifications.py", line 287, in info_from_instance
          instance_type = flavors.extract_instance_type(instance_ref)
    File "/meow/nova/compute/flavors.py", line 247, in extract_instance_type
      instance_type[key] = type_fn(sys_meta[type_key])
  KeyError: 'instance_type_memory_mb'

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1185190/+subscriptions