use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneCreateCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method createFullCopyVolume.
public void createFullCopyVolume(URI storage, URI sourceVolume, List<URI> fullCopyVolumes, Boolean createInactive, boolean isCG, String taskId) {
try {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
TaskCompleter taskCompleter = new CloneCreateCompleter(fullCopyVolumes, taskId);
WorkflowStepCompleter.stepExecuting(taskId);
// if number of clones more than 1 we need to use createListReplica
if (isCG || fullCopyVolumes.size() > 1) {
boolean isListReplicaFlow = false;
Volume sourceVolumeObj = _dbClient.queryObject(Volume.class, sourceVolume);
// created at the same time
if (NullColumnValueGetter.isNotNullValue(sourceVolumeObj.getReplicationGroupInstance())) {
List<String> lockKeys = new ArrayList<>();
lockKeys.add(ControllerLockingUtil.getReplicationGroupStorageKey(_dbClient, sourceVolumeObj.getReplicationGroupInstance(), storage));
_workflowService.acquireWorkflowStepLocks(taskId, lockKeys, LockTimeoutValue.get(LockType.ARRAY_CG));
}
/**
* VPLEX/RP CG volumes may not be having back end Array Group.
* In this case we should create element replica using createListReplica.
* We should not use createGroup replica as backend cg will not be available in this case.
*/
isListReplicaFlow = isListReplicaFlow(sourceVolumeObj);
if (!isListReplicaFlow) {
getDevice(storageSystem.getSystemType()).doCreateGroupClone(storageSystem, fullCopyVolumes, createInactive, taskCompleter);
} else {
// List Replica
createListClone(storage, fullCopyVolumes, createInactive, taskId);
}
} else {
getDevice(storageSystem.getSystemType()).doCreateClone(storageSystem, sourceVolume, fullCopyVolumes.get(0), createInactive, taskCompleter);
}
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(taskId, serviceError);
doFailTask(Volume.class, fullCopyVolumes, taskId, serviceError);
}
}
Aggregations