Set a sane default for state_path

This change sets a sane default to state_path and puts the previous
state_path for tests only.

Because the default value of state_path changed, if this one isn't set in the
configuration file, pybasedir is not more used as replacement but /var/lib/nova
is used instead.

UpgradeImpact
DocImpact
Closes bug: #1240879

Change-Id: I94502bcfac8b372271acd0dbc1710c0e3009b8e1
fix ips to 'ips' in APIRouter

Actually ips in `ips in init_only` would not be valued as True because
ips is a moudle object not a string. Fixing this to string 'ips' could
prevent potential issues and improve readability.

Change-Id: I74564349e1fef00e7430cfb0547b3ad87c8e471c
Make nova/quota use keypair objects

Related to blueprint icehouse-objects.

Change-Id: Ic06d2337c7ef1b028d305d0a7ec354238c239380
Make image props filter handle old vm_modes

The ImagePropertyFilter would fail to build an instance if the image
used an older style vm_mode (e.g. 'pv') as described in
nova.compute.vm_mode.  This change will convert the vm mode string to
the current form.

Change-Id: Ibde37e28b02d9e866b286ea14c47a6a8411d94b4
Closes-Bug: #1276773
Cells rebuild regression fix

The introduction of 'preserve_ephemeral' in rebuilds created a
regression issue with cells.

Closes-Bug: 1281858

Change-Id: Ic8446e8611a41691d12c5dd0c4e1285a586248da
Fix unhandled InvalidServerState exceptions in server start/stop

Catch InvalidServerState exceptions in the server start/stop api
and return a 409 conflict rather than causing 500 errors

Closes-Bug: 1266379

Change-Id: I9d2437319d2cef93b9b10184e257acbd8eb45359
Fixed a problem in iSCSI multipath

Multipathing for attach volume and detach volume operations
doesn't work properly if there are different targets
associated with different portals for a mulitpath device.

Change-Id: Iab316526cf64de60325d90043f73fa3e83fafb4e
Closes-Bug: #1266051
ec2 api should check 'max_count'&'min_count' para

in ec2 api,run_instance method have not check para
about 'max_count' and 'min_count'

Change-Id: I852dac71e56c658a54b127053cba155e1a260a73
Closes-Bug: #1267382
Calculate default security group into quota usage

Create the related quota usage when creating the default
security group for user.

Change-Id: Ide1de160814a5937f71e07f3ab10ce2bba8886f1
Closes-bug: 1271381
Ensure that exception raised in neutron are handled correctly

We are now logging exceptions so we need to use save_and_reraise.

The patch set has also added log messages for exceptions that were
raised. This will be very helpful for debugging and troubleshooting.
This is done in the following cases:
 - unable to access a port when validating networks
 - unable to find a requested floating ip

Change-Id: I946126c2fb5aa229f917f8cb36ecb23aab528e14
Add API schema for v3 rescue API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint nova-api-validation-fw

Change-Id: I3d08bc20e4c585dca1e218e8d97b208d158a3096
Fixed incorrect test case of test_server_metadata.py

Fixed incorrect test case about following points.
 * delete 2 test case because same test will be done
   in other part of same class.
 * fixed parameter according to test purpose.
 * fixed expected exception code.

Change-Id: I3116e9b4e22a86c583a531c8b8e46069f876296e
Corrected typo in metrics

Change-Id: If23292d83776be50f22f45c849fd45b7b04da7d9
Remove admin auth when getting the list of Neutron API extensions.

Currently _refresh_neutron_extensions_cache() always authenticates
with Neutron using the configured Neutron admin credentials because
it doesn't have access to the calling context.  But it's actually
always called when a valid context exists, and the call to get the
list of extensions is not itself an admin operation.  By passing
the context down we can avoid this additional authentication step.

Change-Id: I9e7d9c5e424a6b39c8f8ee1c79f5fd8f48ad81a2
Closes-Bug: 1250850
Make exception message more friendly

Exceptions that get returned via REST api
should have more user friendly message,
users shouldn't have to know backend concept.
more detail,see bug.

Change-Id: Idc20680e46c36fa3441838177ce61b6f5e1d2979
Closes-Bug: #1263204
vmwareapi: simple refactor of config drive tests

A fairly trivial refactor of multiple identical spawn
invocation calls.

Change-Id: I110df1786b4081abe72428f888c3d27430017ff1
VMware: fix missing datastore regex with ESX driver

When using shared datastore and the ESX driver the administrator
is unable to indicate which datastore to use.

Note: there were extensive tests added for the VC driver for the
regex support. These are invoked by passing the flag for the regex
when the ESX driver is created.

Change-Id: Ifb0a4a8df2b26f3521b1301462d1f2c3eeba5c14
Closes-bug: #1246206
XenAPI: Report the CPU details correctly

Driver was not filling in the cpu_count in the correct field.
Also added VM vcpu count

Change-Id: I6339d7fd4faffcd5320fd86b55ff3a5e3515e2bf
Closes-bug: 1192528
Correct the state for PAUSED instances on reboot

If an instance is in the PAUSED state before the compute node is
restarted, it will be left in an inconsistent state (impossible to
delete and/or restart it) after the node boots again.

This patch adds a check in the periodic task sync_power_state so when
this situation is detected the instance is stopped and left in a state
from where it can be started again or deleted.

Closes-Bug: #1265494
Change-Id: I7266ace596598522c28a3839091ef50faf4463c2
Correct host managers free disk calculation

Take lower of disk_least_available/free_disk_gb if they exist.

When an instance exists in the database but not on the hypervisor
(which can happen in some error cases), the 'missing' instance
is included in the calculation of 'free_gb' but not included in
'disk_available_least'.
Need to take the value that represents the minimum amount of free
disk space available.

Testing:
COMPUTE_NODES in fakes.py includes the 4 possible test cases:
    disk_least_available or free_disk_gb = free_disk_mb
        None             or     512      =    524288
        1024             or    None      =   1048576
        3333             or    3072      =   3145728
        8192             or    8888      =   8388608
   test: test_host_manager.py
           test_get_all_host_states:
             Already has existing tests looking for these
             cases - I've modifed the test data (in fakes.py)
             rather than creating new test data.
             Added check for Warning message for node 3 where
             physical disk (3333) is greater than database (3072)
         No impact on other tests.

Change-Id: I4a18bf023a64d0cb198f77aab9daecb0786e93ff
Closes-Bug: 1253599