← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1855705] Re: Confusing logic in checks_for_create_and_rebuild when booting an instance

 

Reviewed:  https://review.opendev.org/698125
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=54f1056e9897e7a6090da85af820dbf6fb0ac959
Submitter: Zuul
Branch:    master

commit 54f1056e9897e7a6090da85af820dbf6fb0ac959
Author: xulei <xulei@xxxxxxxxxxxxxxxxxxxx>
Date:   Mon Dec 9 19:33:24 2019 +0800

    Optimization for nova-api _checks_for_create_and_rebuild
    
    When we boot a vm without metadata or inject_file, the param will be set to {} or [],
    in this way do not need check.
    
    Change-Id: Ib53fddbf2171aa018b69366817acc7aa2051d02a
    Closes-Bug: #1855705


** Changed in: nova
       Status: In Progress => 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/1855705

Title:
  Confusing logic in checks_for_create_and_rebuild when booting an
  instance

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========
  When we build an instance with no metadata or no injected_file(
  it's very common), I find nova-api will also check them and access
  to db for acquiring data. This will cause degradation of performance.

  nova/compute/api.py
  def _check_injected_file_quota(self, context, injected_files):
      if injected_files is None:
          return

  def _check_metadata_properties_quota(self, context, metadata=None):
      """Enforce quota limits on metadata properties."""
      if not metadata:
          metadata = {}

  Looking at those two method, when no metadata or injected_file needed,
  nova-api will pass {} (empty dictionary) for checking, the above two
  methods make me confused. I think we can make this more efficient.

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