Fixes snapshot instance failure on libvirt.

Fixed the failure during snapshotting instance (on libvirt) due to incorrect
attribute access.

Fixes LP: #1075556

Change-Id: I079467d38aef5071488084f9bfa080a2a5af2609
Removes fixed_ip_get_network

Removes fixed_ip_get_network since it doesn't actually work anymore
(at some point in the past the network must have been stored along
with the network_uuid but this is no longer the case) and nothing
else uses it anyway.

Also cleans up fake db test model to remove the fake_fixed_ip_get_network
and underlying network reference which makes it closer in sync
to what is actually implemented now

Change-Id: I01dc0f88a8bc7cfef01c4e7f328bcdba75a8e0bc
Fixed HyperV to get disk stats of instances drive

It fixes bug 1077922

The current version of the HyperV Compute driver was returning the disk stats about the C: drive always.

This patch makes HyperV driver extract the current drive from the flag 'instances_path'.

In order to optimize the procedure, the disk stats extraction is also unified in one method.

Change-Id: I4920cf2cc07d0f514c0358144b7bceb15d439a63
Update vol mount smoketest to wait for volume.

Updates the test_003_can_mount_volume smoke test so that it
waits for the volume to show up in /proc/partitions for up
to 60 seconds before proceeding. This eliminates the need for
a hard coded sleep value which can cause intermittent test failures.

Change-Id: Ibdc56a00e141211e40068c22fc268efeba6affff
Adds a conf option for custom configdrive mkisofs

In order to support ConfigDrive on Hyper-V an option for supporting
a customizable mkisofs / genisoimage is needed, including optional
path.

The option "mkisofs_cmd" deafult to "genisoimage" to preserve
backwards compatibility

Change-Id: I89167bf77bddae9a0f989874ad0a972d7898a903
Remove volume.driver and volume.iscsi

Remaining flags moved to nova.virt.libvirt.volume

Part of bp delete-nova-volume

Change-Id: I1b96c773f0b5df73b04215a4afb350a5583b0101
Remove unused volume exceptions

part of bp delete-nova-volume

Change-Id: I1285528ef0c2aff0f3dfea9faf2b28c55eb10a51
Added bare-metal host manager.

Part 6 of 6: blueprint general-bare-metal-provisioning-framework.

The bare-metal host manager is used when multiple bare-metal
instances are created by one request. The bare-metal host manager
detects if a nova-compute is for VM or bare-metal.
For VM instance provisioning, it simply calls the original host_manager.
For bare-metal instance provisioning, BaremetalNodeState is used
to manage bare-metal node's resources when an instance is provisioned
to a bare-metal node.

Change-Id: Ib207f495493db99a4a6cd1ac0044662fb7397322
Co-authored-by: Mikyung Kang <mkkang@isi.edu>
Co-authored-by: David Kang <dkang@isi.edu>
Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp>
Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
fix LVM backed VM logial volumes can't be deleted.

bug#1078085.

Change-Id: Ib899754002cea28f310b042e5d4a7f89416e031e
Fixes usage of migrate_instance_start

Because migrate_instance_start is used to remove floating ips on the source
compute node, we need send the RPC to the source compute node instead of
the dest compute node.

Fixes bug 1078207

Change-Id: Ie993548944268e1ab3af0b89e74e1b54d8137802
Added separate bare-metal MySQL DB.

Part 2 of 6: blueprint general-bare-metal-provisioning-framework

In baremetal provisioning, one nova-compute manages multiple bare-metal
machines. A bare-metal machine does not run openstack at all.
Previously, bare-metal provisioning used text files to store information
of bare-metal machines. In this patch, a MySQL database is used to store
the information. We target only MySQL database. The DB is designed to
support PXE/non-PXE booting methods, heterogeneous hypervisor types, and
architectures. Using a MySQL database makes maintenance and upgrades
easier than using text files. The DB for bare-metal machines is
implemented as a separate DB from the main Nova DB. The DB can be on any
machines/places. The location of the DB and its server needs to be
specified as a flag in the nova.conf file (as in the case of glance).
There are a couple of reasons for this approach. First, the information
needed for bare-metal machines is different from that for non-bare-metal
machines. With a separate database for bare-metal machines, the database
can be customized without affecting the main Nova DB. Second, fault
tolerance can be embedded in nova-compute. Since one nova-compute
manages multiple bare-metal machines, fault tolerance of a nova-compute
node is very important. With a separate DB for bare-metal machines,
fault-tolerance can be achieved independently from the main Nova DB.
Replication of the bare-metal DB and implementation of fault-tolerance
are not part of this patch. The implementation models nova and its DB as
much as possible. The bare-metal driver must be upgraded to use this DB.

Change-Id: I7b7ba1903a672a50c567f95fc6554d119463b0c5
Co-authored-by: Mikyung Kang <mkkang@isi.edu>
Co-authored-by: David Kang <dkang@isi.edu>
Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp>
Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
Adds REST API support for Fixed IPs

This adds an extension that provides a REST API for getting information
about a fixed ip, reserving a fixed ip and unreserving a fixed ip. The
interface is accessed via

/v2/{tenant_id}/os-fixed-ips/<ip_address> # GET ip info
/v2/{tenant_id}/os-fixed-ips/<ip_address>/action # POST reserve/unreserve ip

This forms part of the work to provide APIs for functionality currently
implemented by nova-manage that needs direct db access so nova-manage
can eventually be removed

Adds db function fixed_ip_get_by_address_detailed in order to optimise being able
to get the instance and network information for a fixed ip at the same
time as the rest of the fixed ip information

Change-Id: I92edf4e6b74b14bb9c49d5bc0c79e40d3a496bc5
Implements: blueprint apis-for-nova-manage
DocImpact
Merge "Remove volume.driver and volume.iscsi"
Try hard shutdown if clean fails on resize down

In the xenapi driver, a clean shutdown is attempted before a resize
down.  If the Xenapi raises an exception it is logged and ignored and
the resize will fail later in the process.  This adds a hard shutdown
attempt if the clean shutdown fails.

Change-Id: I458931a19dd2375ad7142d60cb8b6ed274de9483
Add DB query to get in-progress migrations.

Adds DB query to get in-progress migrations.  This will be needed
by resource tracker to get more accurate usage values around inbound
and outbound resizes.

bug 1065267

Change-Id: Ib111002c70aa16e404c6e2c3fcb4ad234177ce91
Merge "Try hard shutdown if clean fails on resize down"
Sync latest code from oslo-incubator.

Change-Id: I463a6d934d17f3374763472cee7291234238c50d
Merge "Add DB query to get in-progress migrations."
Merge "Update vol mount smoketest to wait for volume."
fix flag type define error.

Change-Id: Ieac6bfaf3bf8f967e76873c933cf131d7d7a91b1