Set is_public to False by default for volume backed snapshots

This update results in the same behavior that is already implemented
in _create_image where the meta_data for is_public is set to False.

Change-Id: Ie0720d5c847871527db7d9477ca6cb05abe7a1a5
Closes-Bug: #1255316
Correct uses of :params in docstrings

Replace all occurrences of :params with :param alongway
(matches http://sphinx-doc.org/domains.html#info-field-lists)

Change-Id: Ia01e563dd54cce1e763c076b15d1a47b790eb802
Pass rbd_user id and conf path  as part of RBD URI for qemu-img

Unlike rados.py, qemu-img does not use id from CEPH_ARGS and has to be
given a ceph user id and conf path explicitly in RBD URI

Closes-Bug: #1261675
Change-Id: I9226515f2a860ed45d12012fd5b6bc7e842f6d32
Change RPC post_live_migration_at_destination from call to cast

We don't expect post_live_migration_at_destination to return anything,
so change call to cast.

Change-Id: Iccdb6e195d1d5d9b96e1372206823d414caae872
Adds user_data extension to nova.api.v3.extensions

Although the user_data extension does not create a resource
or controller extension and only implements server.create and
server.create.deserialize entry points it does need to be listed as
a nova.api.v3.extension entry point as the whitelist check
operates on that entry point.

This does not add any runtime overhead and allows user_data to be
specified in the whitelist.

Also adds missing discoverable policy for the user data extension

Partially implements blueprint nova-v3-api

Change-Id: Ia8ac2fa150ab2fe9c1848c5a7ddc416952adf0e4
Change log from ERROR to WARNING when instance absent

Periodic task will update the host stat so that it will
collect all active instances and get their disk size
during the operation period, the instance might be resized
by nova operations, it will lead to disk file not exist
it's not an error from current design point of view, so
change from ERROR to WARNING to avoid confusion

Change-Id: I3b6f1416c248d9d4d2caaf2cc30a7c944685661c
Closes-Bug: #1243849
Rename instance_type to flavor in hyper-v virt driver

Renames 'instance_type' to 'flavor' in the hyper-v virt driver and
associated tests.

Part of blueprint flavor-instance-type-dedup

Change-Id: I769bf86a63283152c5bbc5644e7b74cc2bb24697
Extends V3 os-hypervisor api for pci support

All pci passthrough code is merged into nova, but the APIs do not support.
this patch extends os-hypervisor to show PCI information for instance and
compute node. This is a part of PCI APIs, for more information see the
blueprint.

Partially implement blueprint pci-api-support

Change-Id: Ia366df257f077c74b1a6639b7078ba4230d3f1a7
Add finer granularity to host aggregate APIs

This change provides the ability to set finer permission rules around
the host aggregate APIs. Prior to this change, all operations assumed
that the same permissions were necessary. However, it's very possible
that an OpenStack administrator may want to have varying sets of
permissions for operations across the standard CRUD operations.  This
change is only applicable to the v3 APIs as v2 APIs should remain
backwards compatible.

Also included is a change to fake_policy.py (since the file was
updated anyway) to make the base aggregate policy require the
'admin_api' rule (i.e., to be consistent with the policy.json file).

Also added the corresponding API test cases.

DocImpact v3 host aggregate APIs require action-level policies
Implements: blueprint aggregate-api-policy

Change-Id: I8a88824bbb41807fad849ad15af4411d3a3dca6e
baremetal: stop deployment if block devices are not available

In this case deploy-helper should abort immediately and make sure
that the instance's status set to ERROR.

Closes-Bug: 1251525
Change-Id: Ic09f171edb0fe3a449c7adfe622ab48709c73252
Remove unused copyright from nova.api.__init__

This patch removes unused license doc from nova/api/__init__.py.

Change-Id: I40b7dbce27ece7a56c9fd3186fa5c4a88623d32b
VMware: bug fix for VM rescue when config drive is configured

The addition of the config drive feature broke the VM rescue. The
cause of the problem was setting the instance UUID to the name of
the rescue instance. This must be a UUID! The solution
is to pass the instance name to the spawn method instead of writing
this on the instance UUID.

Change-Id: Ia8494b0c8099753b666bda18a19c4c9a3f764616
Closes-bug: #1247427
nova docker driver cannot find cgroup in /proc/mounts on RHEL

In order to support the docker hypervisor on rhel/centos or fedora
we had to adapt the function which resolves the cgroup path.

Change-Id: Ie24028f822d91d65d4f90a7941e7b11874a3b425
Closes-Bug: #1243101
Enabled Libvirt driver to read 'os_command_line' from image properties.

The os_command_line can now be presented to the Libvirt driver through the
glance image property 'os_command_line'.  When this property is present,
the driver uses its value instead of the default. Libvirt uses this
value as either kernel command line or arguments to init (in case of LXC).
DocImpact

bp: enable-libvirt-driver-to-read-kernel-command-line-from-glance-image
Change-Id: Iad53c687053bdb5469baad4331ea55f428c170b0
Use the mangle checksum fill rule regardless to the multi_host

The checksum-fill is required even when you are running devstack,
in a nested kvm guest.
Always using the checksum-fill on all dhcp responses is safe, and does
not have significant impact.

The situation is similar when the checksum-fill first introduced to
nova.

See Also:
https://bugzilla.redhat.com/show_bug.cgi?id=910619#c6

Change-Id: I8a34d5f815f6bfef6d683965ed51a77e82af8834
Using staticmethod to mock LibvirtDriver._supports_direct_io

The actual test is wrong, but does not failed because the signature
of the fake method "connection_supports_direct_io_stub" accepts an
ulimited number of args.

Change-Id: Ide3e093911723f787d9e84797be86fb7d0cd00c7
libvirt, fix test tpool_execute_calls_libvirt

An exception raised by mock for expected method is obscured
by the "catch Exception" on libvirt/driver.py#643.

This patch updates the test to be more coherent with the code.

Change-Id: I629634395d11432f9d7e4fbe330b864490fa1801
Optimize libvirt live migration workflow at source

During live migration, after instance migrated to destination, we
call Hypervisor destroy to clean the instance, this can be omitted
because it doesn't exist in source server already. This patch changes
cleanup to a public method to driver, split instance destroy to two
step:

1. destroy instance in the Hypervisor
2. cleanup instance resources(block device, network)

Change-Id: I65e711c03fee7342b1e2bc4f9459baae7729f911
Closes-bug: 1240820
Remove unused dict BYTE_MULTIPLIERS

Dict BYTE_MULTIPLIERS in nova/common/utils.py isn't used
anywhere, and nova/openstack/common/strutils.py includes
this dict, So we can use the one in oslo if we need. It's
safe to remove it now.

Change-Id: I6dde9d7edbaa5e1cbdd6790fe427249d4c2d41ab
VMware: unnecessary session reconnection

An error FAULT_NOT_AUTHENTICATED could imply that there is a problem
with the backend or that no values were found (for example there are
no running VMS). In the latter case the connection should not
be restarted.

The patch also ensures that the session is restarted if there are
connection issues.

This issue occasionally causes CI issues with minesweeper.

Closes-bug: #1265512

Co-authored-by: Shawn Harsock <hartsocks@vmware.com>

Change-Id: Ibfa83d0b5b93680890aad8c88c041fa344765448