added getter methods for quantumv2 api

Change-Id: Ie2b7ba698c232f55e112b978d7a548b48462fca3
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
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
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
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
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>
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
Allow VMs to be resumed after a hypervisor reboot

Fixes bug 1052696.

Update the compute manager to pass network_info and block_device_info
to the driver.resume() and update all virtualization drivers to accept
the new arguments.

For libvirt, change resume() to use _create_domain_and_network()
rather than _create_domain(). This eliminates the assumption that the
network and block device connections remained in place from the period
between the VM being suspended and resumed.  Instead, all the
networking and block connections will be rebuilt on resume (in case
they are missing) as is the case after a hypervisor reboot.

Change-Id: I6e19ec42f7e929678abce8f276c0a6e91f1fa8af
Rename sql_pool_size to sql_max_pool_size

A recent patch adds a sql_pool_size config option.  This renames it to
sql_max_pool_size and sets a default that equals SQLAlchemy's default
(5).

eventlet's db_pool allows setting a minimum size, so this is to prep for
adding a sql_min_pool_size option.  Should remove some confusion.

No need to support sql_pool_size for backwards compatibility as it
was to be a new option in Grizzly, anyway.

Also fixes the previous patch to not set pool options if using
StaticPool or NullPool.

DocImpact

Change-Id: Ic41d138a1ee4cdaf785e45091bd5668045153b90
Imported Translations from Transifex

Change-Id: Ib37e2f619ef29c33f7cd5702da1b98577573ad51
Remove obsolete config drive init.d example

Delete the example init.d script that uses the config drive. This
script is not compatible with the current implementation of
config drive.

Change-Id: I9cf5542ef84a206b9ac5dc05637b3f6ecaaba548
Merge "Make ec2_instance_create db method consistant across db apis"
Merge "Imported Translations from Transifex"
Merge "Return an error response if the specified flavor does not exists. (v4)"
Merge "Rename sql_pool_size to sql_max_pool_size"
Adds API for bulk creation/deletion of floating IPs

This adds an extension that provides a REST API for the bulk creation,
deletion and listing of floating IPs. The interface is accessed via

/v2/{tenant_id}/os-floating-ips-bulk

This forms part of the work to provide APIs for functionality currently
implemented by nova-manage that needs direct db access so nova-manage
can eventually be removed

Implements: blueprint apis-for-nova-manage
DocImpact

Change-Id: I621e2b070a896f7230cdf3f26f78ded85e72cf16
Introduce a VFS implementation mapped to the host filesystem

This implements the VFS APIs by using the nova.virt.disk.mount.Mount
APIs to map the virtual disk image into the host filesystem. This
only uses the loop/qemu-nbd mount implementations, since there will
be a dedicated libguestfs VFS API avoiding the need for the guestfs
mount impl

blueprint: virt-disk-api-refactoring
Change-Id: Ifeb04770d55a3d1627db807322d57c0bedfc59cb
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Introduce a VFS implementation backed by the libguestfs APIs

This implements the VFS APIs using the libguestfs Python APIs.
This removes the need to map the virtual disk image into the
host filesystem, and thus avoids potential symlink attacks
from the guest filesystem. It also performs better than the
libguestfs FUSE module

blueprint: virt-disk-api-refactoring
Change-Id: I3202ec9479f22aa1ae461cab24968e54be1642c1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>