Add shelve and unshelve info into devref doc

The diagram on http://docs.openstack.org/developer/nova/devref/vmstates.html
does not currently show the "SHELVED_OFFLOADED" state and the
associated "shelve", "shelveOffload" and "unshelve" state transitions.

Change-Id: I50eb07a84336160b8120ca294598576eeb982d28
Closes-Bug: #1394215
downgrade 'No network configured!' to debug log level

Based on the details in bug 1191044, a user can cause the warning
'No network configured!' if they boot an instance in a tenant that
has no neutron networks set up.

Tempest doesn't create a network for every test that creates a nova
instance. The lack of a network is not a sign of something wrong with
nova so a warning log is too much. Move to debug instead.

This should help reduce the amount of warnings that occur on every
tempest run.

Also drop the exclamation mark.

Change-Id: I6bc4e46aa5a72645c72f7232627c7aa9efd2591d
Related-Bug: #1191044
Parse "networks" attribute if loading os-networks

"networks" attribute of "create a server" API should be used when
Neutron/os-network extension is loaded as TODO which is removed with
this patch mentions. V2.1 os-network extension has been implemented
with I94b7b476cbb02725a396725a379417b64afd58a7 already, so this patch
enables "networks" attribute for os-network extension.

Partially implements blueprint v2-on-v3-api

Change-Id: Ibe59ddc53d074f5b8147e24b35066d38d73c7c33
Refactor unit tests for scheduler weights

Remove external depenencies from scheduler weight tests in an attempt
to make the tests cleaner and to only test the weight code itself.

FakeHostState() is used to avoid having to go through host manager and
then mock it's db calls. Additionally, weigher classes are referenced
directly instead of having the weight handler load them first.

Related to blueprint scheduler-optimization

Change-Id: Ifd3577aec6c5fc82e4864623e0545f380fb75b6e
Make scheduler filters/weighers only load once

Right now, filters/weighers are instantiated on every invocation of the
scheduler. This is both time consuming and unnecessary. In cases where
a filter/weigher tries to be smart and store/cache something in between
invocations this actually prohibits that.

This change make base filter/weigher functions take objects instead of
classes and then let schedulers create objects only once and then reuse
them.

This fixes a known bug in trusted_filter that tries to cache things.

Related to blueprint scheduler-optimization

Change-Id: I3174ab7968b51c43c0711033bac5d4bc30938b95
Closes-Bug: #1223450
libvirt: un-cruft _get_guest_numa_config

Several issues get cleaned up with this patch - all of which will make
adding CPU pinning into the mix a lot cleaner.

1) Unecessary context argument to the method is dropped.

2) Secondly - we pass in the InstanceNUMATopology object (or None)
instead of passing in the whole instance and then getting the topology
out - this is useful as we will need instance NUMA for generating topology
as well, and this avoids repetitive code in a lot of places.

3) Add missing tests for updated method the method
get_cpu_numa_config_from_instance

Change-Id: I829465d1612f42e7af92927584b31ca6a2349d5a
libvirt: Fix NUMA memnode assignments to host cells

This fix

  https://review.openstack.org/138128

breaks assignments for NUMA topologies where host cell ID
that the instance cell is pinned to is not in increasing order. The
reason for this is that the main loop of the method that will go through
the host cells (always in ascending order), and find instance cells that
match (may not be in ascending order depending on how the fitting logic
and usage of the host) but we simply append memnodes so they may end up
in the wrong order when we hit the normalization loop.

We fix this by "pre-allocating" the memnodes list and making sure to add
the matching memnode to the same position as the guest config cell
before hitting the normalization loop.

Change-Id: I91055dc705f2ef54c830e641f9cf9ba0683eb313
Closes-bug: #1397381
virt: delete unused 'interface_stats' method

The only use of the virt driver 'interface_stats' method was
removed 3+ years ago by

  commit 07646e85841a4f7c81e80254ac63715bece2aadd
  Author: Brian Waldon <brian.waldon@rackspace.com>
  Date:   Tue Aug 2 10:09:58 2011 -0400

    removing compute monitor

Change-Id: Ie43ebea3ecabd0dd11a5c341bf2310a00f143031
virt: Convert more tests to use instance objects

Update a couple of methods in test_virt_drivers so that they
use instance objects instead of dicts

Blueprint: libvirt-driver-class-refactor
Change-Id: Ib2257ac97c533a8a0d7f45994d21a67d08444e19
libvirt: Convert more tests to use instance objects

Convert a bunch more test cases over to use objects.Instance
instead of a dict()

Blueprint: libvirt-driver-class-refactor
Change-Id: I4f34c9c795f99e56dd6ca27be237e8c2252f782e
Only check db/api.py for session in arguments

We were checking both db/api.py and db/sqlalchemy/api.py for session
in db apis, but db apis are only defined externall in db/api.py. This
rule will falsely match on non-api methods in db/sqlalchemy/api.py
which take a session argument. Passing the session around within this
module is considered a good thing.

Change-Id: Ibf5d1284b44013c736b6b70ca4fa5d706c365c7d
Extend clean_shutdown to the compute rpc layer

Adds the clean_shutdown parameter added to stop, resize, rescue,
shelve and shelve_offload in Juno to the compute rpc layer.  This
will in turn allow us to extend the API to provide a
forced-shutdown option to those operations.

Change-Id: Ie24c66e5006e64ef8b45d9d5056cc7876481a2f8
Partially-Implements: blueprint user-defined-shutdown
Add support for clean_shutdown to stop in compute api layer

Change Iec3dfd17725440958aac395ebc471e51afd6522e added
clean_shutdown support to the compute manager in Juno.
This change is part of a set to extend that to the compute
API layer, which will in turn allow us to extend the REST API
to provide a forced-shutdown option to those operations.

Change-Id: I38707cf869705f983ab35e549d95dc4be4811ece
Partially-Implements: blueprint user-defined-shutdown
Add support for clean_shutdown to shelve in compute api layer

Change Iec3dfd17725440958aac395ebc471e51afd6522e added
clean_shutdown support to the compute manager in Juno.
This change is part of a set to extend that to the compute
API layer, which will in turn allow us to extend the REST API
to provide a forced-shutdown option to those operations.

Change-Id: I24dfef04cd0cddbff72267b93e0148b8fb204717
Partially-Implements: blueprint user-defined-shutdown
Add support for clean_shutdown to rescue in compute api layer

Change Iec3dfd17725440958aac395ebc471e51afd6522e added
clean_shutdown support to the compute manager in Juno.
This change is part of a set to extend that to the compute
API layer, which will in turn allow us to extend the REST API
to provide a forced-shutdown option to those operations.

Also adds a couple of missing unit test cases for rescue to the
compute_api tests

Change-Id: I5f00f63742fac89fea65149582f36866146e86f5
Partially-Implements: blueprint user-defined-shutdown
Updated from global requirements

Change-Id: I0d572918d958bcff6ab15af9ccea09401e53ebac
Merge "Parse "networks" attribute if loading os-networks"
Merge "Extend clean_shutdown to the compute rpc layer"
Merge "Add support for clean_shutdown to stop in compute api layer"
Merge "Add support for clean_shutdown to shelve in compute api layer"