for(VDI snapChain : snapshotChains) {
Task task = snapChain.copyAsync2(conn, null, null, destVdi);
// poll every 1 seconds ,
hypervisorResource.waitForTask(conn, task, 1000, wait * 1000);
hypervisorResource.checkForSuccess(conn, task);
task.destroy(conn);
}
destVdi = VDI.getByUuid(conn, destVdiUuid);
String templatePath = destDir + "/" + destVdiUuid + ".vhd";
templatePath = templatePath.replaceAll("//","/");