script for configuring a vif in Xen in non-bridged mode

Creates a new vif device without attaching it to a
bridge. Quantum Linux Bridge Agent will attach the
created device to the belonging bridge.

Change-Id: I1818a92a47882d98e384b57e0fa84a0fa09d40ea
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
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
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
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
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>
Convert file injection code to use the VFS APIs

Remove the requirement to mount disk images on the host
filesystem for file injection, by switching over to use
the new VFS APIs. The mount code is now solely used for
setting up LXC disk images

blueprint: virt-disk-api-refactoring
Change-Id: I1335bf7a8266d3d1d410a66538969f1213766cb9
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Remove img_handlers config parameter usage

Now that the only disk code requiring host filesystem
mounts is the LXC filesystem setup, the img_handlers
config parameter is an solution looking for a purpose.
For any disk image format we can categorically say
whether it should be mounted using loop or qemu-nbd
mount impls. There is no desire to use libguestfs FUSE
for mounting LXC disk images, since users of LXC do
not want a huge KVM process alongside every container!
Move the mount class choice logic into the mount API,
by creating new methods

  nova.virt.disk.mount.API.instance_for_format()
  nova.virt.disk.mount.API.instance_for_device()

and then call these from nova.virt.disk.API code

blueprint: virt-disk-api-refactoring
Change-Id: I088b5debdf62d4a9a6b4521eee68cd4757f2ff42
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Remove the libguestfs disk mount API implementation

The nova.virt.disk.mount.guestfs.API impl is now unused,
since there is a dedicated libguestfs impl of the VFS
APIs. It can thus be removed

blueprint: virt-disk-api-refactoring
Change-Id: I6c19e38f23b056d770bfb93e21fa3e64ac179a42
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add debug logging to disk mount modules

To assist in troubleshooting file injection code, add some
LOG.debug() statements to the nova/virt/disk/mount/*.py
modules

blueprint: virt-disk-api-refactoring
Change-Id: I75214145ef489a29a58f69abe6195ff01f36153c
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Move sql options to nova.db.sqlalchemy.session

With a few minor exceptions, the sql config options are used solely
within the nova.db.sqlalchemy.session module so it makes sense to move
their declaration into that module.

Change-Id: Iea9c2bb000cd713b01750ab3e796132ebeaa4ca8
Add methods to Host operations to fake hypervisor

This patch implements some features present in os-hosts extension that are not
implemented in fake hypervisor:
    - Power Actions: Shutdown/Reboot/Startup a host
    - Change host status: enable or disable
    - Set/Unset the host into maintenance mode
With this patch we're able to get full api samples for this extension

Change-Id: I3b76e3070e326b39a67b9d4d25b5e3d91a3c102f
Wrap log messages with _()

bug 1075082

There are a few log messages without _(), but a lot messages with _().
Wrap these log messages with _() in order to make the code consistent.

Change-Id: Ibaff2c352df925f7e00d5a62d111ef73f60c944b