Fix logic in add_host_to_aggregate()

Commit I788782a9f21ec2672551f75123753175bb268586 introduced some
changes into the add_host_to_aggregate() method to catch adding an
host to an availability zone when the host was already a member of
a different availability zone. However there were a couple of issues
with this change. There was no check that the availability_zone was
in the metadata grabbed from the database which would raise a
KeyError back to the api. Additionally, the check wouldn't always
work as expected because the database returned a set of availability
zones (including sometimes an empty set) so the check would fail in
some conditions when it was expected to pass.

This commit fixes the logic for checking if the host is already in an
availability zone. It also replaces the try/except block in the
aggregates extension to check up front if the action is valid instead
of waiting for a key error when it goes to use the action.

Fixes bug 1208627
Fixes bug 1208628

Change-Id: I81b79602e23e78c8b077d313e556796de1255bbf
Allow more than one ephemeral device in the DB

This patch changes the database api behaviour when creating/updating a
block device mapping to allow more than one ephemeral device instead of
overriding the old ones.

Part of blueprint: improve-block-device-handling

Change-Id: I71c283cbd5ad3d28a27d06cb01b5ba9433f8ab46
Use new BDM syntax when determining boot metadata

This patch makes it possible to use new BDM syntax (if it was used in
the request when booting) to be used when determining where to get the
metadata from.

Since the new syntax has the boot_index field - it is easy to determine
which device is intended to be booted from.

blueprint: improve-block-device-handling

Co-authored-by: Xavier Queralt <xqueralt@redhat.com>

Change-Id: If92c9df261880eb0dcf0fd0a81fd1ae7c688d201
Merge "Allow more than one ephemeral device in the DB"
Merge "Use new BDM syntax when determining boot metadata"
Merge "Fix logic in add_host_to_aggregate()"