Specify DB URL on command-line for schema_diff.py

The exising schema_diff code had the DB URL format hard-coded which made it
difficult to work with since different environments with have different
user/password configurations.

A more flexible way to handle this, is to have the DB URL specified directly
on the command-line.

Change-Id: I313bb616e439072e007c886a7f131efc6a61f6df
Add API schema for v2.1/v3 migrate_server 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 v3-api-schema

Change-Id: I9f1eea8471af0f86dcf472ed8a4fdb634dfdb260
V3 Pause: treat case when driver does not implement the operation

Some virt drivers may not support this operation.

Change-Id: I21a3fbb6e41e4a32810fd8c76f0fabb7aeff9244
novncproxy: Setup log when start nova-novncproxy

Because log system not setup, so log_dir, log_file config item not work.

Change-Id: Iabe7a4ca41dc0de8c752f013f6afeed5fd80b4ea
Closes-Bug: #1291949
Change listen address on libvirt live-migration

Previously, in order for libvirt live migration to work,
the graphics listen addresses (VNC and/or Spice) had to be
set on both machines to be 0.0.0.0 or ::.  This was because libvirt
would try to rebind to the source address on the destination
machine, but would fail due to the source machine already having
that address (this would not happen for 0.0.0.0 or ::, however).

Now, a modified copy of the instance's XML is passed to libvirt's
migrate function, such that the listen addresses are that of the
destination machine.  The addresses are stashed in the pre-migration
data by the destination pre-migration method.

Note that this functionality will only work on versions of libvirt
with the VIR_DOMAIN_XML_MIGRATABLE flag.  If the flag is not detected
(anything vanilla libvirt less than 1.0.0), the live migration code
will fall back to the old method.

Fixes: bug #1279563

Change-Id: I6c9500283027193179c11d18ad4242e165a9ad6e
Virt: remove unnecesary return code

The methods attach_volume, detach_volume and swap_volume should
not return anything.

The purpose of the patch set is to have a consistent behaviour across
drivers for the aforementioned methods.

Change-Id: I381ede44d71cd5f6ce98804853e4e8f587b46c99
Make resize raise exception when no valid host found

When resize operation starts, it will ask conductor to find a
valid host and try to resize to that host. When there is no valid
host can be found ,current code return directly without error
notification, which will make upper layer code (e.g novaclient)
thinks the execution is succesfully performed and report 'Finished'.
But actually it isn't due to no valid host was found.

Change-Id: I3d66dbfc0a7346762b920e802aa3be92c43d93b7
Closes-Bug: #1297052
Add API schema for v2.1/v3 create_backup 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 v3-api-schema

Change-Id: Ie8a1ce6d0d7b90fb73555981fa974e9029344d3b
Not count disabled compute node for statistics

No server will be scheduled to disabled compute service, thus we
should not count the corresponding compute node information.

It's arguable if we should count for 'down' service, since service
may be marked down because of communication error. If we do want to
exclude the down service, we need passing the information from caller
because the up/down state is not kepts in database, and it means compute
and cell api changes.

Closes-Bug: #1285259

Change-Id: I5e3e71ef30683c5eb5cc4462f58fa5f29d7c3f4b
api: remove useless get_actions() in consoles

This code is never called and refers to an non existent class.

Change-Id: Ia999d550315bf10dc7589f43e67e2fbf0d94501d
Use auth_token from keystonemiddleware

auth_token middleware in python-keystoneclient is deprecated and has
been moved to the keystonemiddleware repo.

Change-Id: I1aadbe24db63eb2507b088cd53886d7f2e192cab
Add API schema for v2.1/v3 attach_interfaces 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 v3-api-schema

Change-Id: I0c4066c34f6da0934946aa9eda907b911dbede16
Add missing image to instance booted from volume

When booting an instance from a volume, the image_ref for
the instance will be None. And the API do not get the image
information for the instance also. So when we calling the
related API, we get "" for instance.image.

Change-Id: I3c35ab1d7c8bcec551fb5d67d0b44418266b32a4
Closes-bug: 1317880
add checksums to udp independent of /dev/vhost-net.

In newer kernel versions, the network devices added for lxc containers
do not get checksums added.  The result is the same as previously
occurred when vhost-net became prevalent in kvm guests.

Software that expects the checksums on packets will ignore them.  One example
of such software is udhcpc in cirros.  Without this change, cirros containers
in 3.13 kernels (Ubuntu 14.04) will fail to acquire an address via dhcp.

Closes-Bug: #1335193
Change-Id: Iba305fb7f8236955ca732e467db9e424535be93d
Fix nova/network direct use of object modules

This replaces all uses of nova.objects.<module>.<object> with
nova.objects.<object> within nova/network and nova/tests/network.

Change-Id: I6438bcf47e06a401323ea708d5a44c69fa00e967
Partial-Blueprint: object-subclassing
Fixed wrong assertion in test_vmops.py

There is wrong assert method in
nova.tests.virt.vmwareapi.vmwareapi.test_vmops.py:640
while checking a number of calls mocked method 'mkdir'.

We should use assertEqual(3, len(mock_mkdir.mock_calls))
instead of self.assertTrue(3, len(mock_mkdir.mock_calls))

But number of calling method 'mkdir' not always is 3.
If dict block_device_info contains key 'block_device_mapping'
with any information, method 'mkdir' wouldn't be called in method
self._vmops.spawn(). That is why corresponding check been added.

Change-Id: Ifc26e112b9c2974e0fb7a91ba39d5b2d887bd549
Closes-Bug: #1335859
VMware: remove duplicate key from test_instance dict

Remove the duplicate 'node' key from test_instance dict

Change-Id: I1199b5f9428f3fad196bd10331b268f9a3eddcf9
Remove instance_uuids argument to _schedule

The instance_uuids argument to _schedule is pointless. The UUIDs are
already in the request_spec's 'instance_uuids' key.

Change-Id: I434c0be3ecd95dc5da7762770546c5f1274f985f
Make cells rpc bdm_update_or_create_at_top use BDM objects

We were sending SQLAlchemy objects previously, which is bad practice
since they work only with Rabbit rpc backend. Inter-cell RPC calls will
still use dicts.

Change-Id: I28ee5f914914b85be577291edef6c285f055be5a
Add 'anon' kwarg to FakeDbBlockDeviceDict class

This will allow us to create fake block devices without the database id
field, so we can pass them to BDM objects in our test  which can then
call create(). create() would normally error out if there is a DB id set
on the object.

Change-Id: I2d1f975633c8b2cb9e2e744c5f769b8f753b5968