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
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
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
libvirt: Support snapshot creation via libgfapi

Currently, the libvirt driver only handles volume snapshot
creation for file-backed volumes.

This changes allows volume snapshot creation for libgfapi-
attached volumes to work.  (A sufficiently new version of
libvirt is required.)

Implements: blueprint libvirt-volume-snap-network-disk
Closes-Bug: 1288976

Change-Id: Ic6dd861b40b692b25df67c9d5b63fd436c690fde
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
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
Fixes rbd backend image size

The original fix for bug 1219658 introduced a factor of 1024 error
in the resulting rbd image size.

Fix bug #1219658

Change-Id: I3ec53b3617d52f75784ebb3b0dad92ca815f8876
Co-authored-by: Nikola Dipanov <ndipanov@redhat.com>
Signed-off-by: Haomai Wang <haomai@unitedstack.com>
VM diagnostics (v3 API only)

There is no formal definition for the VM diagnostics. For the
V2 API the diagnostics will be returned as they are today.

This will continue to use the driver function get_diagnostics.

This change will be implemented by a new virt driver method called
get_instance_diagnostics.

This will support backward compatibility with the existing API's.

Part of the blueprint v3-diagnostics

This patch set is for the API's. Virt driver support in additional
patches.

DocImpact

Change-Id: Id722f38fb134b322413d2b5c3459c8fc0af7bd36
add comment about why snapshot/backup have no lock check

This comment is intended to reduce further confusion about why a
lock check hasn't been implemented for snapshot and backup.

Change-Id: I8d89ca7b15d6713221af2d0535f9ed338ca70612
Related-Bug: #1314741
Add test cases for 2 block_device functions

This patch adds test cases for
validate_and_default_volume_size and validate_device_name
in block_device.

Change-Id: Ia6c487ce84cbd58c0e5b2e6384789bcc5286e818
Add missing test coverage for MultiplePortsNotApplicable compute/api

Change-Id: I40de9b52452312779187c818afaf9ac03f1aefe3
Closes-bug: 1321902
libvirt: speed up get_vcpus method

Switch the get_vcpus method method to use the new
list_instance_domains method.

Blueprint: libvirt-domain-listing-speedup
Change-Id: I474d6db502d19f2296252f4f3ae2ef740a2188e8
libvirt: speed up get_memory_mb_used method

Switch the get_memory_mb_used method to use the new
list_instance_domains method.

Blueprint: libvirt-domain-listing-speedup
Change-Id: I6f9e9a2ee761b81e8fc06237cfef1b7202effe37
Use pool/volume_name notation when deleting RBD volumes

the rbd command supports two methods for specifying a pool name:
the "-p" flag, and using the volume name notation "pool_name/volume_name"
The latter method supercedes the former, so to guard against slashes
in the volume name confusing things, always use the path notation

Change-Id: Ie79ae10b0fafefd85dea8e38cd24da0941b38bee
Closes-Bug: 1306285