parameters.put("sourceHostId", source.getIdentifier());
parameters.put("destinationHostId", host.getIdentifier());
parameters.put("copyOptions", options);
Calendar startTime = Calendar.getInstance();
SimpleScheduledTask task = new SimpleScheduledTask("setup-host-" + host.getIdentifier(), "setup-host-group", "Setups host "
+ host.getIdentifier() + " from host " + source.getIdentifier(), HostAssetsJobProxy.class.getCanonicalName(), false,
"setup-host-" + source.getIdentifier() + "-trigger", "setup-host-trigger-group", startTime.getTime(), null,
SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, 5, true, parameters, 0, 0);
QuartzUtils.scheduleTask(task);
// wait for the copy to be done.
//#6084: If the license is not Enterprise it should NOT get stuck.
//It will wait for 5 minutes only.
int milliseconds = 0;
int maxMilliseconds = 600000; //5 Minutes
while(QuartzUtils.getTaskProgress(task.getJobName(), task.getJobGroup())<100 && milliseconds < maxMilliseconds) {
Thread.sleep(500);
milliseconds += 500;
}
if(milliseconds >= maxMilliseconds){