Make scheduler disk_filter take swap into account

The disk_filter, which makes sure a node has enough disk space for an
instance doesn't take the swap partition into account, but swap takes up
disk space so it should.

Change-Id: I0779dcf0f1cd60017b5b49ca38c0a15b23d802d7
Closes-Bug: #1239009
Fix the ConsolesController class doc string

The code must have been copied from the console output extension to start
with and the old class doc string was left in place.

Change-Id: I4924e69763027043aace8e34aac55701be2ea823
Closes-bug: #1241685
Fix wrong description when updating quotas

when updating quota for a resource, with 'force_update=false', an
exception will be raised when the new value is less than the used quota
values(used and reserved). This patch changes the description of
exception.

Change-Id: Iede70444341817afb6953eb604fe4de186622916
Closes-bug: #1243062
Add flavor-manage to core for V3 API

Adds the flavor-manage plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Partially implements blueprint nova-v3-api

DocImpact

Change-Id: Idbedce5cc5936abc52235cd40573c8fe841f24fe
Remove multipath mapping device descriptor

When detaching a volume from a instance, we need to remove
multipath mapping device descriptor if there are other volumes
mapping to the host instead of do nothing, for some cinder drivers
can not terminate connection for multipath tool sending IOs to
storage array periodically.

Closes-bug: #1223975
Change-Id: I6fc02e045146ece49162ca6be1a83fa8d0214a0a
Adds XML namespace example for disk config extension

Adds XML namespace and specifying of the disk config value
to the disk config extensions api sample test data for server
creation. This is being done so the api samples used by the
documentation contain the example of this usage.

DocImpact

Change-Id: Icd7aa3743f71dd1cb8575605e5f1ce5da6bd37bf
Closes-Bug: 1189817
Stored metrics into compute_nodes as a json dictionary

The compute manager uses plugins to get the metrics information of each node.
And then sends and stores in DB for the scheduler to read and do scheduling.

The patch reuses table compute_nodes and adds a new TEXT column to store the
metric data as a json dictionary.

This is part of the blueprint utilization-aware-scheduling and the
blueprint generic-host-state-for-scheduler.

Change-Id: I4d20565567e9907cfcc92b1c1b15f3b35a806797
Signed-off-by: Shane Wang <shane.wang@intel.com>
Remove fake_vm_ref from test_vmwareapi.py

This fake method is useless now, we can remove it for now.

Change-Id: Idcef18f1e89cac30b1481580731a4f61b0f22050
Nova-all: Replace basestring by six for python3 compatability

The builtin basestring abstract type was removed in python3,
use str instead, we need to using six.string_types to replace
the basestring for py3 compatibility.

Partial Implements bp: basestring-py3-compatible

Change-Id: I17e87e49e7ebf3cc9c391e9beace8c45d2d2b689
Update schema_diff.py to use 'postgresql' URLs.

This gets rid of a SQLAlchemy deprecation warning when using this tool w/
PostgreSQL:

The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to
'postgresql'. The new URL format is
postgresql[+driver]://<user>:<pass>@<host>/<dbname>

This appears to have been deprecated in the SQLAlchemy 0.6 series so I think we
are Okay to remove it now.

Change-Id: If8fdf822ba452b387e9f2f3ec7c9157e4ae932f9
Remove useless variable from libvirt/driver.py

There are some variables in libvirt/driver.py were never used, so
we can just remove them.

Change-Id: Ie29bfbeef8c185697aa94a6e05e67a70436302c8
Utilizes assertIsNone and assertIsNotNone - tests/virt

Using assertTrue and the 'is None' operator to test if an element is None
is too python2.4. Our unit testing framework 'testtools' supports
assertIsNone and assertIsNotNone, included from python 2.7,
which were created for these types of tests.

Change-Id: Iee1379b941f93388900e89388676000b845fc8fc
all_tenants=0 should not return instances from all tenants

Fixes set up of server list filters so specifying all_tenants=0
or all_tenants=False when requesting a list of servers does not
result in instances from all tenants being returned.

Change-Id: I72575e4e2cf9019cfd5bf3b07ada53cadf2001e2
Closes-Bug: #1240347
Move get_all_tenants policy enforcement to API

Cleanup to move the enforcement of the get_all_tenants policy
enforcement to the API level. The all_tenants search option in
compute/api.py is only used to trigger policy enforcement while
the logic required by all_tenants (not specifying a project_id or
user_id filter) already resides in the servers API. The flag does
not need to be passed to the db level as it is ignored at that
level anyway.

Partially implements blueprint nova-v3-api

Change-Id: I5200c8912596ffbd32c5f7c6d74939782ff70260
Enforce compute:update policy in V3 API

Now that compute/api.py:update() is no longer being called for instance
updates the policy check is no longer enforced.  This adds policy
checking back in at the V3 API level so that the compute:update policy will
continue to function as it did before.

This was fixed in I365ad8ac2845d914deefb841c314a50f4869dba0 for the V2
API.

Change-Id: I9caa3e10fe029569c6fd467e7b86103dd6590f9b
Closes-Bug: 1242955
Fix migration 185 to work with old fkey names

Migration 133_folsom.py accidentally changed the name of the FK
constraint on instance_info_caches from instance_info_caches_ibfk_1
to instance_info_caches_instance_uuid_fkey and on virtual_interfaces
from virtual_interfaces_ibfk_1 to
virtual_interfaces_instance_uuid_fkey meaning databases who have
upgraded from before folsom have the old fkey.

This patch adds a check for those with the old fkey name to make sure
it is dropped before changing unique constraints (as is required by
MySQL). It also fixes the fkey name to be as defined in 133 if it
wasn't before (which will persist on downgrade being consistent with
those who have come in after folsom).

Closes-Bug: #1245502

Change-Id: Ib0dcd04fcb9ed776c76d40561181abad2e14f76f
Use _get_server_admin_password()

There is _get_server_admin_password() for getting an admin password
in ServersController class. This patch makes some methods use it for
code clean-up.

Change-Id: Iff9d960126e1c09d928d72b572838e6f16cc4f33
Add auth_token settings to nova.conf.sample.

Updates our example config file so that it includes configuration
settings for the auth_token middleware.

Includes the latest generate_sample.sh from Oslo.

Related-Bug: #1240753

Change-Id: I393a67f1f005e775928130c9241aa7e25c391ae3
Drop auth_token configs for api-paste.ini.

We now prefer to use nova.conf to configure keystoneclients
auth_token configs.

Also, Devstack has now been update to allow this:

  https://review.openstack.org/#/c/52258/

Change-Id: I2a4b300af37eddf5010b97ca796f0552941642a8
Replace assertEquals with assertEqual - tests/api

The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

This is part of blueprint assertequal

Change-Id: I72f612cc62f90a079c9c53747e3bcbfebfb8eb96