Source:
<code>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(), <START> vm.getName() + getStorageDomain().getName() + "-TMPDR", <END> 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); }</code><technical_language>consider "-TMPDR" a constant</technical_language>

Target:
protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmIdSnapshotIdMap = new HashMap<>(); for (VM vm : vms) { CreateAllSnapshotsFromVmParameters param = new CreateAllSnapshotsFromVmParameters(vm.getId(), vm.getName() + getStorageDomain().getName() + DR_SNAPSHOT_NAME_SUFFIX, false, vm.getDiskList()); Guid createdSnapshotId = runInternalAction(VdcActionType.CreateAllSnapshotsFromVm, param).getActionReturnValue(); vmIdSnapshotIdMap.put(vm.getId(), createdSnapshotId); } getParameters().setVmIdSnapshotIds(vmIdSnapshotIdMap); 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); }