ComputeCapacityFilter always reject irrelevant,self-defined specs

Bug #1582589 reported by octopuszhang on 2016-05-17
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
octopuszhang

Bug Description

Master branch 2016.5.17

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)

Changed in nova:
assignee: nobody → octopuszhang (1004988384-n)
Changed in nova:
status: New → In Progress
Changed in nova:
assignee: octopuszhang (1004988384-n) → Alex Xu (xuhj)
Changed in nova:
assignee: Alex Xu (xuhj) → octopuszhang (1004988384-n)

Reviewed: https://review.openstack.org/317306
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=83b59ea6035df173fb206167a4911f512fe22e64
Submitter: Jenkins
Branch: master

commit 83b59ea6035df173fb206167a4911f512fe22e64
Author: OctopusZhang <zhang.yufei@99cloud.net>
Date: Tue May 17 08:05:19 2016 +0000

    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.

    Change-Id: Ia9e7c882bcee131e106e67dc46ed9ce1224e4c67
    Closes-Bug: #1582589

Changed in nova:
status: In Progress → Fix Released

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  Edit
Everyone can see this information.

Other bug subscribers