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
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
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
Makes api extension names consistent

We have a few extensions that are using strange _ in their names.
The Class names have to be named this way to be picked up properly
by the loading code, but the user facing name is much nicer in
PascalCase, so this switches them over.

Change-Id: I9326410add1317ef006559d5ca2205a4487371e2
Adds api sample testing for extensions endpoint

Includes minor updates to base class to handle multiline descriptions
and makes the extensions endpoint use a sorted list of extensions.

Change-Id: I3604e3969b892646d5bbe08af44d454ee40e6f9e
Clean up non-spec output in flavor extensions

Adds option to cache flavors in the request object like instances.
Modifies the flavorextradata extension to use the cache and optimizes
tests. Adds flavor_disabled extension to control the extra data and
includes tests. Fixes api samples to show the new extension.

Fixes bug 1043585

Change-Id: Ie89df24a2891e3869d3fb604e07c79e8c913f290
delete unused valiables

Change-Id: I65f5ca04882a0738eaad1f61e255d371fa6204ae
xenapi: Removing legacy swap-in-image.

This patch removes our legacy handling of swap in the image. Now that
we're generating swap on-the-fly, this stop-gap solution can go away.

Change-Id: Ied3198f77af8dabb6cfbf2ab9cfb3a4eb18e32ea
Spelling: Persistant=>Persistent

Change-Id: I0d22e3f03e8f1a74a8bce7c76c93c9c7170defd5
Merge "delete unused valiables"
Merge "External locking for image caching."
Merge "Spelling: Persistant=>Persistent"
FLAG rename: bandwith_poll_*=>bandwidth_poll_*

Fix bug 1036407

bandwith_poll_interval is deprecated in Folsom and will be removed in
Grizzly

Change-Id: I32cbdffce21a0024bd0303d46d7b7632db6ec8cb