use of com.emc.storageos.volumecontroller.BlockController in project coprhd-controller by CoprHD.
the class DefaultBlockFullCopyApiImpl method resynchronizeCopy.
/**
* {@inheritDoc}
*/
@Override
public TaskList resynchronizeCopy(Volume sourceVolume, Volume fullCopyVolume) {
// Create the task list.
TaskList taskList = new TaskList();
// Create a unique task id.
String taskId = UUID.randomUUID().toString();
// If the source is in a CG, then we will resynchronize the corresponding
// full copies for all the volumes in the CG. Since we did not allow
// full copies for volumes or snaps in CGs prior to Jedi, there should
// be a full copy for all volumes in the CG.
Map<URI, Volume> fullCopyMap = getFullCopySetMap(sourceVolume, fullCopyVolume);
Set<URI> fullCopyURIs = fullCopyMap.keySet();
// Get the id of the source volume.
URI sourceVolumeURI = sourceVolume.getId();
// Get the storage system for the source volume.
StorageSystem sourceSystem = _dbClient.queryObject(StorageSystem.class, sourceVolume.getStorageController());
URI sourceSystemURI = sourceSystem.getId();
// Create the resynchronize task on the full copy volumes.
for (URI fullCopyURI : fullCopyURIs) {
Operation op = _dbClient.createTaskOpStatus(Volume.class, fullCopyURI, taskId, ResourceOperationTypeEnum.RESYNCHRONIZE_VOLUME_FULL_COPY);
fullCopyMap.get(fullCopyURI).getOpStatus().put(taskId, op);
TaskResourceRep fullCopyVolumeTask = TaskMapper.toTask(fullCopyMap.get(fullCopyURI), taskId, op);
taskList.getTaskList().add(fullCopyVolumeTask);
}
addConsistencyGroupTasks(Arrays.asList(sourceVolume), taskList, taskId, ResourceOperationTypeEnum.RESYNCHRONIZE_CONSISTENCY_GROUP_FULL_COPY);
// Invoke the controller.
try {
BlockController controller = getController(BlockController.class, sourceSystem.getSystemType());
controller.resyncFullCopy(sourceSystemURI, new ArrayList<URI>(fullCopyURIs), Boolean.TRUE, taskId);
} catch (InternalException ie) {
s_logger.error(String.format("Failed to resynchronize full copy %s from source %s", fullCopyVolume.getId(), sourceVolumeURI), ie);
handleFailedRequest(taskId, taskList, new ArrayList<Volume>(fullCopyMap.values()), ie, false);
}
return taskList;
}
use of com.emc.storageos.volumecontroller.BlockController in project coprhd-controller by CoprHD.
the class BlockControllerImpl method setInitiatorAlias.
@Override
public void setInitiatorAlias(URI systemURI, URI initiatorURI, String initiatorAlias) throws Exception {
// Making a direct call to set alias.
Controller controller = lookupDeviceController();
BlockController blkcontroller = (BlockController) controller;
blkcontroller.setInitiatorAlias(systemURI, initiatorURI, initiatorAlias);
}
use of com.emc.storageos.volumecontroller.BlockController in project coprhd-controller by CoprHD.
the class BlockControllerImpl method activateFullCopy.
@Override
public void activateFullCopy(URI storage, List<URI> fullCopy, String opId) {
try {
// Direct RMI call to expedite this call without any potential distribute-Q delay
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
Controller controller = lookupDeviceController(storageSystem);
BlockController blkcontroller = (BlockController) controller;
blkcontroller.activateFullCopy(storage, fullCopy, opId);
} catch (RetryableDatabaseException e) {
if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
// netflix curator ConnectionException is not serializable
// and thus should not be sent back to rmi client.
_log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
_log.error(e.getMessage(), e);
throw DatabaseException.retryables.connectionFailed();
}
throw e;
}
}
use of com.emc.storageos.volumecontroller.BlockController in project coprhd-controller by CoprHD.
the class BlockControllerImpl method activateSnapshot.
@Override
public void activateSnapshot(URI storage, List<URI> snapshotList, String opId) throws InternalException {
try {
// Direct RMI call to expedite this call without any potential distribute-Q delay
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
Controller controller = lookupDeviceController(storageSystem);
BlockController blkcontroller = (BlockController) controller;
blkcontroller.activateSnapshot(storage, snapshotList, opId);
} catch (RetryableDatabaseException e) {
if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
// netflix curator ConnectionException is not serializable
// and thus should not be sent back to rmi client.
_log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
_log.error(e.getMessage(), e);
throw DatabaseException.retryables.connectionFailed();
}
throw e;
}
}
use of com.emc.storageos.volumecontroller.BlockController in project coprhd-controller by CoprHD.
the class BlockControllerImpl method checkSyncProgress.
@Override
public Integer checkSyncProgress(URI storage, URI source, URI target, String opId) {
try {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
Controller controller = lookupDeviceController(storageSystem);
BlockController blkcontroller = (BlockController) controller;
return blkcontroller.checkSyncProgress(storage, source, target, opId);
} catch (RetryableDatabaseException e) {
if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
// netflix curator ConnectionException is not serializable
// and thus should not be sent back to rmi client.
_log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
_log.error(e.getMessage(), e);
throw DatabaseException.retryables.connectionFailed();
}
throw e;
}
}
Aggregations