Add cpuset attr to vcpu conf in libvirt xml

Currently the instances can use all of the pcpu of compute node, the
host may become slow when vcpus of instances are busy, so we need to
pin vcpus to the specific pcpus of host instead of all pcpus.
Also added a cache of total vcpus num in libvirt driver here.

DocImpact: please refer to the bp page.
Implements blueprint: instance-vcpu-pin
Change-Id: I6b6e805c15b249cc5e7517e26619d79bb0183de8
Add unitests for VMware vif, and fix code logical error.

Fix code logical error that cause variable referenced before assignment.
Add unittests for vmwareapi vif.

Fix bug #1177635

Change-Id: I6656e8b77417061eca2a56d50820f5385c0ae987
Add sqlalchemy migration utils.check_shadow_table method

This method check that our table with name `xxx`:
1) Has shadow table `shadow_xxx`
2) All columns in `xxx` are also in `shadow_xxx` (with same type)
3) There is no extra columns in `shadow_xxx`

Will be used to check that all shadow tables are up-to-date.

blueprint db-improve-archiving

Change-Id: I0b366afe1b7d8703ab9c49a68977202b82d844fc
Add sqlalchemy migration utils.create_shadow_table method

This method allows to create shadow table by existing table.

Two use cases:
a) create shadow table by table name
b) create shadow table from table instance

blueprint db-improve-archiving

Change-Id: Ib3a3797782b89a9a89baa60738edcabde7fe1299
Remove invalid block_device_mapping volume_size of ''

Fixes bug #1171190

Parsing block_device_mapping from strings sometimes results in
volume_size being set to '' or u''.  This causes a problem when
inserting into PostgreSQL, which insists that integer columns
actually contain integers.  Remove invalid device_size before
inserting or updating block_device_mapping database records.

Change-Id: If9132a96604b5b0e3a6df96624e565e016d5c9a3
Update rootwrap with code from oslo.

Change-Id: I30f1b8773840c098f1e38d09bf13f0863035289e
Make resize/migrated shared storage aware

Fixes bug 1177247

Added some logic to check for whether or not we are on a shared
filesystem and set shared_storage accordingly. We perform similar
checks in other areas of the code, typically through RPC calls.
However, all the resize/migrate code is slated to be refactored for
Hava, so the idea was to keep this patch as minimally intrusive as
possible.

When shared_storage is true, we pass that on to the cleanup call
so that it no longer executes an rm via SSH, which was ultimately
destroying the original instance directory.

Change-Id: Ie9decedd373c000211c171df64e1e96fe78e5081
Allow a floating IP to be associated to a specific fixed IP

The current floating IP API extension only accepts the instance ID
and the floating address to be assigned. Where the instance is
connected to more than one network the behaviour is to associated
the floating IP with the first fixed IP of the instances
(and to log a warning)

This change introduces a new extension which wehn loaded adds a
fixed IP address as an optional parameter, allowing the floating
IP to be associated with a specific fixed IP.

Without this extension, or without the optional parameters,
the API behaviour is unchanged.

If specified the fixed IP must be associated with the instance.

DocImpact

Implements blueprint multi-nic-floating-ip-assignment

Change-Id: I9241137ad794cdf7f452ed84e9445f0e11fdd44e
Check cached SSH connection in PowerVM driver

The PowerVM operator code caches an SSH connection to the hypervisor
which can become invalid if the connection to the hypervisor is not
terminated cleanly, e.g. the hypervisor is rebooted while the compute
node is connected to it.

This code checks an existing SSH connection object to see if it's
transport is still alive and if not, re-establishes the connection
before attempting to run SSH commands on the hypervisor.

Also added some basic unit tests to cover the new check_connection
function in nova.virt.powervm.common.

Fixes bug 1177104

Change-Id: I08079cf0d9e60e1d8902d32d684d979b06f7f287
Cleanup for test_create_server_with_deleted_image

Adds a cleanup for test_create_server_with_deleted_image so that
the test resets the test image to the active state after the test
finishes. Otherwise other tests which use the same image after
this test can fail.

Change-Id: Iedd039af54d2233d1afbc7fe2d21d1b3594c47b1
fix non reporting of failures with floating IP assignment

It seems that commit essex-1-1003-g9728ae5
inadvertently removed a 'raise', thus hiding
all processutils.ProcessExecutionError exceptions
apart from the one indicating "Interface not found".

Fixes bug: 1178658
Change-Id: I2bcf8c3a19ebebc81a38ce6bf7b54065d62834c0
Merge "Remove invalid block_device_mapping volume_size of ''"
Check QCOW2 image size during root disk creation

glance can only tell us the size of the file, not the virtual
size of the QCOW2. As such we need to check the virtual size of
the image once its cached and ensure it's <= to the flavor's
root disk size.

Change-Id: I833467284126557eb598b8350a84e10c06292fa9
Fixes: bug 1177830
Imported Translations from Transifex

Change-Id: Ic7342f9da05f435b7beeae516dccfb102741e62c
Show exception details for failed deploys.

Without some detail errors are inscrutable and impossible to debug.

Fixes bug 1178608

Change-Id: I0ed6164e8689c63bd194924d3f7cb50b49feb921
Allow different paths for deploy-helper helpers.

Different distros (or even distro releases) put iscsiadm in potentially
arbitrary paths. It is better to use rootwraps' own search than to hardcode the
path.

Fixes bug 1178612

Change-Id: I690788b666a84e599504690d0e2d087eaa66a4c8
Merge "Make resize/migrated shared storage aware"
Merge "Allow a floating IP to be associated to a specific fixed IP"
Merge "Add unitests for VMware vif, and fix code logical error."
Merge "Show exception details for failed deploys."