Add public network support when launching an instance.

Fixes bug 1039419.

A concept of public network has been implemented in Quantum.
To launch an instance connected to public network, we need to check public
network (whose 'shared' attribute is True) in addition to network owned by
the current tenant.

Change-Id: I128e68a8b9404056f74153bf8f576cfa8b438e19
Add version 2.0 of compute RPC API

RPC API versioning is helpful because (a) it gives useful error messages
if there is a version mismatch and (b) it allows you to update to a new
version of the API on the server side before updating the client side.

However, we still regularly encounter DB changes which force the client
and server side to be updated together. This will not be resolved until
no-db-compute is fully implemented.

It's safe to say that RPC API clients using version 1.0 will not work
with a version 1.44 compute manager (because of DB schema changes). The
issue, then, is that continuing to support 1.0 clients in the Folsom
release seems pointless and the alternative of removing legacy RPC API
support would mean a lot less cruft code in the release.

Before removing version 1.x of the compute RPC API, we add version 2.0
while still retaining 1.x support. This gives users the option of
upgrading all compute RPC API users to use version 2.0 before version
1.x support is removed from compute nodes.

Change-Id: I1c74b36a84d770b0af5ca33062e069a545537ee2
Remove compute RPC API version 1.x

Now that we have RPC API versions 1.x and 2.0, we could choose to
continue to support version 1.x in Folsom and only remove it in
Grizzly.

This, in theory, would allow smoother upgrades of older Folsom
versions to the final Folsom version. However, in reality, we
most likely made DB schema changes which affect the compute service
and would prevent such a smooth upgrade anyway.

Removing 1.x support now removes a lot of potentially buggy backwards
compat code from the release and will also make backporting fixes from
Grizzly to Folsom easier.

Change-Id: Ic18017a16c5bffee85a43db65ff17283599a27ba
Adds api sample testing for versions

This patch tests api samples for the versions resource in json and
xml. It makes a small modification to the integrated api client to
support making requests above /v2/tenant_id.

This also fixes an uncovered bug in the link handling in the versions
resource.

Fixes bug 1041426

Change-Id: Ie898ef3822fa250def2e0fa407a0968275262260
Stop using scheduler RPC API magic

If a scheduler RPC message isn't handled directly by a SchedulerManager
method, the __getattr__() fallback passes the message to a driver
method in the form of schedule_${method}() and, if that doesn't exist,
instead calls the schedule() method supplying the topic and method
args.

This is pretty bizarre stuff and we appear to only use it in two cases:

  1) live_migration - this is how the schedule_live_migration()
     method in the driver gets called, but the side-effect is that
     we require the client to pass a topic argument which is never
     used. This would be much more sanely handled with an explicit
     SchedulerManager.live_migration() method.

  2) create_volume - the volume API asks the scheduler to pick a
     target host for create_volume() using this method. This would
     be easily handled with an SchedulerManager.create_volume()
     method.

Change-Id: I1047489d85ac51d8d36fea1c4eb858df638ce349
External locking for image caching.

If the instance storage is shared between compute nodes, then you
need external locking which is also shared to avoid clobbering each
other's attempts to cache base images. Resolves bug 1014227.

Change-Id: Ic2ac87840904fa199c17774dae9556ad6c7a3eaf
Assume virt disk size is consumed by instances.

Use disk_available_least other than free_disk_gb to consume.
assume virt disk size is consumed by instances when calculate
the available disk size.
fix bug lp:1042071

Change-Id: I82dc3bcfd97219085c624c81dfa47cbf0bcd4504
Add a new exception for live migration.

Raises new exception InvalidLocalStorage instead of
InvalidSharedStorage when block migration is used with shared storage.
Corrects the message of InvalidSharedStorage.

Fixes bug 1043165

Change-Id: I68bfac3f89276edc38c00ca963911fe07456dc0d
Implements PowerVM get_available_resource method.

Implements get_available_resource method in the PowerVM driver to
fix the failure when launching nova-compute. Also, it removes the
update_available_resource method from PowerVMDriver which is no longer
required.

Fixes bug 1040789

Change-Id: Ibc7e9b80e6d9b8ef3c1a844783a890c592517f89
hacking: Add driver prefix recommendation.

Prefixing the commit message's first line with the driver makes it
easier for reviewers, at a glance, to find reviews that relate to their
area of expertise as well as improving the overall readability of the
git history.

Change-Id: I376d2cdb5dc344717fb7749a80e33ee88603e68c
Remove some remnants of VSA support

The VSA code removed by commit a3bab242 was the only user and
implementor of the 'create_volumes' RPC method.

Change-Id: Ic718d54d938059b034b78bc287668b0b9fa27f94
Add version 2.0 of the scheduler RPC API

Like we did for the compute RPC API, add version 2.0 of the scheduler
API while still retaining 1.x support. This allows all services to
be updated with 2.0 support before 1.x support is removed.

Change-Id: If438d5b6f521ea4c487d1490d4b8cf6547ba5c72
Remove scheduler RPC API version 1.x

Like with the compute RPC API, we're unlikely to still work well with
RPC client using older 1.x version because of DB schema changes.

In that case, we may as well remove 1.x support in Folsom and rip out
the potentially buggy backwards compat code. This should also make
backporting fixes from Grizzly easier.

Deployers following trunk can upgrade all their nodes to use the version
2.0 API before deploying this commit.

Change-Id: Iee099751bda9637da5e134357d28e89d5fba9895
Sort API extensions by alias.

Updates the ExtensionManager so that extensions are sorted by alias when
accessed via the get_resources or get_controller_extensions functions.

This fixes the
integrated.test_api_samples.ServersSampleAllExtensionXmlTest.test_servers_get
test which fails on Fedora 17 (but passes on Fedora 16 and apparently
some other distros as well).

Includes updated api_samples for XML that was regenerated by the
test_servers_get test.

Fixes LP Bug #1042709.

Change-Id: I82c679f457a3cd11c8a8cd76f402693b61bb14cc
Update requires to glanceclient >=0.5.0

Change-Id: If788b94a142f469b5ce47c49a4dcdb05f1455cce
Spelling fix Retrive=> Retrieve

Change-Id: I7eeb8b8477884b1b4e847fe3d76b9b7d578bda8a
Merge "Sort API extensions by alias."
Merge "hacking: Add driver prefix recommendation."
Merge "Implements PowerVM get_available_resource method."
Fixes spawn method signature for PowerVM driver.

ComputeDriver has now 2 new required arguments which are:
injected_files and admin_password. This patch adds the
arguments in the PowerVMDriver spawn signature.

Fixes bug 1040770

Change-Id: I0a45fa45c942f2d0381c5a7310d386ae655073fe