Fix rootwrap for non openstack.org iqn's

The encryption methods implemented for attached volumes
require a symbolic link created to the /dev/disk-by* iqn.

The current implementation works fine for LVM, however the rootwrap
is restricted to only allow iqns of the form openstack.org, for
vendors that use their own target and iqn this won't work and will
result in the attach failing for unauthorized command.

This just makes the regex for the rootwrap filter a bit more
permissive, only looking for iscsi-iqn.*

Change-Id: I023ad24867c045a88f72c5ac7ac4e4da097a3643
Closes-Bug: 1362854
Fix service groups with zookeeper

Service groups using zookeeper don't work due to apparently improper
handling of the zookeeper session creation.

No additional unit tests as the mocking these interfaces probably
doesn't actually provide substantial future guaruntees. The correct
long term fix is to enable zk for unit testing upstream.

Change-Id: I21691843cb4936d10a0b82df41aef3afe5bf2519
Closes-bug: #1239864
Pass instance to set_instance_error_state vs. uuid

Quick fix to patch one case in which instance.uuid was still being
passed to _set_instance_error_state when retries are disabled in
rescheduling cases.  Also updated the respective test case.

Change-Id: I24a682b926bc570d7e932ffedc664a95d41fda85
Closes-Bug: #1367342
libvirt: start lxc from block device

Currently, lxc containers can be started only from an image.
Adding support to start lxc containers from block device volumes.

Separating the lxc disk handling code from _create_domain to _lxc_disk_handler
that will use block_device_mapping and will handle the pre and post lxc start
actions on the disk, both for images and volumes.

Implements blueprint libvirt-start-lxc-from-block-devices
Change-Id: Ia980f65384af2818f46d2e91df46f131b2ce3a77
Libvirt-Enable support for discard option for disk device

Support setting discard option for instance's disk.
If discard option is enabled, unused/freed blocks can be return back to the
storage device.

blueprint libvirt-disk-discard-option
DocImpact: Add a new configuration in nova.conf

Change-Id: Ic87b9348a2e441d5df0b468bb88ec6e77f8b4ce2
Add quotas for Server Groups (V2 API compatibility & V2.1 support)

Server groups can be used to control the affinity and anti-affinity
scheduling policy for a group of servers (instances).  Whilst this is
a useful mechanism for users such scheduling decisions need to be
balanced by a deployers requirements to make effective use of the
available capacity.

This change adds quota values to constrain the number and size of
server groups a user can create.

Two new quota values are be introduced to limit the number of server
groups and the number of servers in a server group. These will follow
the existing pattern for quotas in that:

* They are defined by config values, which also include the default
  value

* They can be defined per project or per user within a project

* A value of -1 for either quota will be treated as unlimited

* Defaults can be set via the quota groups API

* Values may be changed at any time but will only take effect at the next
  server group or server create.   Reducing the quota will not affect any
  existing groups, but new servers will not be allowed into group
  that have become over quota.

This is part one of a linked sequences of changes that implement the
new quotas - split to make the reviews easier.

This part adds the definition of the new quota values, but leaves the
V2 API unchanged.  The V2.1 API is updated as it shows all quota values.

The second part adds the new V2 API extension to make the new quota
values visible and changeable.  At this point a Tempest change is
required to get a clean run as it checks for a specific set of
values.

The third part implements the quota checks themselves.

Thanks to Cyril Roelandt for supplying some of the unit tests.

Co-authored-by: Cyril Roelandt <cyril.roelandt@enovance.com>

Implements: blueprint server-group-quotas
DocImpact

Change-Id: Ib281e43eabfbd176454bde7f0622d46fb04fcb79
Imported Translations from Transifex

Change-Id: Ie2d319aed8c16b71a1f17aa4cf7afc649c6151ce
Merge "libvirt: start lxc from block device"
Merge "Libvirt-Enable support for discard option for disk device"
Block sqlalchemy migrate 0.9.2 as it breaks all of nova

This is breaking nova unit tests

Change-Id: Ic82d787e41f7b6d6153d3c6b19902cc11a1c43bb
Closes-Bug: #1368391
Merge "Fix service groups with zookeeper"
Merge "Fix rootwrap for non openstack.org iqn's"
Merge "Add quotas for Server Groups (V2 API compatibility & V2.1 support)"
Merge "Pass instance to set_instance_error_state vs. uuid"
Merge "Imported Translations from Transifex"