Fail to boot vm when set AggregateImagePropertiesIsolation filter and add custom metadata in the Host Aggregate

Bug #1537062 reported by Xiaowei Qian
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Ed Leafe
Mitaka
Fix Released
Undecided
Alexey Stupnikov

Bug Description

Image has no custom metadata, should not affect the AggregateImagePropertiesIsolation filter

Reproduce steps:

(1) add Host Aggregate with custom metadata
+----+-----------+-------------------+--------------+------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-----------+-------------------+--------------+------------+
| 1 | linux-agg | - | 'controller' | 'os=linux' |
+----+-----------+-------------------+--------------+------------+

(2) add AggregateImagePropertiesIsolation filter
scheduler_default_filters = RetryFilter,AggregateImagePropertiesIsolation,AvailabilityZoneFilter,RamFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter

(3) boot vm and error log:
2016-01-22 21:00:10.834 ERROR oslo_messaging.rpc.dispatcher [req-1cded809-cfe6-4657-8e31-b494f1b3278d admin admin] Exception during messa
ge handling: ImageMetaProps object has no attribute 'os'
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", l
ine 143, in _dispatch_and_reply
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", l
ine 189, in _dispatch
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", l
ine 130, in _do_dispatch
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line
150, in inner
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher return func(*args, **kwargs)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/manager.py", line 78, in select_destin
ations
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher dests = self.driver.select_destinations(ctxt, spec_obj)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/filter_scheduler.py", line 53, in sele
ct_destinations
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher selected_hosts = self._schedule(context, spec_obj)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/filter_scheduler.py", line 113, in _sc
hedule
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher spec_obj, index=num)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/host_manager.py", line 532, in get_fil
tered_hosts
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher hosts, spec_obj, index)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/filters.py", line 89, in get_filtered_objects
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher list_objs = list(objs)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/filters.py", line 44, in filter_all
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher if self._filter_one(obj, spec_obj):
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/filters/__init__.py", line 26, in _filter_one
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher return self.host_passes(obj, filter_properties)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/scheduler/filters/aggregate_image_properties_isolation.py", line 48, in host_passes
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher prop = image_props.get(key)
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/nova/nova/objects/image_meta.py", line 540, in get
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher if not self.obj_attr_is_set(name):
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 658, in obj_attr_is_set
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher {'objname': self.obj_name(), 'attrname': attrname})
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher AttributeError: ImageMetaProps object has no attribute 'os'
2016-01-22 21:00:10.834 TRACE oslo_messaging.rpc.dispatcher

Tags: scheduler nova
Changed in nova:
assignee: nobody → Xiaowei Qian (xiaow-qian)
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/271401

Changed in nova:
status: New → In Progress
Revision history for this message
yuntongjin (yuntongjin) wrote :

there is similar bug reported several days ago:
https://bugs.launchpad.net/nova/+bug/1536050

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Xiaowei Qian (<email address hidden>) on branch: master
Review: https://review.openstack.org/271401

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

It looks like Xiaowei isn't working on that anymore. Back to the last status.

Changed in nova:
status: In Progress → New
assignee: Xiaowei Qian (xiaow-qian) → nobody
Ed Leafe (ed-leafe)
Changed in nova:
importance: Undecided → Low
assignee: nobody → Ed Leafe (ed-leafe)
Ed Leafe (ed-leafe)
Changed in nova:
status: New → Triaged
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/307496

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/307496
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=85a307d3385ecfd641d7842c6450325410f2d3ba
Submitter: Jenkins
Branch: master

commit 85a307d3385ecfd641d7842c6450325410f2d3ba
Author: EdLeafe <email address hidden>
Date: Mon Apr 18 21:36:09 2016 +0000

    Don't raise error when filtering on custom metadata

    Hosts can have custom metadata. There is no restriction on the key names
    used in this metadata, so we should not be raising an exception when
    checking for the existence of any metadata key.

    Originally worked on: https://review.openstack.org/#/c/271401

    Co-Authored-By: Xiaowei Qian <email address hidden>

    Closes-Bug: #1537062

    Change-Id: Ie5ff3c1847e9c4533822a77d443e4ce1fcf047fe

Changed in nova:
status: In Progress → Fix Released
ivano (l-ivan)
description: updated
tags: added: customer found
tags: added: customer-found
removed: customer found
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/349986

Revision history for this message
Alexey Stupnikov (astupnikov) wrote :

Removed MOS project from the list of affected products since I have opened separate bug #1608937. I will try to cherry-pick this issue to stable/mitaka and then sync it to MOS.

@l-ivan, please check my comment above ^^^

no longer affects: mos
tags: removed: customer-found
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/mitaka)

Reviewed: https://review.openstack.org/349986
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=53314c49047301df966409d5c834ada007c65d80
Submitter: Jenkins
Branch: stable/mitaka

commit 53314c49047301df966409d5c834ada007c65d80
Author: EdLeafe <email address hidden>
Date: Mon Apr 18 21:36:09 2016 +0000

    Don't raise error when filtering on custom metadata

    Hosts can have custom metadata. There is no restriction on the key names
    used in this metadata, so we should not be raising an exception when
    checking for the existence of any metadata key.

    Originally worked on: https://review.openstack.org/#/c/271401

    Co-Authored-By: Xiaowei Qian <email address hidden>

    Closes-Bug: #1537062

    Change-Id: Ie5ff3c1847e9c4533822a77d443e4ce1fcf047fe
    (cherry picked from commit 85a307d3385ecfd641d7842c6450325410f2d3ba)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 13.1.1

This issue was fixed in the openstack/nova 13.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0b3

This issue was fixed in the openstack/nova 14.0.0.0b3 development milestone.

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.