Policy check for forced_host should be before the instance is created

Move the policy enforcment for force_host and force_node into the
_handle_az() method so that any violation of policy is detected before
the DB entry for the instance is created.

Fixes bug: 1220220

Change-Id: Iaf6df4f8df6cca71fcb860244ccf758d7908b8f1
VMware: Fix volume detach failure

The VMwareVCDriver method "detach_volume" is missing the "encryption"
argument and thus does not conform to the driver API. Adding the missing
argument solves TypeError being thrown when detaching a volume.

Change-Id: Ib785c2b2cf4c25deed272f8e3f0f47abe6139d1c
Closes-Bug: #1226826
Add tests for pre_live_migration

Add tests to ensure retrying plug_vifs in pre_live_migration works.

Closes-bug: #1228749
Change-Id: I80d4cdc27836511c55b2555556edd7a1964c7158
Don't wrap Glance exceptions in NovaExceptions

Exception objects from glanceclient are not serializable
in Nova and shouldn't be directly wrapped inside NovaExceptions.
The glanceclient portions of Nova that translate from Glance
to Nova should be creating new corresponding exceptions
independent of the Glance counterparts.

Change-Id: Ifbe992796f8c5738ae350617d41a9c312fa8ab94
Add notification for pause/unpause instance

When pause/unpause instance, there are no notifications, this
will cause someone cannot know when pause/unpause operation
would be finished.

All other instance operations do have notifications. We should
also add notification support for those two operations.

Change-Id: I5b8cc33a5992f5f028a3220217dcf7a0288d150d
Closes-Bug: #1043861
Full sync of quota_usages

Migration 203 added a user_id column to the quota_usages table.  Now
some usages are incremented/decremented on a per user basis but there
are preexisting usages stored with a NULL user, and some usages are
tracked per project but there are usages stored with a user_id.  These
quotas are never decremented leading to invalid quota limits being
enforced.

This migration performs a full sync of quotas, and removes the incorrect
rows for each resource type.

Change-Id: Iff96f81e36b135df94a6f25c9443d0e9333bd18f
Closes-Bug: #1212798
VMware: Fix bug for root disk size

The code would not configure the root disk size to that specified
in the flavor. This was always the size of the glance image.

Fixes bug: 1226052

Change-Id: I75ea766e3c96a2e0ad8a8d7cf7d24d80e1f94050
Fix processutils.execute errors on windows

Added a check for existence of geteuid.

This fix is related to oslo-incubator commit:
d6a963e911b8456c06dceb5ee3cc88a70c08bf82

Closes-Bug: #1209410

Change-Id: Ibaa1f061bf161768890d4708dc945180121726f9
Refactor test cases related to instance object

After the blueprint unified-object-model, all of the instances
should be represented by an instance object but not a db
instance dict.

In some test cases, they are still using db instance dict,
we should change those test cases to use instance object.

The fix include three parts:
1) Add a new stub method fake_fault_obj in
nova/tests/fake_instance.py to help convert a dict fault to an
object fault.
2) Add a new stub method fake_instance_obj in
nova/tests/fake_instance.py to help convert a dict instance to
an object instance.
3) Make sure all test cases related to "fault" and "instance" passed.

Closes-Bug 1230125
Partial-Bug 1212915

Change-Id: Ie54fface139e4ad042b9a748c7409c3698875413
Fix loading instance fault in servers view

If VM schedule failed, then VM will be set to ERROR state,
but "nova show" does not show the fault of the VM.

The fix use lazy load to get instance fault if the instance
went to ERROR state.

Closes-Bug: #1212915

Change-Id: If286fd0176be8307c50b2a7c3534fff33fa5c10f
Fix indentation in virt.libvirt.blockinfo module

Fixes confusing indentation in is_disk_bus_valid_for_virt function where
leading 8 spaces were used instead of 4.

Change-Id: Ic320dc6860b1efa7464d631c4c649be13d7206a1
Merge "VMware: Fix bug for root disk size"
Merge "Don't wrap Glance exceptions in NovaExceptions"
Merge "Fix processutils.execute errors on windows"
Merge "Full sync of quota_usages"
Merge "Policy check for forced_host should be before the instance is created"
Merge "Add notification for pause/unpause instance"
Merge "VMware: Fix volume detach failure"
Merge "Fix indentation in virt.libvirt.blockinfo module"
Merge "Add tests for pre_live_migration"