Add additional documentation on extra spec operations.

Change-Id: I4f315f4454296231c79429b3ab326318bd5005fa
Closes-Bug: #1538243
This commit is contained in:
Andrei Ta 2016-02-18 15:09:03 -06:00
parent f13e5ab039
commit bd88709204
1 changed files with 39 additions and 2 deletions

View File

@ -37,8 +37,45 @@ enabled by default), the scheduler will only create a share on a backend
that reports capabilities that match the share type's un-scoped extra-spec
keys.
Refer to the CapabilitiesFilter for matching operators. For example, to
match a boolean capability the extra-spec value would be '<is> True'.
The CapabilitiesFilter uses the following for matching operators:
* No operator
This defaults to doing a python ==. Additionally it will match boolean values.
* **<=, >=, ==, !=**
This does a float conversion and then uses the python operators as expected.
* **<in>**
This either chooses a host that has partially matching string in the capability
or chooses a host if it matches any value in a list. For example, if "<in> sse4"
is used, it will match a host that reports capability of "sse4_1" or "sse4_2".
* **<or>**
This chooses a host that has one of the items specified. If the first word in
the string is <or>, another <or> and value pair can be concatenated. Examples
are "<or> 3", "<or> 3 <or> 5", and "<or> 1 <or> 3 <or> 7". This is for
string values only.
* **<is>**
This chooses a host that matches a boolean capability. An example extra-spec value
would be "<is> True".
* **=**
This does a float conversion and chooses a host that has equal to or greater
than the resource specified. This operator behaves this way for historical
reasons.
* **s==, s!=, s>=, s>, s<=, s<**
The "s" indicates it is a string comparison. These choose a host that satisfies
the comparison of strings in capability and specification. For example,
if "capabilities:replication_type s== dr", a host that reports replication_type of
"dr" will be chosen.
For vendor-specific capabilities (which need to be visible to the
CapabilityFilter), it is recommended to use the vendor prefix followed