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);
}
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);
}
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");
}
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);
}
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;
}
Aggregations