Source:
<code>protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmSnapshotIdMap = new HashMap<>(); <START> for (VM vm : vms) { CreateAllSnapshotsFromVmParameters param = new CreateAllSnapshotsFromVmParameters(vm.getId(), vm.getName() + "-TMPDR", false, vm.getDiskList()); Guid createdSnapshotId = runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, param).getActionReturnValue(); vmSnapshotIdMap.put(vm.getId(), createdSnapshotId); } getParameters().setSnapshotIdVmIds(vmSnapshotIdMap); <END> persistCommandIfNeeded(); if (getSession().getStatus() != GeoRepSessionStatus.ACTIVE ) { Future<VdcReturnValueBase> geoRepCmd = CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(getSession().getMasterVolumeId(), getSession().getId()), cloneContext()); VdcReturnValueBase result; try { result = geoRepCmd.get(); if (!result.getSucceeded()) { propagateFailure(result); return; } } catch (InterruptedException | ExecutionException e) { log.error("Exception", e); return; } } GlusterVolumeGeoRepSessionConfigParameters configParams = new GlusterVolumeGeoRepSessionConfigParameters(getSession().getMasterVolumeId(), getSession().getId(), "checkpoint", "now"); runInternalAction(VdcActionType.SetGeoRepConfig, configParams); }</code><technical_language>happen if previous DR sync is completed new DR sync is triggered job scheduler. 1.Do need skip previous job ignore current job?. 2. Creating snapshot name vm.getName() + "-TMPDR" fail a snapshot this name already</technical_language>

Target:
protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmSnapshotIdMap = new HashMap<>(); for (VM vm : vms) { CreateAllSnapshotsFromVmParameters param = new CreateAllSnapshotsFromVmParameters(vm.getId(), vm.getName() + getStorageDomain().getName() + "-TMPDR", false, vm.getDiskList()); Guid createdSnapshotId = runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, param).getActionReturnValue(); vmSnapshotIdMap.put(vm.getId(), createdSnapshotId); } getParameters().setSnapshotIdVmIds(vmSnapshotIdMap); persistCommandIfNeeded(); if (getSession().getStatus() != GeoRepSessionStatus.ACTIVE ) { Future<VdcReturnValueBase> geoRepCmd = CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(getSession().getMasterVolumeId(), getSession().getId()), cloneContext()); VdcReturnValueBase result; try { result = geoRepCmd.get(); if (!result.getSucceeded()) { propagateFailure(result); setSucceeded(false); return; } } catch (InterruptedException | ExecutionException e) { log.error("Exception", e); setSucceeded(false); return; } } GlusterVolumeGeoRepSessionConfigParameters configParams = new GlusterVolumeGeoRepSessionConfigParameters(getSession().getMasterVolumeId(), getSession().getId(), "checkpoint", "now"); VdcReturnValueBase result = runInternalAction(VdcActionType.SetGeoRepConfig, configParams); if (!result.getSucceeded()) { propagateFailure(result); return; } setSucceeded(true); }