CA-88840:User Friendly error message when cross/intrapool migration fails

Signed-off-by: Akshay Ramani <akshay.ramani@citrix.com>
CA-102759: loosen HA restriction on expired hosts

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
CA-103189: Add optional params to pool-apply-edition

Signed-off-by: John Else <john.else@citrix.com>
CA-103189: Re-use some CLI parameter extraction code

Signed-off-by: John Else <john.else@citrix.com>
CA-105098: GenID field was rel_clearwater, not rel_augusta

We also need to bump the augusta schema minor number, since we recently had to
bump the clearwater schema minor number.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-101699: Run VM.copy on the master

The VDI.copy subtask(s) created by VM.copy will be forwarded to suitable
hosts, so it's debatable whether we need to forward VM.copy at all.

Before this change the VM.copy task was forwarded based on source SR(s)
only, which is definitely wrong - in the case where a VM is being copied
from shared storage to local storage, the VM.copy task would be
forwarded to a random host (with slaves preferred) and then the VDI.copy
task(s) would be forwarded again to the host connected to the local
storage.

Besides kicking off VDI.copy tasks, VM.copy mostly just creates objects
in the database and watches for events on those VDI.copy tasks, both of
which are most efficient on the master.

Maybe when the database is split up across hosts it will make more sense
to forward the VM.copy task to a host which can see both the source and
destination SRs.

Signed-off-by: John Else <john.else@citrix.com>
CA-101699: Don't serialise VM.copy per host

VDI.copy is the CPU-intensive task so there's no need to serialise
VM.copy per host, especially now that VM.copy always runs on the master.

Signed-off-by: John Else <john.else@citrix.com>
CA-101699: Allow VDI.copy if a VDI is only attached RO

Attempting to copy a VDI which is being written to can confuse
sparse_dd, however if a disk is only attached RO it's safe to copy it.

Signed-off-by: John Else <john.else@citrix.com>
Move test_ca98944.ml

This can be used as a basis for more VDI.allowed_operations tests so
let's give it a more generic name.

Signed-off-by: John Else <john.else@citrix.com>
CA-101699: Add unit tests for the allowed_operations changes

Signed-off-by: John Else <john.else@citrix.com>
CA-103189: Refactor host-apply-edition

host-apply-edition sets the specified license server address and port in
the host's license_server field, and rolls these back to the original
value if the server is out of license or unreachable.

This patch extracts the rollback logic out of the main implementation so
it can be used by pool-apply-edition.

Signed-off-by: John Else <john.else@citrix.com>
CA-103189: Use license server params in pool-apply-edition

Signed-off-by: John Else <john.else@citrix.com>
Change Pool.apply_edition logic

Pool.apply_edition should always try to apply the edition to all hosts
in pool, even if some of them already have the edition being applied.

Signed-off-by: John Else <john.else@citrix.com>
Log this error as an error rather than debug

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1185 from johnelse/ca-103189

CA-103189: Add license server port and address params to pool-apply-edition
CA-105160: Make sure event_wait is cancellable

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-105159: Wait for ack of shutdown request for HVM guests with PV drivers

The code paths only handled fully-PV guests and HVM guests without PV drivers.
In the case of PV drivers we did not wait for the shutdown request to be
acknowledged. This did not enable early exit if the request was not
acknowledged.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-105155: Make sure we timeout as requested

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CP-4465 contribution: reduce logging of low-value messages
 * log less in block_device_io.action_writedelta
 * shorten a common log line in xapi_session.ml

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Merge pull request #1187 from johnelse/ca-101699

CA-101699: Fixes for concurrent VM/VDI copy