Change test function from snapshot to backup

According to test function name 'test_backup_invalid_state',
the usage of functions should be backup instead of snapshot.

Change-Id: Ic07766d06875983a3ca59fccc272c708ebefdbba
Add test case for vim header check

There was not a unit test case for the vim header hacking
check.  This adds a test case.

Change-Id: I66889819b4d0b62ea54da327a3724c523a0e4fcb
VMware: remove unused argument from _delete_datastore_file()

The 'instance' argument is not used.

TrivialFix

Change-Id: Iec4f239d86cbd9b4a56713a17e9afa577971b032
Add @_retry_on_deadlock to _instance_update()

This patch adds the @_retry_on_deadlock decorator
to _instance_update(), which has been observed to be
involved in some deadlock scenarios.  As it is the point
of transaction demarcation based on the presence of
get_session(), this is an appropriate point at which the
transaction can be re-attempted in the case of deadlock.

Change-Id: Id2cfdc129ea3cfc787b73f1f3e9aa286a7c0229a
Closes-bug: 1375467
Remove unused method within filter_scheduler test

_fake_empty_call_zone_method is never used by method
test_run_instance_no_hosts within FilterSchedulerTestCase.
So remove it.

Change-Id: If8c952fbae36a7417d43ca69f19f513812667e71
Fix disk_allocation_ratio on filter_scheduler.rst

There is an option "disk_allocation_ratio" in DiskFilter instead of
a typo "disk_allocation_ration".
This patch fixes the typo on filter_scheduler.rst.

Change-Id: Iad4951fbdca97eccb956c42270bfc170fc7c7dac
Compute: use an instance object in terminate_instance

The instance in terminate_instance is an object. Use the object format
when locking the instance.

TrivialFix

Change-Id: I7b40f0dcdbe1866443388a83957c4ebafadd978e
VMWare: Fix nova-compute crash when instance datastore not available

During nova-compute service startup, init_host will try to get_info for
instances. If datastore of certain instances become not reachable, some
VM properties like 'summary.config.memorySizeMB' will not be available.
This will cause nova-compute process exit with error.

Change-Id: I6753ce5658b629c216ebfbaab610c8fd0755466a
Closes-Bug: #1337236
Refactoring of contrib.test_networks tests

Some simple refactoring of contrib.test_networks tests in order
to make it easier to share unittests between v2 and the v2.1 API
in a following changeset

Partially implements blueprint v2-on-v3-api

Change-Id: I87e475acdaabacdcceaaf73b3ad831292644d3c7
Allow backup operation in paused and suspend state

Snapshot operation allows paused and suspend instance to be
executed, this also should be applied to backup operation.

Change-Id: Ie7bfd4962f0f149c423f71dbc528a2736baeef97
Closes-Bug: #1361487
Port disk_config extension for V2.1

This patch ports v2 disk_config extension to v2.1.

Unittest code modified to share testing with both v2/v2.1.
API sample file and their tests have been added.

Also added extension point of server resize V3.

Partially implements blueprint v2-on-v3-api

Change-Id: Id2aace8121a310f8c86c6a9cc532bd1074d653c4
Break out over-quota calculation code from quota_reserve()

The list comprehension used to create the overs list was really hard to
read, so this moves that code into it's own helper method and breaks out
the logic from the list comprehension, and adds unit tests.

Partial-Bug: #1369605

Change-Id: I44236c7a206b2a9bd3843c9ca2ce56591a66352f
Remove unnecessary debug/info logs of normal API ops

There are some debug/info log messages about normal API operations
in each API method, but Nova WSGI framework has already output the
similar messages. So these messages are meaningless, and this patch
removes them.

Change-Id: Ifea3edd912ec80eed2869c3f97345d403ea96c89
Extend XML unicode test coverage

Extends the coverage of the servers XML serialization test to
cover unicode values. Fixes common function to be handle fields
being unicode. No actual bug fix, but this is test coverage which
we always should have had, and an investigation into another unicode
bug revealed the missing coverage and problem with the tests
not handling unicode values.

Change-Id: I6255ad1cf9a3429c0d87cb6709c11c1b65df9ba5
Related-Bug: 1279172
Port cloudpipe extension to v2.1

This patch ports couldpipe extension from v2 to v2.1,
and have v2 unit test cases shared between v2.1 and v2.
Partially implements blueprint v2-on-v3-api

Change-Id: Id40c637c0fc207e97b1d094805eb0cee6e9cd9c9
vfs: guestfs logging integration

Adds support to enable guestfs logging.

Change-Id: I46c5ec6606e4a2eb8277b081d0c773ceb6d36c4c
DocImpact: New group of option has been introduced "guestfs"
Closes-Bug: #1279857
Merge "Break out over-quota calculation code from quota_reserve()"
Finish objects conversion in the os-interface API

Most of the API code was using instance objects already except for the
listing, so this updates that.

Updates the test to use a fake instance object rather than a dict to
enforce the change.

Also adds a note on the slightly weird call to common.get_instance
in the show method when the instance isn't used for anything, it's
really a check to make sure the instance exists.

Part of blueprint kilo-objects

Change-Id: Ief17c57afbd81e2b6aef9586b448e8797aaa6544
Port os-networks plugin to v2.1(v3) infrastructure

Ports os-networks extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical.

- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods

Partially implements blueprint v2-on-v3-api

Change-Id: I94b7b476cbb02725a396725a379417b64afd58a7
Cleanup tenant networks plugin config creation

Cleans up the os-tenant-networks plugin config creation.
Although written in a way that the config options could be
declared in multiple places in Nova this is no longer the case
and its not something we should do anyway.

This is some prep work before porting the plugin to the
v2.1 API

Partially implements blueprint v2-on-v3-api

Change-Id: I3b8b26035654f2482b3ba9561c404b6a437ec8a2