use of com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext in project coprhd-controller by CoprHD.
the class SRDFOperations method performEstablish.
public void performEstablish(StorageSystem system, Volume target, boolean refreshVolumeProperties, TaskCompleter completer) {
log.info("START performEstablish");
checkTargetHasParentOrFail(target);
ServiceError error = null;
try {
// refresh RDF group source provider, it is required after R2 snap/clone restore performed on target provider
RemoteDirectorGroup rdfGroup = dbClient.queryObject(RemoteDirectorGroup.class, target.getSrdfGroup());
StorageSystem sourceSystem = dbClient.queryObject(StorageSystem.class, rdfGroup.getSourceStorageSystemUri());
callEMCRefresh(helper, sourceSystem);
SRDFOperationContext establishCtx = getContextFactory(system).build(SRDFOperation.ESTABLISH, target);
establishCtx.appendFilters(new BrokenSynchronizationsOnlyFilter(utils));
establishCtx.perform();
if (refreshVolumeProperties) {
refreshTargetVolumeProperties(system, target);
}
} catch (Exception e) {
log.error("Failed to establish srdf link {}", target.getSrdfParent().getURI(), e);
error = SmisException.errors.jobFailed(e.getMessage());
} finally {
if (error == null) {
completer.ready(dbClient);
} else {
completer.error(dbClient, error);
}
}
}
use of com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext in project coprhd-controller by CoprHD.
the class SRDFOperations method performRestore.
public void performRestore(StorageSystem system, Volume target, TaskCompleter completer) {
log.info("START performRestore");
checkTargetHasParentOrFail(target);
ServiceError error = null;
try {
SRDFOperationContext restoreCtx = getContextFactory(system).build(SRDFOperation.RESTORE, target);
restoreCtx.appendFilters(new BrokenSynchronizationsOnlyFilter(utils));
restoreCtx.perform();
refreshTargetVolumeProperties(system, target);
} catch (Exception e) {
log.error("Failed to restore srdf link {}", target.getSrdfParent().getURI(), e);
error = SmisException.errors.jobFailed(e.getMessage());
} finally {
if (error == null) {
completer.ready(dbClient);
} else {
completer.error(dbClient, error);
}
}
}
use of com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext in project coprhd-controller by CoprHD.
the class SRDFOperations method performFailover.
public void performFailover(StorageSystem system, Volume target, TaskCompleter completer) {
log.info("START performFailover");
checkTargetHasParentOrFail(target);
ServiceError error = null;
try {
Volume sourceVolume = getSourceVolume(target);
StorageSystem sourceSystem = dbClient.queryObject(StorageSystem.class, sourceVolume.getStorageController());
// for 4.6.x CG, only failback and swap are at group level. Failover has to be called at ModifyListSync.
StorageSystem activeSystem = findProviderWithGroup(target);
AbstractSRDFOperationContextFactory ctxFactory = getContextFactory(activeSystem);
SRDFOperationContext ctx = null;
if (!system.getUsingSmis80() && !isFailedOver(activeSystem, sourceVolume, target)) {
log.info("Failing over link");
ctx = ctxFactory.build(SRDFOperation.FAIL_OVER, target);
ctx.perform();
} else {
invokeFailOverStrategy(sourceSystem, target);
}
if (completer instanceof SRDFLinkFailOverCompleter) {
// Re-check the fail over status.
LinkStatus status = null;
if (isFailedOver(activeSystem, sourceVolume, target)) {
status = LinkStatus.FAILED_OVER;
} else {
status = sourceVolume.hasConsistencyGroup() ? LinkStatus.CONSISTENT : LinkStatus.IN_SYNC;
}
((SRDFLinkFailOverCompleter) completer).setLinkStatus(status);
}
} catch (Exception e) {
log.error("Failed to failover srdf link {}", target.getSrdfParent().getURI(), e);
error = SmisException.errors.jobFailed(e.getMessage());
} finally {
if (error == null) {
completer.ready(dbClient);
} else {
completer.error(dbClient, error);
}
}
}
Aggregations