Implements Scheduled Images Extension

The extension creates a new resource under servers/id to get, create
and delete it's scheduled image.

On the servers list and detail calls, it adds the system metadata
related to scheduled image service on the server dict in the response
object. It also enables filtering by the system metadata added by the
scheduled images service and if it exists, adds it on the servers
dictonaries.

bp https://blueprints.launchpad.net/nova/+spec/scheduled-images
Fix OS SI filters

Change-Id: Ie890cb62eda4366f6c2618d9f489841a12f2e57f
Merge pull request #26 from rackspace-titan/fix-filter

Fix OS SI filters
fixes xml to omit OS-SI in prefix

in image_schedule responses, we should not prefix OS-SI
in xml namespace
Merge pull request #27 from rackspace-titan/extension-OS-SI-xml-namspace-none

fixes xml to omit OS-SI in prefix
nova-manage: remove redundant 'dest' args

Includes a hack to calculate 'dest' from the argument name. This hack is
removed in a later commit.

Change-Id: I60567ff232ab7699f3234b3bfc1618a17a648976
nova-manage: remove unused import

Unused since commit 9ff3121b

Change-Id: I76bb49669d1cdfc3bf5b1c20087b4bd77420cd91
Pass project id in quantum driver secgroup list

The quantum driver is always returning security groups from every tenant
a user has access to, even when the "project" filter is supplied.

Make sure we pass along the project value when we call
quantum.list_security_groups() so it's properly filtered.

Fixes bug 1155381.

Change-Id: I682c66a1f3f9db18b5f9924a37b45c759ff259f7
List InstanceNotFound as a client exception

get_instance_nw_info() in nova.network.manager should list
InstanceNotFound as a client exception for rpc. This to prevent the
rpc layer from logging a traceback when this exception is raised.
This is an expected type of exception that should be left to the
client to handle.

Resolves bug 1157411.

Change-Id: I6735fb8a386f2256ac8af0ce7fdb36ef7a00b6ce
Add caching for ec2 mapping ids.

Requests to map ec2 ids can be slow when there are a large number
of instances. These shouldn't ever change so cache them in memory
for a week. The one week timeout is simply to prevent memory from
growing uncontrollably.

Fixes bug 1157437

Change-Id: I3f1c68959a933a7aaa50f122c34a716264c8722d
Fix Hyper V instance conflicts

Fixes bug 1152368

If the hyperv driver attempts to boot an instance and a previous
instance with the same name was not properly removed, the boot will
fail due to an error creating root.vhd.  This only happens when
using CoW images.  This fix deletes the instance directory before
creating the new instance so that there will never be an old image
to interfere with creation of the new one.

This is most likely to be an issue in development and test
environments that toggle between versions of nova with no migration
path.

Change-Id: I21eab01590c426234b4b9a55abec4b2d2df0e168
Change type of ssh_port option from Str to Int

The type of CONF option virtual_power_ssh_port was incorrectly defaulted
to Str. This can cause Paramiko to raise when casting to %d.

Fixes bug 1157824.

Change-Id: I30ddd1ff0da45f8392085249f1bd2a539b201a7e
Change arguments to volume_detach()

Most compute API calls accept an instance object.  To be compatible with
cells, volume_detach() should as well.  Also change it to accept the
volume object, instead of just a volume ID.  This lets us proxy the
volume object to child cells a bit more easily.

This removes 2 skipTests that we have related to volumes and cells.

Fixes bug 1157408

There was also a check that if instance_get_by_uuid() returned no
instance, it VolumeUnattached should be raised.  However, this check
would never work as InstanceNotFound would have been raised.  This
patch also corrects that.

Change-Id: Ide35ad5d8e147f6bd21b5840b901363dab0eae38
Don't actually connect to libvirtd in unit tests.

The libvirt tests shouldn't actually be connecting to libvirtd
while running unit tests. Many of the tests were calling either
getLibVersion or getCapabilites, which would start a connection.
Fake these out so the tests can run properly without libvirtd.

Fixes bug 1157992

Change-Id: Iff1a60fc3cc912fdaf641f1f289744bcc9cc9736
Bring back sexy colorized test results.

Also attempt to keep test results together and print out a nice
display of the ten slowest tests.

Change-Id: Ib54eb6dede8650ebafc3f069ee7b4a8c4c1a523c
Update instance network info cache to include vif_type.

vif_type is a new param in legacy_nw_info added in grizzly, and when upgrading
from folsom to grizzly, the existing instance's network info cache in the db doesn't
contain this param, which is needed by vif driver to plug vif to instance. Nova
compute will try to plug the vif when it starts the instance, so we need to update
the existing instance's network info cache before pluging instance's VIF.

fix bug #1152426

Change-Id: I1b839bf791b402b933354d9c17c5713fde21ab09
nova-manage vm list fails looking 'instance_type'

The recent set of changes to remove the join on instance_types and get
data from instance_system_metadata missed out the use in
"nova-manage vm list"

fixes bug:  #1158352

Change-Id: I5b06a4fef34331abe40e7429b3abda47070bcbbc
Remove outdated try except block in ec2 code

We now have 'ec2_id -> glance_id mapping' so this check can be removed

Change-Id: Ib10ab5faea154bae9d129c0dc1edc24c2a99ffb7
Remove unnecessary DB call to find EC2 AZs.

Update get_availability_zone_by_host, so it doesn't need a list of services,
and remove unneeded service_get_all_by_host calls. This removes N DB calls in
the EC2 api when doing a DescribeInstances, where N is number if instances
that are being described.

Partially fix bug 1157437

Change-Id: I0050ba736828faad94549bc6e55f4ca1d05dcbe7
Make nova.virt.fake.FakeDriver useable in integration testing

With this change nova.virt.fake.FakeDriver can be used for scale testing
using devstack. By setting 'compute_driver = nova.virt.fake.FakeDriver'
in nova.conf and disabiling quota and other limits, we can load up nova
to think it is running 1000's of instances.  This particular scenario is
analagous to how the baremetal driver will work (one machine managing
100's to 1000's of instances).

Make nova.virt.fake.FakeDriver use CONF.host for hostname.

Change-Id: I731ca2968176b4e39dd2fe7fc99f479cc568398b