Introduce ImagePropertiesFilter scheduler filter

Commit d39137fa added functionality to the ComputeFilter to filter on
architecture, hypervisor_type, and vm_mode. The existing ArchFilter
already filtered on architecture. This patch merges the ComputeFilter
functionality introduced in d39137fa with the ArchFilter to create the
ImagePropertiesFilter.  The ImagePropertiesFilter uses image properties
specified in the request_spec to filter hosts.

This patch also adds the ImagePropertiesFilter to the list of default
filters specified by the scheduler_default_filters FLAG.

Fixes LP Bug #1037339

DocImpact

Change-Id: Ifa6fccf2db266b0fe3457d58fc81fdb50ffcbc0f
Remove hard-coded 'admin' role checking and use policy instead

bug 1037786

This change removed hard-coded 'admin' role checking, and use policy check to
decide is_admin at the time of context construction. And also set
default admin role to 'admin', in policy template, to keep backward
compatibility.

Change-Id: I56b45bfdfba1b8e1391bde7fec3d4cf26c66324c
Merge "Restore libvirt block storage connections on reboot."
Merge "Make missing imports flag in hacking settable."
Merge "Disable I18N in Nova's test suites"
Merge "Refactor extra specs matching into a new module"
Merge "Remove unused function in console api"
Merge "Fix spelling typos"
Merge "Move volume size validation to api layer."
Keep the ComputeNode model updated with usage

Keep the compute host's ComputeNode model in sync with the
level of resource usage.  This enables the ComputeNode
model to be used as a basis for scheduling decisions
rather than forcing scheduler to calculate free
resources from an instance_get_all on each request.

Resources like memory and disk are claimed as instances are built
or deleted.  There is also support for configurable compute node
stats (a generic key/value store) for extensible advertising of other
usage stats that may be useful for a particular scheduler
implementation.  Additionally, there is a periodic task on the
compute host that audits actual resource consumption at the virt
layer to ensure that the database stays in sync.

This change partially implements blueprint: scheduler-resource-race

This patch complements:
https://review.openstack.org/#/c/9540/  (build re-scheduling support)

Change-Id: Ibbe3839a054f8b80664b413d47f766ca8d68e3f2
Fix is_admin check via policy

When we create an admin context internally, we need to make sure
that all of the policy actions that are available to that context
are still available. This wasn't working in some cases because
we were looking for a hard-coded role called 'admin'.

Fixes bug 1039093

Change-Id: I939f834a63c9e6e6e7c87b115bd469466da66a69
Add key_name attribute in XML servers API

Fixes bug 1039139

The API was ignoring the 'key_name' attribute and so it was impossible to
create a server associated with a keypair. This patch fix the issue.

Change-Id: I1efe542081382f3a19b31c09ddfc93929b1485d0
Allow network to call get_fixed_ip_by_address.

Updates the default Nova policy.json so that the network
API can call get_fixed_ip_by_address.

This was something we identified when c6be78deb6a3a7cbf092efdfb54f561ce689605f
caused some regressions which prohibited the Nova metadata server from making
this call. We have subsequently fixed the metadata server by correcting
admin context access to this function.... however using an explicit policy rule
(and not relying on the default) seems like a good idea as well.

Partial fix for LP Bug #1039093.

Change-Id: I88d0f5a4dc263bf66f316a4d26c734b6bc9dad21
Merge "Fix PEP8 issues"
Merge "Add key_name attribute in XML servers API"
xenapi: Tag nova volumes during attach_volume

1. Set other_config:'osvol':'True' on VBD during attach.
2. Use this (instead of nodestroys list) to determine which volumes
should not be destroyed on instance terminate.
3. Ensure that the SRs for the attached volumes are forgotten when
instance is terminated.

In the virt/xenapi layer, there is no way to determine which of the
VDIs are nova volumes. This information is required when terminating
and instance, to ensure the volumes are kept intact, as well as other
operations like migrate.

Fixes bug 1030143.

Change-Id: Id1717e64bc29092ce9ffe13b7c254a3867fe8342
Merge "Allow network to call get_fixed_ip_by_address."
Merge "OpenStack capitalization added to HACKING.rst"
Merge "Makes sure instance deletion ok with deleted data"
Merge "Return HTTP 422 on bad server update PUT request."