Port certificates API to v3 Part 1

This changeset only copies the v2 files (implementation and test)
into the appropriate v3 directories unchanged. The copy as-is
will not be loaded by either the v2 or v3 extension loaders. The
second changeset will then make the changes required for it to
work as a v3 extension.

This is being done in order to make reviewing of extension porting
easier as gerrit will display only what is actually changed for v3
rather than entirely new files

Partially implements blueprint nova-v3-api

Change-Id: Ibdb3b444432fa707786e6bb43aaba61d2a3fc89f
Port certificates API to v3 Part 2

This patch contains the changes required to adapt the certificates
extension and the corresponding unittests to the v3 framework

Partially implements blueprint nova-v3-api

Change-Id: If4fe7e8524ba0181b50722281f594e0a80cd49ed
Adding fixed_ip in create.end notification

Sending the network information for an instance in the create.end notification.

Fixes bug 1185076

Change-Id: Iabe088ed23736d7b1ee97624761445023aab22c2
Cleanup certificate API extension

Fixes a couple of minor issues with the v2 and v3 versions
of the certificate API extension identified during the
v2->v3 port
* Removes unused CertificatesTemplate class
* Corrects doc strings for a couple of methods

Change-Id: If022d2393ceab5ce7e6311c92a6f52b6325039bc
Initial scheduler support for instance_groups

Scheduler support for blueprint instance-group-api-extension

The patch set adds the following:
1. conductor support for getting instances via the instance_group uuid
2. conductor support for removing an instance from the instance_group
   members

In addition to this it replaces the 'group' hint with 'instance_group'.

DocImpact

Change-Id: I4a4febc2e85d4ffc8b1579d2673fa107171a3c5b
Allow reboot or rebuild from vm_state=Error

In general most operations are only valid on an
instance that has booted successfully at least once
so this change extends the instance state check
logic to include evidence that the instance has
been successfully started at least once.

This enables more operations to be allowed in
against instances in an Error state.  For example
reboot and rebuild are useful recover options for
an instance which has reached an error state, but
not if the instance failed during its initial build.

With this change the only actions allowed on an
instance which has never booted successfully are
delete and force_delete.  Soft delete is not
allowed, as the restore is in effect a start unless
there is specific virt driver support.

In addition the following actions are now allowed
against instances in an Error state providing the
instance has booted at least once:  Reboot, Rebuild,
and Rescue.

Fixes bug:   1183946

Change-Id: I63fd8d2a182df5cf12754892e8076933b3b1e79f
Setting static ip= for baremetal PXE boot.

This patch adds a new option "pxe_network_config" to baremetal PXE driver,
if set it tells the driver to append the network configuration to the
kernel cmdline. Initramfs built with network support could then benefit
from this option and avoid the injection of network configuration files
into the image.

DocImpact

Change-Id: I61dc946f42f8a86eaad0e73b033a0d8da4a74e40
Remove db session hack from conductor's vol_usage_update()

Commit 3cf4cb2534c387f287f118d4185d54b1435d3bc0 made the
vol_usage_update() in conductor hack around a stale sqlalchemy
object issue by keeping session active in the current context
until the notification was completed. This layering violation
led to some "creative" tests to try to verify this behavior.

This removes that and refreshes the object before letting it
out of the db/api layer so that all the attributes are present,
thus avoiding the dynamic load during notification.

Change-Id: Ia6ef5cb7f462ff72d170f3af33f2d020ee4d3e3c
Remove the unused plugins framework

This framework was merged a year ago and AFAICT hasn't seen use beyond
the two initial wikimedia extensions.

The framework basically allows a way for a single plugin to register API
extensions and notification drivers. Both of these can be done by
directly using config opts like osapi_compute_extension and
notification_driver so this framework really only helps if we expected
to (and wanted to) lots of these plugins in the wild.

Change-Id: I09a11f9931ee0436a56e8b0d925683b54f73b104
xenapi: revisit error handling around calls to agent

Now we have settings to hint if the agent is present or not,
and by default we do not check for the agent,
if the agent is not responding to our calls for its version,
we can fail the build.

In environments that need the agent to inject the networking,
you really want the agent to fail if it is not present.
If the agent did not inject the networking, the server will
have no networking.

However, we can still leave the agent upgrade to silently
fail, as the agent should be backwards compatible.

fixes bug 1188540

Change-Id: I8acdabd8d2bd24b088dad3cd4abec300d0ada3fb
Remove straggling use of all-kwarg object methods

This removes one remaining vestige of the days of yore when
nova developers were forced to always use kwargs on object
methods out of fear, lest it be used over RPC.

Related to blueprint unified-object-model

Change-Id: Ieba76efc2f5daed08e4bde9096c0e178f1f44466
Use InstanceList for _heal_instance_info_cache()

This makes _heal_instance_info_cache() use InstanceList for the
all-by-host query.

Related to blueprint unified-object-model

Change-Id: I93872a35ff249bbeb7d02bfe54a7d83676aa447a
Remove a layer of nesting in _poll_unconfirmed_resizes()

This simply changes the logic atop _poll_unconfirmed_resizes()
and de-indents everything that was nested underneath by four
spaces. It makes it much easier to work on without the useless
extra level of nesting.

Change-Id: I0d65fe2d1fc2649e0527ecbed1e6682b3da52b2b
fixes nova resize bug when force_config_drive is set.

If files is None, set contents=[] when calling
instance_metadata.InstanceMetadata from within _create_image() to prevent
the method trying to iterate a NoneType.

Fixes bug 1183003

Change-Id: I0ac18ad5363ab9496fa83d231d7ec7c59d737691
Merge "Adding fixed_ip in create.end notification"
Merge "Initial scheduler support for instance_groups"
Revert "Initial scheduler support for instance_groups"

This reverts commit b2c17ae891b12118b9d11bf0ecc44e77956715c8.

While reviewing merged changes, I came across this one.  It's using the
conductor in a way that it shouldn't.  The scheduler has db access, so
there's no need to add the extra conductor overhead.  The best thing to
do here is to just revert for now, IMO.

Change-Id: Iaa0d67df7bb84913784d925cffebcd5f252249ea
Merge "xenapi: revisit error handling around calls to agent"
Merge "fixes nova resize bug when force_config_drive is set."
Merge "Remove straggling use of all-kwarg object methods"