Don't allow EC2 removal of security group in use.

Fix bug 817872.

This patch modifies the behavior of removing security groups via the EC2
API to better match the EC2 API spec. The EC2 documentation says that a
group that is still in use can not be removed.

A new function has been added to the db API to find out whether a
particular security group is still in use.  "In use" is defined as
applied to an active instance, or applied to another group that has not
been deleted.

Unit tests have been updated to ensure that an error is raised when
these conditions are hit.

Change-Id: I5b3fdf1da213b04084fe266c1a6ed92e01cf1e19
Make database downgrade works

Fixes bug #854905

Use sqlalchemy reflection whenever possible:
    http://sqlalchemy-migrate.readthedocs.org/en/latest/versioning.html

Work around sqlalchemy-migrate sqlite 'bool column not deletable' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143
    Add following sql scripts for sqlite:
        002_sqlite_downgrade.sql
        015_sqlite_downgrade.sql
        033_sqlite_downgrade.sql
        050_sqlite_downgrade.sql
        068_sqlite_downgrade.sql

Work around sqlalchemy-migrate sqlite 'table with foreign key column not
deletable' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=94
    Add following sql scripts for sqlite:
        003_sqlite_downgrade.sql
        006_sqlite_downgrade.sql
        007_sqlite_downgrade.sql
        012_sqlite_upgrade.sql
        013_sqlite_downgrade.sql
        020_sqlite_downgrade.sql
        030_sqlite_downgrade.sql
        038_sqlite_downgrade.sql
        042_sqlite_downgrade.sql
        053_sqlite_downgrade.sql
        067_sqlite_downgrade.sql

Work around sqlalchemy-migrate 'migrate drops engine reference' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=72

Add following sql scripts for long primary key to work with utf-8
mysql table:
    072_mysql_upgrade.sql

Add following sql scripts for postgresql:
    002_postgresql_downgrade.sql

Add snake walk test cases for database migration based on glance migration
test.

Change-Id: Ib454ecb4662bbf47736c1b12d9a4f969f180ceb6
Actual fix for bug 931608.

-x --stop is a nose flag
Provide short term solution to deal with '--hide-elapsed'

Can be tested by adding a assertTrue(False) in a test and running
./run_tests.sh -x

Change-Id: I7357e7cdaa3d6370ed111d6209917a833d084db3
Fix quantum get_all_networks() signature (lp#936797)

The base NetworkManager get_all_networks() method requires
a context argument.

Change-Id: I8276caf879c3711f411cb16a0fc288cfc9b47965
Add attaching state for Volumes

bug 897726 Add "attaching" status for volumes and clear state on error
This closes a gap where multiple calls of attach for the same volume
can happen before the volume is actually attached.

Change-Id: I59d22ceda83729c1a455af9994c9ffec1912e23b
Add exception SnapshotIsBusy to be handled as VolumeIsBusy.

This is helpful when driver can not delete snapshot if it has volumes
created from it.
Add tests for both VolumeIsBusy and SnapshotIsBusy cases.

Change-Id: I3fcc6b1ffdfbc7e22ed30ac832db500eb3260d04
Clarify use of Use of deprecated md5 library

See Invalid bug 937463 for more details
Also change run_tests.sh to ignore more '*.pyc' files

Change-Id: I8c8ded902833fe4268966ff7a9630daaaad43a19
Fix vnc docs: novaclient now supports vnc consoles.

 * novaclient now supports retrieval of vnc consoles, so remove
   reference to outdated branch.

Change-Id: Ifb8d7e6d2e15d3674fd32f074d1a92e5035ed941
Don't store connection pool in RpcContext.

Fix bug 934575.

As Chris pointed out in the bug, there is a downside to this approach to
fixing the bug, in that a manager will no longer be able to use
context.reply(). However, it wasn't being used at all, and it's no loss
in functionality.  A remote method can still return multiple values (in
response to a multicall()) by using yield.

Change-Id: I0e5aff2e8a40ffd8390c0e19d89dd17e60a74130
Add 'nova-manage export auth'

* Introduce ability to dump auth data to json blob for consumption by keystone
* Implements bp keystone-export-rewrite

Change-Id: Ic8c0ade8350daa449fb6df7ad3c55c3ae2b0c2c7
Support fixed_ip range that is a subnet of the network block

This enables flat deployments where the instances live on the
'general' network.  For example, a typical home router uses
192.168.0.0/16 for the private network.  Cloud machines can be
assigned 192.168.100.0/24.  An example network create command:

nova-manage network create private 192.168.0.0/16 1 65536 \
   --fixed_cidr=192.168.100.0/24 --gateway=192.168.1.1

Change-Id: I17edd81e9bc21ca3320233b606c99e03e25201bc
Move get_info to taking an instance.

This is a first step towards using uuids in this interface instead
of instance names (which are synonyms for instance ids).

Change-Id: I54b32a5020b0dbc21ba7156ed38ed188c483086b
blueprint host-aggregates: improvements and clean-up

This changeset addresses a number of issues found during testing:

- avoid name conflicts during aggregate creation (see db/* changes)
- avoid masking of XenAPI.Failure if pool-join fails (see plugins/* changes)
- preserve VM placement decisions made during scheduling (see xenapi/vmops.py)
- ensure plugins are called on the right hosts in XS pools (see xenapi_con.py)
- stores master uuid in aggregate metadata for use in VM live migration and
  raise InvalidAction rather than Aggregate error if we attempt to remove
  a mster (see xenapi/pool.py and compute/manager.py)
- clean-up of unit tests

Change-Id: I881a94d87efe1e81bd4f86667e75f5cbee50ce91
Fix instance stop in EC2 create_image

Change-Id: Iceee28165ec447d5fa294b73d121fbbf601c4332
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
Merge "Clarify use of Use of deprecated md5 library"
Fix WeightedHost

WeightedHosts don't have zone attributes.

Let me know if I'm missing something and should be adding a hasattr
check instead of removing the zone reference.

Change-Id: If76f23fa46c965fc9004e35dd10da33e2bbb48dc
Merge "Support fixed_ip range that is a subnet of the network block"
Merge "blueprint host-aggregates: improvements and clean-up"
Merge "Don't allow EC2 removal of security group in use."
Merge "Fix WeightedHost"