Check system_metadata type in _populate_instance_for_create

The _populate_instance_for_create method is passed a dictionary
of base instance values during create but it wasn't checking to
see if system_metadata was a dict or not which can lead to a
TypeError when booting an instance via the cells scheduler.

Fixes bug 1195549

Change-Id: I60b853eda48726b3bb752b7e3542b0fca74bc926
Exceptions raised by quantum validate_networks result in 500 error

The exceptions raised by validate_networks should be subclassed
from Invalid so they result in a 400 error

These exceptions are also used in allocate_for_instance

Fixes bug 1193421

Change-Id: If708e413d81a9d32bf81e7821d876736c4ac40ef
Port attach and detach of volume-attachment into os-extended-volume v3

* Add attach and detach as server's action
* Change status code of attach to 202
* Catch exception explicitly
* Add more testcase

Partially implements bp v3-api-extension-versioning

Change-Id: I2e6324c3b7944afda7c32d438dc6e6d6f4f7502a
xenapi: Only coalesce VHDs if needed

If the original parent is None, then we don't need to coalesce the VHD since
there won't be a grandparent for the child to coalesce into. Doing otherwise,
causes us to poll forever as we wait for the child's parent to become `None`.

Fixes bug 1200806

Change-Id: I0cbf0be86ff925b83c0b8fa90f88d4ca304fd2b9
Fix nic order not correct after reboot

Previously if an instance was rebooted or migrated the original nic order
would not be maintained. This patch retrieves the correct nic order from
info_cache so that the order is mantained.

Fixes bug 1187092

Change-Id: I3f5488cc14c692fde7d5bd3376389e2f2f5550ff
Merge "Fix nic order not correct after reboot"
Merge "Port attach and detach of volume-attachment into os-extended-volume v3"
Merge "xenapi: Only coalesce VHDs if needed"
Merge "Check system_metadata type in _populate_instance_for_create"
Merge "Exceptions raised by quantum validate_networks result in 500 error"
Merge remote-tracking branch 'm_src_repo/citrix-fixes' into build-temp