Convert Nova to use Oslo service infrastructure.

Convert Nova to use the Oslo versions of:
* Service
* Launchers

Also add Service timers to the Service ThreadGroup.

blueprint use-oslo-services

Change-Id: Id8ab017f4525afd69fed322311f2d5cc3b6d6f98
Test for remote directory creation before shutting down instance

This patch moves the creation of the directory on the migration target
earlier in the code path so we can catch failures like missing or incorrect
keypairs on the source and destination node.

This fixes part of bug #1061024 but not all of it yet.

Change-Id: I097cf007cdd8de0c9c3a9390cbc6dc202eddb2b5
Use prettyxml output

minidom's toprettyxml doesn't render well so using etree instead

Change-Id: Iad05d55cfb071b11cb6f6b30aa9f23f33fd8039c
Editable default quota support

Implement blueprint edit-default-quota

DocImpact

Using the class quotas named `default` as the default editable quotas.

We can use the following novaclient command to update default quota:

nova quota-class-update default <key> <value>

Change-Id: I5a5001fadcbd61d550ebd5bdc33613b0ffdf29b2
Add memorycache import into the oslo config.

Resolves bug 1181633.

Change-Id: I86af10a2bb0f8afa5e2cf0d14e1839b872c21c90
Make nova-api use servicegroup.API.service_is_up().

Fix bug 1168861

Change-Id: I1e7e8f7519ec627b96736f74ee7123d101973544
Added attribute 'ip' to server search options.

Allows all tenants to use attribute 'ip' in server search options.
For this fix, added attribute 'ip' to server search options.
Modified the existing test case to verify 'ip' search for all tenants.

Implements: blueprint add-attribute-ip-in-server-search-options

Change-Id: Ic24ee67d729f77d56c4fe3e1d4110865550c2154
Added validation for networks parameter value

A validation check is added for networks parameter value.
In server create request body, if networks parameter value
is not stored in a list then 'Bad networks format' error
is thrown with bad request exception.A new test case is
added to verify whether it is returning bad request exception
when invalid syntax is used.

Fixes: bug #1175683

Change-Id: I457a1626c56281f89d8c4a606ccc0d0e3aea05fa
Fixes encoding issues for nova api req body.

* Ensure utf-8 encoding for POST/PUT body for api requests
* As per https://wiki.openstack.org/wiki/Encoding.

Fixes bug #1180344

Change-Id: Iea0f16b0c024795fb3aee1cd38bb54ee9da6d90d
Fix resize when instance has no image

This patch makes it possible to resize an instance that has no image
supplied (was booted from volume), by avoiding calling the image service
and thus causing an uncaught exception, if there was no image suplied in
the first place.

Fixes bug: 1182114
blueprint: improve-boot-from-volume

Change-Id: I67d63a7aef699b555897582c74b04e857db7aafb
Merge "Added attribute 'ip' to server search options."
Merge "Editable default quota support"
Add ImageNotActive check for instance rebuild

We have a check in place on create to test whether the image is marked
as deleted in Glance that doesn't exist on the rebuild method. This
patch adds that check and tests, with a follow-on patch forthcoming to
refactor the code to a shared method.

Fixes bug 1180604

Change-Id: I1e75313a72d2197e83f7dacf6bcbd6750dd490cd
Adding tests for rebuild image checks

Create instance has tests arounds it's image-checks, this patch just ports
those tests over to the rebuild case.

Change-Id: Ibe982e478ec2c8b44e130c022c6d1d493d6d9674
Add requests requirement capped <1.2.1.

Fixes bug 1182271.

* tools/pip-requires: The requests library released 1.2.1 today
which brings in sphinx as a new dependency. One of sphinx's
transitive dependencies is on a newer version of jinja than is
provided in the python-jinja2 package on CentOS 6, and since nova's
unit tests allow site-packages in the venv for libvirt support this
cap is needed so that gate-nova-python26 will continue to work.
Because requests is actually a dependency of python-cinderclient but
is only breaking nova's unit tests, it has to be added and come
before python-cinderclient in the pip-requires list. A separate
change has been proposed to openstack/requirements which will need
to merge first. https://review.openstack.org/29850

Change-Id: Ia198192d6231f71272d3aa4f5942828a45d86ceb
Add notification for live migration

Fix bug 1167759

Currently, if live migration failed, nova compute did not send
notification, this causes other services such as nova-scheduler
to have no chance to do some operations

The fix add notification logic for live_migration like other
VM instance operations such as resize, run instance etc.

Change-Id: Iaf61f5268e07284fd7d69ff331ce3bacd380c02b
Sync latest RPC changes from oslo

Pulls in capped version support and RPC_API_NAMESPACE support for
RpcProxy.

Change-Id: I8334ed62c0ffd16a05b35bbcd4d9352538ab0243
set ERROR state when scheduler hits max attempts

Presently when scheduler raises NoValidHost due to max attempts
being reached, the instance remains in a build state.
Exception handler for NoValidHost in manager.run_instance() needs
request_spec[instance_uuids] to know which host to put into an
error state in _set_vm_state_and_notify().
schedule_run_instances() was popping instance_uuids from the
request_spec prior to a call to _schedule().
Changed pop of instance_uuids prior to call to _schedule() to be a get.
Added pop of instance_uuids to beneath call to _schedule() as
individual creates do not need them.

Change-Id: I9654820e01d5611763e9e673f15f46b947d09e6d
Fixes: bug #1182056
Fix missing argument to logging warning call

Change-Id: I04ff613e785b6b39476b7766b94c831d7e22148a
Sync RPC serializer changes from Oslo

Pulls in the serializer object and changes to the dispatcher and
proxy implementations to support it.

Needed for bp/rpc-support-for-objects

Change-Id: I349de94c80a183f244cbb10009b6922996cc4d82