use directIO flags when dd'ing template

This makes sure dom0 in xenserver doesn't get hammered
when copying templates. It doesn't make sense to use
the cache of dom0 as the template does not fit in
memory. The directIO flags prevent it from trying.

(cherry picked from commit 4e1527e87aaaa87d14d3c7d3a6782b80cbf36a8c)
CLOUDSTACK-8076: UI > Templates menu > Template/ISO > "Filter by" dropdown > add a new option, "shared", which will list shared templates when being selected.
CLOUDSTACK-8075: Front-end support for shared templates/ISOs
CLOUDSTACK-8075: UI > Instances menu > Add Instance > Select template/ISO > add a new tab "shared" which will list shared templates/ISOs when being clicked.
CLOUDSTACK-8077: Not able to deploy VM using a shared template.
CLOUDSTACK-8074: Fixed maint/test_multiple_ip_ranges.py

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
CLOUDSTACK-8081: Fixed VM snapshot test cases in test_escalation_instances.py and also dealt cleanup issues

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
CLOUDSTACK-8055: test_portable_ip.py - Tagging test case which can't be run on simulator

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
CLOUDSTACK-8071: Fixed api key issue in test_snapshots_improvement.py

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
CLOUDSTACK-8075: UI > Instances menu > Add Instance > Select template/ISO > "shared" tab > select a shared template, click Next button => fix error "unable to find matched template object".
CLOUDSTACK-8079: If the cluster capacity threshold is reached, HA-enabled VM is not migrated on another host during HA

Changes:
-  When there is HA we try to redeploy the affected vm using regular planners and if that fails we retry using the special planner for HA (which skips checking disable threshold)
Now because of job framework the InsufficientCapacittyException gets masked and the special planners are not called. Job framework needs to be fixed to rethrow the correct exception.
- Also the VM Work Job framework is  not setting the DeploymentPlanner to the VmWorkJob.  So the HA Planner being passed by HAMgr was not getting used.
- Now the job framework sets the planner passed in by any caller of the VM Start operation, to the job
CLOUDSTACK-8078: [Automation] Deletion of Affinity Groups - CloudRuntimeException: No Event Pubish can be wrapped within DB Transaction!

Changes:
-     The event of deleteing an affinity group is published on the MessageBus so that IAM Service can listen and process the event, However the publish operation should not be handled within a DB transaction, since it may take longer and hold the DB transaction for long unnecessarily
-    Publish any events to MessageBus outside of the transaction

Conflicts:
	server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
CLOUDSTACK-8022: [Automation] Deletion of Domain with Cleanup set to "true" fails

Changes:

-  This is a race condition between the deleteDomain thread and AccountChecker thread. DeleteDomain thread marks the domain as inactive and proceeds for cleanup, AccountChecker thread that runs at the same time cleans up any domains marked as inactive.
-  When the DeleteDomain thread finds that domain is already removed, it need not error out since the domain deletion has already happened
add event for volume migration
Reviewed-by: Frank
if local storage is in maitenance mode or removed, won't change its
status in case of mgt server restart
Reviewed-by:Frank
if concurrent snapshot happening on the same vm, throw invalid parameter
exception to user.
Reviewed-by: Frank
CLOUDSTACK-7184 config value for xen heartbeat timeout
CLOUDSTACK-7184 fieldname typo
CLOUDSTACK-8093:Not able to list shared templates by passing id.
CLOUDSTACK-8089: Fixed test_explicit_dedication.py test case and moved to maint folder for it is to be run separately

Signed-off-by: pdion891 <pdion891@apache.org>