Fix inaccuracies in the development environment doc.

Change-Id: If2b0884de54b75e40896cee9b4fb5eb805de2624
Fix network list and show with quantum.

The quantum driver was returning data in a format that was not
compatible with the extension. This munges the data and handles
fields that don't exist so the extensions still work.

Fixes bug 1076519

Change-Id: I5e00bfa72e8ce1d486f9aa4dddbe1080ff74cd6a
Add support for instance disk IO control.

Part 3 for blueprint quota-instance-resource, by setting exposed params
"disk_read_bytes_sec, disk_read_iops_sec, disk_write_bytes_sec,
disk_write_iops_sec, disk_total_bytes_sec, disk_total_iops_sec"
through nova flavor-set, user can implement instance disk IO control
policy.
for example:
nova flavor-set m1.medium set disk_write_bytes_sec=10240000,
then the max disk write IO is 10MB/s for VM user.

partly implement blueprint quota-instance-resource
original reviews https://review.openstack.org/#/c/14151/
DocImpact

Change-Id: I8605acf61d7ddbfdaf6eee3ab135898df2449484
Add support for instance CPU consumption control.

Part 4 for blueprint quota-instance-resource, by setting cpu_shares,
cpu_quota,cpu_period through nova flavor-set with admin credentials,
 the cloud admin can implement flexable policy on VM vcpu to physical
CPU consumption ratio.

for example:
nova flavor-key m1.low_cpu set cpu_quota=10000
nova flavor-key m1.low_cpu set cpu_period=20000
the instance of m1.low_cpu can only has a max of 50% CPU consumption
of a physical CPU computing capability.

original reviews https://review.openstack.org/#/c/14151/
DocImpact
partly implement blueprint quota-instance-resource.

Change-Id: I9ea1229ee78a4d706b1a18c0f4f15157611952e4
Documentation cleanups for nova devref

This patch contains a number of cleanups of the nova devref,
mostly related to outdated content.

1) remove outdated todo items from network
=> these have been long covered in the manuals

2) remove outdated multinic docs and images
=> this is now better covered in:
http://docs.openstack.org/trunk/openstack-compute/admin/content
/using-multi-nics.html

3) remove outdated cloudpipe docs, confs and scripts
=> This is now better covered in:
http://docs.openstack.org/trunk/openstack-compute/admin/content/
cloudpipe-per-project-vpns.html

4) remove outdated networking docs
=> These were marked as 'legacy' more than 2 years ago

Change-Id: I9321335031b4581c603a6f31c613e1b620d468a6
Add basic infrastructure for compute driver async events

This introduces the basic infrastructure to allow compute
drivers to emit asychronous events for processing by the
virt API. Initially the only event defined is a "lifecycle"
event which allows the virt API to immediately detect the
start and stop of virtual domain instances, without needing
to frequently poll the compute API.

The base compute driver gains a method enabling the manage
to register a callback to receive events, and another method
to allow driver subclasses to emit events.

Blueprint: compute-driver-events
Change-Id: Ic9abcd3f829c106e840538a01376862ab5b3485b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for lifecycle events in the libvirt driver

This wires up the libvirt compute driver to process async
events from libvirtd and emit lifecycle events. This makes
use of the native libvirt event loop to handle I/O processing
which requires a native thread.

The native thread uses a queue + self-pipe to forward events
onto a green thread. The green thread reads events off the
queue and uses the emit_event method to dispatch them to the
compute manager.

Blueprint: compute-driver-events
Change-Id: Icd2cb7081adde10420ae55beebe60350afe21379
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Handle lifecycle events in the compute manager

Update the compute manager to register an event handler
with the compute drivers. The initial handler will process
lifecycle event notifications, to allow prompt synchronization
of DB & hypervisor power states. This means that if a guest
admin does 'shutdown -h now' the libvirt driver in Nova will
immediately notice that and mark the guest as SHUTOFF rather
then leaving it RUNNING until the periodic task runs sometime
in the next 10 minutes

Blueprint: compute-driver-events
Change-Id: I39a6d450a6d6384b8be58aceea98e4395185cc38
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for network adapter hotplug.

    This patch makes it possible to add/del instance
    interface other than booting time.
    Implement bp:network-adapter-hotplug

Originally from change Ibee003a9ec6cc9b3fd275417caccd0c67f6c871f

Co-authored-by: Yaguang Tang <heut2008@gmail.com>
Co-authored-by: Édouard Thuleau <edouard.thuleau@orange.com>

Change-Id: I4f8f677af58afcb928379e5cf859388d1da45d51
Make  ComputeTestCase.test_state_revert faster

Reuse instance instead of creating a new one every time.

Before:
nova.tests.compute.test_compute.ComputeTestCase.test_state_revert 11.032 seconds
After:
nova.tests.compute.test_compute.ComputeTestCase.test_state_revert 6.415 seconds

Change-Id: I67a5a971c3898d4fffed9e6b4640c6c0f3c62a56
PowerVMDiskAdapter detach/cleanup refactoring

Define PowerVMDiskAdapter interface as contract for implementation

Change order lpar, disk devices and volumes are cleaned up

Change-Id: I0004b0d71cb8a8dd9c4d502dd1278c10bdc7c8e2
Merge "PowerVMDiskAdapter detach/cleanup refactoring"
support preallocated VM images

Use fallocate where available to allocate file system blocks efficiently
when the VM is initially provisioned. This will give immediate feedback
if enough space isn't available. Also it may significantly improve
performance on writes to new blocks, and may even improve I/O
performance to prewritten blocks due to reduced fragmentation.

Also noted is the potential to subsume the less general
libvirt_sparse_logical_volumes option into the new more general
preallocate_images option.

Implements bp: preallocated-images
Change-Id: I4bbb8616416c9dca3a3a8894ebf764a0b6b8dbc9
Use oslo-config-2013.1b4

The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b4 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already
does for paste. It turns out imp.find_module() doesn't correct handle
namespace packages.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
Fix hacking test to handle namespace packages.

This removes our workaround for namespace packages and improves
detection of missing imports due to non-existent dependencies.

Fixes bug 1130411

Change-Id: I89ee8249580e395f786289792cdf74219d041f2f
Multi-tenancy isolation with aggregates

A new scheduler filter that allows the creation of instances from
specific tenants in selected aggregates.
With this filter is possible to isolate tenants in a specific set
of compute nodes (aggregates).

If a host is in an aggregate that has the metadata key
"filter_tenant_id" it can only create instances from that tenant(s).
A host can be in different aggregates.
If a host doesn't belong to an aggregate with the metadata key
"filter_tenant_id" it can create instances from all tenants.

Implements: blueprint multi-tenancy-aggregates
DocImpact

Change-Id: I119c809c54da9e9dc3ac506c02203d2d4422b06e
Merge "Add support for network adapter hotplug."
Merge "Add support for instance disk IO control."
Merge "Add support for instance CPU consumption control."
Merge "support preallocated VM images"