Fixes errors on start/stop unittest

The action name is incorrect on stop unittest, we should use "stop"
instead of "start".

Change-Id: I973e4f4591945f225e374797aebd1bbe00c3c9bd
Closes-Bug: #1257222
baremetal: set capabilites explicitly

ComputeDriver, base class of compute drivers, has dict capabilities
to show if the compute driver implements some functions. Compute
manger will check this with capabilities['has_imagecache'] or
capabilities['supports_recreate'] directly. If use compute driver
baremetal, there is code path leading KeyError. Let set capabilites
explicitly to avoid this.

Partial-Bug: #1261636

Change-Id: I5097d271df0d6ad419f530787d890288163d06c5
Fixing availability-zone not take effect error

when add/remove a host to one aggregate or update aggregate
metadata incluing availability_zone, "OS-EXT-AZ:availability_zone"
property of some instances in the host can not show correctly.

The cause is that when getting availability_zone of one instance,
it will try to get the value from cache first, but unfortunately
the cache does not update or reset in time, and it will keep one
hour if we do not change it.

This patch will add update or reset after adding/removing a host
to one aggregate or updating aggregate metadata including
availability_zone.

Change-Id: I5dd07f876471b5faf8fb1016e25a861124b7cb6f
Closes-bug: #1240374
libvirt: Configuration element for sVirt support

This configuration is need to allow users to enable sVirt support,
which is by default disabled for lxc.

In addition to a dynamic configuration, the users will be able to
provide a base label

Partially implements: blueprint libvirt-enable-lxc-svirt
Change-Id: Iacb6fcfb66379fbae900e8e9909377bf5ce18409
Removes XML namespace definitions from V3 API plugins

Removes the XML namespace definitions from the V3 API
plugins declarations. Deliberately avoids removing
the XML namespace definition from admin_actions to avoid
yet another rebase of the admin_actions split series.

Fixes up associated tests and requirement for V3 API extensions
to define a namespace property.

Partially implements blueprint remove-v3-xml-api

Change-Id: If3e1314cefdc1abcdd5eca44bcc2282cac664f05
Adds pause server extension for V3 API

Moves the pause/unpause server functionality out of admin_actions into
its own extension. This part of the blueprint v3-api-admin-actions-split
allows more selective enablement of features contained in the admin
actions extension.

Note that XML api samples are no longer generated because
bp remove-v3-xml-api has been approved.

Partially implements bp v3-api-admin-actions-split
DocImpact: Adds os-pause-server extension and moves pause/unpause
functionality out of os-admin-actions into this new extension

Change-Id: Ib9cce57e2ff1270a82b9d7e39b23ec6b532b9e77
Adds suspend server extension for V3 API

Moves the suspend/resume server functionality out of admin_actions into
its own extension. This part of the blueprint v3-admin-actions-split
allows more selective enablement of features contained in the admin
actions extension.

Note that XML api samples are no longer generated because
bp remove-v3-xml-api has been approved.

Partially implements bp v3-admin-actions-split
DocImpact: Adds os-suspend-server extension and moves suspend/resume
functionality out of os-admin-actions into this new extension

Change-Id: Ie2ad1c6085d65fee397d6ad5b5c9f3bd8e82ad3c
Add FixedIP Object implementation

This adds the FixedIP object implementation to allow nova-network
to perform these operations with an object.

Related to nova-network-objects

Change-Id: I262b316e3c509f3a5ea6629e74b62011c7d35ba4
Add FloatingIP object implementation

This adds a FloatingIP object for use by nova-network.

Related to blueprint nova-network-objects

Change-Id: I22832c7d22af2fbd45bac790286ad2f4ce2e1fd6
Add FixedIP.floating_ips dynamic property

This adds a lazy-loading FixedIP.floating_ips property which mimics
the use of the backref between the two objects in the SQLAlchemy
model. This doesn't introduce a new database query because it was
being used as a lazy-load in network manager already.

Related to blueprint nova-network-objects

Change-Id: I2f13f7a0463486e51c2317e02c2e7b378ac9e55d
Make nova-network use FixedIP for get_by_address() queries

This makes nova-network use the FixedIP object for get_by_address()
queries.

This also fixes a bug in test_manager that incorrectly had
fixed_ip.network_id as a UUID string in the fake IP objects.

Related to blueprint nova-network-objects

Change-Id: I732e4d7df76e5ae7bd010dfa6b0d8f8dd0c69454
Port to oslo.messaging

The oslo.messaging library takes the existing RPC code from oslo and
wraps it in a sane API with well defined semantics around which we can
make a commitment to retain compatibility in future.

The patch is large, but the changes can be summarized as:

  * oslo.messaging>=1.3.0a4 is required; a proper 1.3.0 release will be
    pushed before the icehouse release candidates.

  * The new rpc module has init() and cleanup() methods which manage the
    global oslo.messaging transport state. The TRANSPORT and NOTIFIER
    globals are conceptually similar to the current RPCIMPL global,
    except we're free to create and use alternate Transport objects
    in e.g. the cells code.

  * The rpc.get_{client,server,notifier}() methods are just helpers
    which wrap the global messaging state, specifiy serializers and
    specify the use of the eventlet executor.

  * In oslo.messaging, a request context is expected to be a dict so
    we add a RequestContextSerializer which can serialize to and from
    dicts using RequestContext.{to,from}_dict()

  * The allowed_rpc_exception_modules configuration option is replaced
    by an allowed_remote_exmods get_transport() parameter. This is not
    something that users ever need to configure, but it is something
    each project using oslo.messaging needs to be able to customize.

  * The nova.rpcclient module is removed; it was only a helper class
    to allow us split a lot of the more tedious changes out of this
    patch.

  * Finalizing the port from RpcProxy to RPCClient is straightforward.
    We put the default topic, version and namespace into a Target and
    contstruct the client using that.

  * Porting endpoint classes (like ComputeManager) just involves setting
    a target attribute on the class.

  * The @client_exceptions() decorator has been renamed to
    @expected_exceptions since it's used on the server side to designate
    exceptions we expect the decorated method to raise.

  * We maintain a global NOTIFIER object and create specializations of
    it with specific publisher IDs in order to avoid notification driver
    loading overhead.

  * rpc.py contains transport aliases for backwards compatibility
    purposes. setup.cfg also contains notification driver aliases for
    backwards compat.

  * The messaging options are moved about in nova.conf.sample because
    the options are advertised via a oslo.config.opts entry point and
    picked up by the generator.

  * We use messaging.ConfFixture in tests to override oslo.messaging
    config options, rather than making assumptions about the options
    registered by the library.

The porting of cells code is particularly tricky:

  * messaging.TransportURL parse() and str() replaces the
    [un]parse_transport_url() methods. Note the complication that an
    oslo.messaging transport URL can actually have multiple hosts in
    order to support message broker clustering. Also the complication
    of transport aliases in rpc.get_transport_url().

  * proxy_rpc_to_manager() is fairly nasty. Right now, we're proxying
    the on-the-wire message format over this call, but you can't supply
    such messages to oslo.messaging's cast()/call() methods. Rather than
    change the inter-cell RPC API to suit oslo.messaging, we instead
    just unpack the topic, server, method and args from the message on
    the remote side.

    cells_api.RPCClientCellsProxy is a mock RPCClient implementation
    which allows us to wrap up a RPC in the message format currently
    used for inter-cell RPCs.

  * Similarly, proxy_rpc_to_manager uses the on-the-wire format for
    exception serialization, but this format is an implementation detail
    of oslo.messaging's transport drivers. So, we need to duplicate the
    exception serialization code in cells.messaging. We may find a way
    to reconcile this in future - for example a ExceptionSerializer
    class might work, but with the current format it might be difficult
    for the deserializer to generically detect a serialized exception.

  * CellsRPCDriver.start_servers() and InterCellRPCAPI._get_client()
    need close review, but they're pretty straightforward ports of code
    to listen on some specialized topics and connect to a remote cell
    using its transport URL.

blueprint: oslo-messaging
Change-Id: Ib613e6300f2c215be90f924afbd223a3da053a69
Remove unused variable

Related to blueprint nova-network-objects

Change-Id: I9139a172d9c84f13030f896fb5414cacf5877ee1
Merge "Fixes errors on start/stop unittest"
Merge "Adds pause server extension for V3 API"
Merge "Adds suspend server extension for V3 API"
Merge "Removes XML namespace definitions from V3 API plugins"
Merge "Add FixedIP Object implementation"
Merge "Add FloatingIP object implementation"
Merge "Add FixedIP.floating_ips dynamic property"