[Nova] ComputeCapacityFilter always reject irrelevant,self-defined specs

Bug #1683748 reported by Michael Kraynov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
MOS Maintenance

Bug Description

Please backport the following upstream bug https://bugs.launchpad.net/nova/+bug/1582589

When I enabe ComputeCapacityFilter:
If I define a irrelevant specs in flavor like key='x' value='y'
ComputeCapacityFilter will return flase,I can't create instances.

If I define a irrelevant specs like key='mykey:x' value='y'
ComputeCapacityFilter will return True

This means if I don't add a head string and a colon before my real key, ComputeCapacityFilter doesn't permit me to use it.

If this kind of specs is not allowed,I believe this should be refused in horizon or api,not in filter.

But when i read test_compute_capabilities_filters.py, I find it is permitted,but only for ComputeCapacityFilter's specs.

code:
    def test_compute_filter_pass_extra_specs_same_as_scope(self):
        # Make sure this still works even if the key is the same as the scope
        self._do_test_compute_filter_extra_specs(
            ecaps={'capabilities': 1},
            especs={'capabilities': '1'},
            passes=True)

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/nova (stable/mitaka)

Fix proposed to branch: stable/mitaka
Change author: yufei zhang <zhang.yufei@99cloud.net>
Review: https://review.fuel-infra.org/34468

Changed in mos:
status: Confirmed → In Progress
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/nova (9.0/mitaka)

Fix proposed to branch: 9.0/mitaka
Change author: yufei zhang <zhang.yufei@99cloud.net>
Review: https://review.fuel-infra.org/34469

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/nova (stable/mitaka)

Change abandoned by Roman Podoliaka <email address hidden> on branch: stable/mitaka
Review: https://review.fuel-infra.org/34468
Reason: oops, wrong branch

Changed in mos:
assignee: nobody → MOS Maintenance (mos-maintenance)
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/nova (9.0/mitaka)

Reviewed: https://review.fuel-infra.org/34469
Submitter: Pkgs Jenkins <email address hidden>
Branch: 9.0/mitaka

Commit: 59541cfc65d80f638342fc4441a5b6dc00aaaf75
Author: yufei zhang <zhang.yufei@99cloud.net>
Date: Mon Apr 24 10:35:33 2017

Allow irrelevant,self-defined specs in ComputeCapacityFilter

For backward compatibility, ComputeCapacityFilter treats extra spec
keys which contain no colons like 'x' the same as 'capabilities:x',
because hoststate doesn't contain attribute like x, this filter always
return False. So it causes conflict with
AggregateInstanceExtraSpecsFilter, and limits user to define extra spec
keys without colons.

This patch solves the conflict and keep it backward compatible.

This patch also joins two lines into one in method host_passes.

Closes-Bug: #1683748

Change-Id: Ia9e7c882bcee131e106e67dc46ed9ce1224e4c67

Changed in mos:
status: In Progress → Fix Committed
Revision history for this message
Ilya Bumarskov (ibumarskov) wrote :

Verified on 9.2 MU 2 (MOS_UBUNTU_ID = 9.0-2017-06-07-134421)

Changed in mos:
status: Fix Committed → Fix Released
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/nova (mcp/1.0/mitaka)

Fix proposed to branch: mcp/1.0/mitaka
Change author: yufei zhang <zhang.yufei@99cloud.net>
Review: https://review.fuel-infra.org/36363

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/nova (mcp/1.0/mitaka)

Change abandoned by Vladyslav Drok <email address hidden> on branch: mcp/1.0/mitaka
Review: https://review.fuel-infra.org/36363

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change restored on openstack/nova (mcp/1.0/mitaka)

Change restored by Vladyslav Drok <email address hidden> on branch: mcp/1.0/mitaka
Review: https://review.fuel-infra.org/36363

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/nova (mcp/1.0/mitaka)

Reviewed: https://review.fuel-infra.org/36363
Submitter: Pkgs Jenkins <email address hidden>
Branch: mcp/1.0/mitaka

Commit: 4527f3697b511091ee3f00afe5a7dd6f4b0df496
Author: yufei zhang <zhang.yufei@99cloud.net>
Date: Thu Aug 31 17:38:34 2017

Allow irrelevant,self-defined specs in ComputeCapacityFilter

For backward compatibility, ComputeCapacityFilter treats extra spec
keys which contain no colons like 'x' the same as 'capabilities:x',
because hoststate doesn't contain attribute like x, this filter always
return False. So it causes conflict with
AggregateInstanceExtraSpecsFilter, and limits user to define extra spec
keys without colons.

This patch solves the conflict and keep it backward compatible.

This patch also joins two lines into one in method host_passes.

PROD ticket: https://mirantis.jira.com/browse/PROD-14347

Closes-Bug: #1683748

Change-Id: Ia9e7c882bcee131e106e67dc46ed9ce1224e4c67

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.