← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1391101] Re: Illogical use of "aggregate_instance_extra_specs" prefix in nova AggregateInstanceExtraSpecsFilter

 

Hi Bartosz.

When you add the metadata to the aggregate you don't need to add the
prefix. The prefix is only set in the flavors, to specify its scope
(i.e. that it should be matched against an aggregate).

So , when you did:

    nova flavor-key m1.nano set
aggregate_instance_extra_specs:cpu_info:vendor=Intel

You should have done:

    nova flavor-key m1.nano set cpu_info:vendor=Intel

** Changed in: nova
       Status: In Progress => Invalid

** Changed in: nova
     Assignee: Bartosz Fic (bartosz-fic) => (unassigned)

-- 
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/1391101

Title:
  Illogical use of "aggregate_instance_extra_specs"  prefix in nova
  AggregateInstanceExtraSpecsFilter

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  
  How to reproduce this bug

  1. Enable AggregateInstanceExtraSpecsFilter in /etc/nova/nova.conf by adding only 'AggregateInstanceExtraSpecsFilter' to scheduler_default_filters variable
  2. Example: Specify compute hosts with the same vendor: Intel

  # create new host-aggregate
  $ nova aggregate-create fast-io nova

  # set metadata for new created host-aggregate
  $ nova aggregate-set-metadata <aggregate_id> aggregate_instance_extra_specs:cpu_info:vendor=Intel

  # check aggregate details
  $ nova aggregate-details <aggregate_id>

  http://paste.openstack.org/show/131393/

  # add a host to an aggregate
  $ nova aggregate-add-host <aggregate_id> <host_name>

  # list of all flavors
  $ nova flavor-list

  # set metadata for flavor m1.nano
  $ nova flavor-key m1.nano set aggregate_instance_extra_specs:cpu_info:vendor=Intel

  # show details of m1.nano flavor
  $ nova flavor-show m1.nano

  http://paste.openstack.org/show/131394/

  # try to launch instance - as a tip: m1.nano flavor id = 42 :)
  $ nova boot --flavor <flavor_id> --image <image_id> <instance_name>

  
  For flavor we have metadata: "aggregate_instance_extra_specs:cpu_info:vendor=Intel"

  and

  For aggregate we have metadata:
  "aggregate_instance_extra_specs:cpu_info:vendor=Intel"

  and as a result we get.... "No valid host was found. There are not
  enough hosts available."

  What cases are good for 'AggregateInstanceExtraSpecsFilter' ?

  a)

  flavor metadata: cpu_info:vendor=Intel
  aggregate metadata: aggregate_instance_extra_specs:cpu_info:vendor=Intel

  (I think it is about backwards compatibility with extra specs?)

  b)

  flavor metadata: aggregate_instance_extra_specs:aggregate_instance_extra_specs:cpu_info:vendor=Intel
  aggregate metadata: aggregate_instance_extra_specs:cpu_info:vendor=Intel

  What is the problem ?

  Please take a look at the AggregateInstanceExtraSpecsFilter code
  (https://github.com/openstack/nova/blob/master/nova/scheduler/filters/aggregate_instance_extra_specs.py).

  The filter is looking for that prefix but in extra specs of flavor, not aggregate!
  Filter is matching metadata from flavor with metadata from host aggregate. 
  In the metadata from flavor prefix (aggregate_instance_extra_specs) is removed (if exist). 
  But it isn’t removed from aggregate metadata. 
  So if user doesn’t specify metadata on flavor in the form of: aggregate_instance_extra_specs:aggregate_instance_extra_specs:cpu_info:vendor (because first prefix is stripped from extra spec), 
  then the filter wouldn’t match any host.

  I'd like to disscuss about possible solution of this issue.
  Or maybe it is a feature and I didn't understand how AggregateInstanceExtraSpecsFilter should work ?

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


References