use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFTaskCompleter in project coprhd-controller by CoprHD.
the class SRDFDeviceController method removePairFromGroup.
public boolean removePairFromGroup(final URI systemURI, final URI sourceURI, final URI targetURI, final boolean rollback, final String opId) {
log.info("START Remove Pair from Group");
TaskCompleter completer = null;
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem system = getStorageSystem(systemURI);
dbClient.queryObject(Volume.class, targetURI);
completer = new SRDFTaskCompleter(sourceURI, targetURI, opId);
getRemoteMirrorDevice().doRemoveVolumePair(system, sourceURI, targetURI, rollback, completer);
} catch (Exception e) {
return completeAsError(completer, DeviceControllerException.errors.jobFailed(e), opId);
}
return true;
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.SRDFTaskCompleter in project coprhd-controller by CoprHD.
the class SRDFOperations method removeDeviceGroups.
/**
* Removes the source and target from their device groups, which should in turn remove the
* group.
*
* @param system
* @param sourceURI
* @param targetURI
* @param completer
*/
public void removeDeviceGroups(final StorageSystem system, final URI sourceURI, final URI targetURI, final boolean isVpoolChange, TaskCompleter completer) {
log.info("START removing device groups");
StorageSystem targetSystem = null;
Volume source = null;
Volume target = null;
try {
if (null == completer) {
completer = new SRDFTaskCompleter(sourceURI, targetURI, "remove volume from device group");
}
source = dbClient.queryObject(Volume.class, sourceURI);
target = dbClient.queryObject(Volume.class, targetURI);
targetSystem = dbClient.queryObject(StorageSystem.class, target.getStorageController());
BlockConsistencyGroup targetCG = dbClient.queryObject(BlockConsistencyGroup.class, target.getConsistencyGroup());
BlockConsistencyGroup sourceCG = dbClient.queryObject(BlockConsistencyGroup.class, source.getConsistencyGroup());
boolean cgSourceCleanUpRequired = false;
if (!isVpoolChange) {
cgSourceCleanUpRequired = removeFromDeviceGroups(system, system, source, sourceCG);
}
boolean cgTargetCleanUpRequired = removeFromDeviceGroups(targetSystem, system, target, targetCG);
// after volumes are deleted .group gets removed
if (cgSourceCleanUpRequired || cgTargetCleanUpRequired) {
SRDFUtils.cleanUpSourceAndTargetCGs(sourceCG, targetCG, system.getId(), isVpoolChange, dbClient);
}
} catch (Exception e) {
String msg = format(FAILURE_MSG_FMT, "remove srdf replication groups for ", sourceURI, targetURI);
log.warn(msg, e);
} finally {
// update DB objects
// this step is actually a defensive check, hence even if it fails, remove the volumes, hence its already removed.
SRDFUtils.cleanupRDG(source, target, dbClient);
completer.ready(dbClient);
}
}
Aggregations