Search in sources :

Example 66 with BlockMirror

use of com.emc.storageos.db.client.model.BlockMirror in project coprhd-controller by CoprHD.

the class VmaxMirrorOperations method resumeGroupMirrors.

/**
 * Utility to resume Group mirrors.
 * @param storage
 * @param mirrorList
 */
private void resumeGroupMirrors(StorageSystem storage, List<URI> mirrorList) throws WBEMException {
    CIMObjectPath groupSynchronized = ReplicationUtils.getMirrorGroupSynchronizedPath(storage, mirrorList.get(0), _dbClient, _helper, _cimPath);
    CIMArgument[] resumeCGMirrorInput = _helper.getResumeSynchronizationInputArgumentsWithCopyState(groupSynchronized);
    CIMArgument[] outArgs = new CIMArgument[5];
    _helper.callModifyReplica(storage, resumeCGMirrorInput, outArgs);
    List<BlockMirror> mirrors = _dbClient.queryObject(BlockMirror.class, mirrorList);
    for (BlockMirror mirror : mirrors) {
        mirror.setSyncState(SynchronizationState.SYNCHRONIZED.name());
    }
    _dbClient.persistObject(mirrors);
}
Also used : BlockMirror(com.emc.storageos.db.client.model.BlockMirror) CIMObjectPath(javax.cim.CIMObjectPath) CIMArgument(javax.cim.CIMArgument)

Example 67 with BlockMirror

use of com.emc.storageos.db.client.model.BlockMirror in project coprhd-controller by CoprHD.

the class VnxMirrorOperations method modifyGroupMirrors.

/**
 * Invoke modifyListSynchronization for synchronized operations, e.g. fracture, detach, etc
 *
 * @param storageSystem
 * @param mirrorList
 * @param operation
 * @param copyState
 * @throws Exception
 */
@SuppressWarnings("rawtypes")
private void modifyGroupMirrors(StorageSystem storageSystem, List<URI> mirrorList, int operation, int copyState) throws Exception {
    callEMCRefreshIfRequired(_dbClient, _helper, storageSystem, mirrorList);
    List<BlockMirror> mirrors = _dbClient.queryObject(BlockMirror.class, mirrorList);
    List<CIMObjectPath> syncPaths = new ArrayList<CIMObjectPath>();
    for (BlockMirror mirror : mirrors) {
        Volume source = _dbClient.queryObject(Volume.class, mirror.getSource());
        CIMObjectPath syncObject = _cimPath.getStorageSynchronized(storageSystem, source, storageSystem, mirror);
        CIMInstance instance = _helper.checkExists(storageSystem, syncObject, false, false);
        if (instance != null) {
            syncPaths.add(syncObject);
        } else {
            _log.error("Storage synchronized instance is not available for mirror {}", mirror.getLabel());
            throw DeviceControllerException.exceptions.synchronizationInstanceNull(mirror.getLabel());
        }
    }
    CIMArgument[] modifyCGMirrorInput = _helper.getModifyListReplicaInputArguments(syncPaths.toArray(new CIMObjectPath[] {}), operation, copyState);
    _helper.callModifyListReplica(storageSystem, modifyCGMirrorInput);
}
Also used : BlockMirror(com.emc.storageos.db.client.model.BlockMirror) Volume(com.emc.storageos.db.client.model.Volume) CIMObjectPath(javax.cim.CIMObjectPath) ArrayList(java.util.ArrayList) CIMInstance(javax.cim.CIMInstance) CIMArgument(javax.cim.CIMArgument)

Example 68 with BlockMirror

use of com.emc.storageos.db.client.model.BlockMirror in project coprhd-controller by CoprHD.

the class VnxMirrorOperations method fractureGroupMirrors.

@Override
public void fractureGroupMirrors(StorageSystem storage, List<URI> mirrorList, Boolean sync, TaskCompleter taskCompleter) {
    _log.info("fractureGroupMirrors operation START");
    try {
        // If there is a mix of mirrors in Sync and Split states, resume the group.
        if (_helper.groupHasReplicasInSplitState(storage, mirrorList, BlockMirror.class)) {
            resumeGroupMirrors(storage, mirrorList);
        }
        int operation = (sync != null && sync) ? SmisConstants.SPLIT_VALUE : SmisConstants.FRACTURE_VALUE;
        int copyState = (operation == SmisConstants.SPLIT_VALUE) ? SmisConstants.SPLIT : SmisConstants.FRACTURED;
        modifyGroupMirrors(storage, mirrorList, operation, copyState);
        List<BlockMirror> mirrors = _dbClient.queryObject(BlockMirror.class, mirrorList);
        for (BlockMirror mirror : mirrors) {
            mirror.setSyncState(SynchronizationState.FRACTURED.name());
        }
        _dbClient.persistObject(mirrors);
        taskCompleter.ready(_dbClient);
    } catch (Exception e) {
        _log.error("Problem making SMI-S call", e);
        ServiceError error = DeviceControllerException.errors.jobFailed(e);
        taskCompleter.error(_dbClient, error);
    }
    _log.info("fractureGroupMirrors operation END");
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BlockMirror(com.emc.storageos.db.client.model.BlockMirror) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 69 with BlockMirror

use of com.emc.storageos.db.client.model.BlockMirror in project coprhd-controller by CoprHD.

the class VnxMirrorOperations method resumeGroupMirrors.

private void resumeGroupMirrors(StorageSystem storage, List<URI> mirrorList) throws Exception {
    modifyGroupMirrors(storage, mirrorList, SmisConstants.RESYNC_VALUE, SmisConstants.SYNCHRONIZED);
    List<BlockMirror> mirrors = _dbClient.queryObject(BlockMirror.class, mirrorList);
    for (BlockMirror mirror : mirrors) {
        mirror.setSyncState(SynchronizationState.SYNCHRONIZED.name());
    }
    _dbClient.persistObject(mirrors);
}
Also used : BlockMirror(com.emc.storageos.db.client.model.BlockMirror)

Example 70 with BlockMirror

use of com.emc.storageos.db.client.model.BlockMirror in project coprhd-controller by CoprHD.

the class ConsistencyGroupUtils method getMirrorsConsistencyGroup.

/**
 * Gets the {@BlockConsistencyGroup} associated with a mirror in the given list of mirrors.
 *
 * @param mirrors
 * @param dbClient
 * @return
 */
public static BlockConsistencyGroup getMirrorsConsistencyGroup(List<URI> mirrors, DbClient dbClient) {
    BlockMirror mirror = dbClient.queryObject(BlockMirror.class, mirrors.get(0));
    Volume source = dbClient.queryObject(Volume.class, mirror.getSource().getURI());
    BlockConsistencyGroup cgResult = null;
    if (source != null && source.isInCG() && ControllerUtils.checkCGCreatedOnBackEndArray(source)) {
        cgResult = dbClient.queryObject(BlockConsistencyGroup.class, source.getConsistencyGroup());
    }
    return cgResult;
}
Also used : BlockMirror(com.emc.storageos.db.client.model.BlockMirror) Volume(com.emc.storageos.db.client.model.Volume) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup)

Aggregations

BlockMirror (com.emc.storageos.db.client.model.BlockMirror)115 Volume (com.emc.storageos.db.client.model.Volume)77 URI (java.net.URI)49 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)43 ArrayList (java.util.ArrayList)33 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)30 NamedURI (com.emc.storageos.db.client.model.NamedURI)29 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)28 CIMObjectPath (javax.cim.CIMObjectPath)26 CIMInstance (javax.cim.CIMInstance)16 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)15 FCTN_MIRROR_TO_URI (com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_MIRROR_TO_URI)15 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)15 CIMArgument (javax.cim.CIMArgument)14 WBEMException (javax.wbem.WBEMException)14 BlockObject (com.emc.storageos.db.client.model.BlockObject)12 StringSet (com.emc.storageos.db.client.model.StringSet)12 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)11 ControllerException (com.emc.storageos.volumecontroller.ControllerException)10 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)9