Search in sources :

Example 1 with BrokenSynchronizationsOnlyFilter

use of com.emc.storageos.volumecontroller.impl.smis.srdf.collectors.BrokenSynchronizationsOnlyFilter 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);
        }
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BrokenSynchronizationsOnlyFilter(com.emc.storageos.volumecontroller.impl.smis.srdf.collectors.BrokenSynchronizationsOnlyFilter) RemoteDirectorGroup(com.emc.storageos.db.client.model.RemoteDirectorGroup) SRDFOperationContext(com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext) RemoteGroupAssociationNotFoundException(com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.RemoteGroupAssociationNotFoundException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) NoSynchronizationsFoundException(com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.NoSynchronizationsFoundException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 2 with BrokenSynchronizationsOnlyFilter

use of com.emc.storageos.volumecontroller.impl.smis.srdf.collectors.BrokenSynchronizationsOnlyFilter 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);
        }
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BrokenSynchronizationsOnlyFilter(com.emc.storageos.volumecontroller.impl.smis.srdf.collectors.BrokenSynchronizationsOnlyFilter) SRDFOperationContext(com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext) RemoteGroupAssociationNotFoundException(com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.RemoteGroupAssociationNotFoundException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) NoSynchronizationsFoundException(com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.NoSynchronizationsFoundException)

Aggregations

DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)2 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)2 SRDFOperationContext (com.emc.storageos.volumecontroller.impl.smis.srdf.SRDFOperationContext)2 BrokenSynchronizationsOnlyFilter (com.emc.storageos.volumecontroller.impl.smis.srdf.collectors.BrokenSynchronizationsOnlyFilter)2 NoSynchronizationsFoundException (com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.NoSynchronizationsFoundException)2 RemoteGroupAssociationNotFoundException (com.emc.storageos.volumecontroller.impl.smis.srdf.exceptions.RemoteGroupAssociationNotFoundException)2 WBEMException (javax.wbem.WBEMException)2 RemoteDirectorGroup (com.emc.storageos.db.client.model.RemoteDirectorGroup)1 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)1