Add nova option osapi_compute_unique_server_name_scope

Setting this option forces nova-api to check for duplicate
server names either in the project or system-wide.

The default behavior remains the same: duplicate names are allowed.

DocImpact: Adds a new Nova config option

Change-Id: I28baf8c63f9c62f457bfff0a2fb510f0c517a351
Handle image cache hashing on shared storage.

Resolves bug 1075018.

Change-Id: Iddb092468fae1e7af18134bc433708410d15184d
Unpin amqplib and kombu requirements.

Ubuntu is using a much newer version of these libraries so we
shouldn't lock the versions in our infrasctructure. Using a > 1.0
of amqplib is particularly useful as it turns on keepalives by
default.

Change-Id: I956e70e0c39c76d1632fb708cd78aeb51adbd250
Make ec2_instance_create db method consistant across db apis

Fixes bug 1079463

Also changes call to ec2_instance_create in sqlalchemy instance_create
method to go through db api as opposed to direct to sqlalchemy api.

Change-Id: I60136a2c7019bda25225d8e02e82a9ccfbb61e2f
improve session handling around instance_ methods

clean up session usage in some of the instance_* methods:
  instance_destroy
  instance_get_all_hung_in_rebooting
  instance_(add|remove)_security_group
  instance_info_cache_(get|update|delete)

also remove instance_info_cache_create since this is not used

blueprint db-session-cleanup

Change-Id: I33913dae3bc28e05d856d951454440a12616706e
Fix os-hosts extension can't return xml response correctly.

Also add os-hosts integrated testing template files.
fix bug 1075575
fix bug 1070167.

DocImpact

Change-Id: I6b9f9e58e7cbe10a931d2c83d9baf9dcee74de08
Add keystoneclient to pip-requires

As of I788300449e37ba1732f6482ebce5f480a2c14a41, we pull the auth_token
middleware from keystoneclient. (added to keystoneclient in version 0.2.0)

Change-Id: Ide0d562d96e5e426f9c7e532251efd57a0964f11
Send block device mappings to rebuild_instance.

Send the block device mappings for an instance to the rebuild_instance
method in the compute manager.  This moves a db read from nova-compute
up to the api service.

Part of blueprint no-db-compute.

Change-Id: I15967652cfa539fab3b55c224e8ebbc12363004a
Return an error response if the specified flavor does not exists. (v4)

'nova list --flavor <id>' command outputs empty list, if there is not
any instance or flavor. A user cannot know the reason of empty list easily.
This patch changes a response to error if the specified flavor-id does not
exist instead of empty list.

Example:
 $ nova flavor-list
 +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
 | ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
 +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
 | 1  | m1.tiny   | 512       | 0    | 0         |      | 1     | 1.0         | True      | {}          |
 | 2  | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      | {}          |
 | 3  | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      | {}          |
 | 4  | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      | {}          |
 | 5  | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
 +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+

Before applying this patch:
 $ nova list --flavor 10

 $

After applying this patch:
 $ nova list --flavor 10
 ERROR: Flavor could not be found (HTTP 422) (Request-ID: req-003d4bbc-f338-4361-9eeb-1cf18073a5a8)
 $

Changelog of v4:
 * Change a response code of NotFoundFlavor from 404 to 422.

Changelog of v3:
 * Merge patchset2(change a response of test_get_all_by_flavor) into one patch.
 * Change a response code of NotFoundFlavor from 400 to 404.

Fixes bug 1076863
Change-Id: I45f35ae6a4bf1de734c258ef819fb9b4d7f9681e
Pin pep8 to 1.3.3

Apart of making pep8 version standard across all openstack
projects.

With this change we ignore E712 since it is normal to use
"column == True" in sqlalchemy.

Change-Id: I73a162847a79558cb158112878033edf18039805
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Handle instances not being found in EC2 API responses.

Resolves bug 1080406 where InstanceNotFound was raised with None
as the instance id.

Change-Id: I805a9c8893f51ab22426e606ce260a04113f26e5
refactor: extract method: connect_volume

Related to blueprint xenapi-volume-drivers

Extract connect_volume call from attach_volume, and a test for
attach_volume. By extracting this call, it will be easier to implement
other drivers, by providing an alternate implementation for this
extracted method.

Change-Id: Ie5a17ec7fada26a9df5ba8a29ed0dadeb02516e8
Change all tenants servers listing as policy-based

Currently when list servers from all tenants (i.e. --all-tenants is set as 1
when "nova list"), privilege is required.

However, computer pollster in ceilometer need to get all instances from
all tenants in one host. Granting admin privilege to the pollster is
not very secure.

All tenants servers list should be policy-based, instead of requiring
admin privelege.

There is one potential backward compatibility. With all_tenants specified,
non-admin accounts will get back owned servers only without this patch,
however it will get policy exception now if policy checking failed. IMHO
the new behaviour makes more sense.

Change-Id: I8f1f064434ab12b6c0cd636f84dfc1b6a9b2fc90
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
Convert migrations.instance_uuid to String(36).

Updates the length of the instance_uuid column in the migrations
to match the length of UUID's in Nova.

Fixes LP Bug #1080854.

Change-Id: I213c48835f9efa4a9a84932c343c1079c5cc65ca
Adds missing index migrations by instance/status.

Adds an index for use with the migration_get_by_instance_and_status
SQL API call.

Change-Id: If2a0e8e141545aef015338b8933290c265a485d0
Merge "Pin pep8 to 1.3.3"
Merge "Add nova option osapi_compute_unique_server_name_scope"
Remove extra space in exception

Invalid console type exception has an extra space at the end of the
message.

Change-Id: Ie410ecce487a56c6a88f6e236bfacc28ac693595
Merge "Handle image cache hashing on shared storage."
Merge "Remove extra space in exception"