Add additional filter documentation.

Fixes bug 1033599

Change-Id: Ib8789baa049343af3393535487b48a3ba142fe1b
This commit is contained in:
Lorin Hochstein
2012-08-17 23:11:53 -04:00
parent 1f9ce3295a
commit 65b9fbe0cf

View File

@@ -61,6 +61,7 @@ servicing the request (<literal>ComputeFilter</literal>).</para>
<section xml:id="scheduler-filters">
<?dbhtml stop-chunking?>
<title>Filters</title>
<para>When the Filter Scheduler receives a request for a resource, it first
applies filters to determine which hosts are eligible for
@@ -112,12 +113,24 @@ scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter
</para>
<para>The available filters are described below.</para>
<section xml:id="aggregateinstanceextraspecsfilter">
<title>AggregateInstanceExtraSpecsFilter</title>
<para>Matches properties defined in an instance type's extra specs against
admin-defined properties on a host aggregate</para>
</section>
<section xml:id="allhostsfilter">
<title>AllHostsFilter</title>
<para>This is a no-op filter, it does not eliminate any of the available
hosts.</para>
</section>
<section xml:id="archfilter">
<title>ArchFilter</title>
<para>Match the architecture from the image properties against the compute node's
permitted_instance_types.</para>
</section>
<section xml:id="availabilityzonefilter">
<title>
AvailabilityZoneFilter
@@ -127,6 +140,12 @@ scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter
zones in requests. </para>
</section>
<section xml:id="computecapabilitiesfilter">
<title>ComputeCapabilitiesFilter</title>
<para>Matches properties defined in an instance type's extra specs against
compute capabilities</para>
</section>
<section xml:id="computefilter">
<title>
ComputeFilter
@@ -233,6 +252,72 @@ isolated_images=342b492c-128f-4a42-8d3a-c5088cf27d13,ebd267a6-ca86-4d6c-9a0e-bd1
</para>
</section>
<section xml:id="jsonfilter">
<title>JsonFilter</title>
<para>The JsonFilter allows a user to construct a custom filter by passing a scheduler hint
in JSON format. The following operators are supported:<itemizedlist>
<listitem>
<para>=</para>
</listitem>
<listitem>
<para>&lt;</para>
</listitem>
<listitem>
<para>></para>
</listitem>
<listitem>
<para>in</para>
</listitem>
<listitem>
<para>&lt;=</para>
</listitem>
<listitem>
<para>>=</para>
</listitem>
<listitem>
<para>not</para>
</listitem>
<listitem>
<para>or</para>
</listitem>
<listitem>
<para>and</para>
</listitem>
</itemizedlist>The filter supports the following variables:<itemizedlist>
<listitem>
<para>$free_ram_mb</para>
</listitem>
<listitem>
<para>$free_disk_mb</para>
</listitem>
<listitem>
<para>$total_usable_ram_mb</para>
</listitem>
<listitem>
<para>$vcpus_total</para>
</listitem>
<listitem>
<para>$vcpus_used</para>
</listitem>
</itemizedlist>Using the <command>nova</command> command-line tool, use the
<literal>--hint</literal> flag:
<screen><userinput>$</userinput> <userinput>nova boot --image 827d564a-e636-4fc4-a376-d36f7ebe1747 --flavor
1 --hint query='[">=","$free_ram_mb",1024]' server1</userinput></screen>
With the API, use the <literal>os:scheduler_hints</literal> key:
<programlisting>
{
'server': {
'name': 'server-1',
'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavorRef': '1'
},
'os:scheduler_hints': {
'query': '[">=","$free_ram_mb",1024]',
}
}
</programlisting></para>
</section>
<section xml:id="ramfilter">
<title>RamFilter</title>
<para>Only schedule instances on hosts if there is sufficient RAM
@@ -294,11 +379,6 @@ ram_allocation_ratio=1.5
<section xml:id="simplecidraffinityfilter">
<title>SimpleCIDRAffinityFilter</title>
<warning>
<para>The SimpleCIDRAffinityFilter does not work properly in the Essex release.
See <link xlink:href="https://bugs.launchpad.net/nova/+bug/999928">bug
999928</link> for details.</para>
</warning>
<para>Schedule the instance based on host IP subnet range. To
take advantage of this filter, the requester must specify a
range of valid IP address in CIDR format, by passing two