use of com.emc.storageos.storagedriver.task.CreateGroupCloneDriverTask in project coprhd-controller by CoprHD.
the class CreateGroupCloneSimulatorOperation method getSuccessMessage.
@SuppressWarnings("unchecked")
@Override
public String getSuccessMessage(Object... args) {
List<VolumeClone> clones;
if ((args != null) && (args.length > 0)) {
clones = (List<VolumeClone>) args[0];
} else {
// Must be asynchronous, so updated clones are in the task.
CreateGroupCloneDriverTask createCloneTask = (CreateGroupCloneDriverTask) _task;
clones = createCloneTask.getClones();
}
return String.format("StorageDriver: createGroupClone information for group %s on storage system %s, clones nativeIds %s - end", clones.get(0).getConsistencyGroup(), clones.get(0).getStorageSystemId(), clones.toString());
}
use of com.emc.storageos.storagedriver.task.CreateGroupCloneDriverTask in project coprhd-controller by CoprHD.
the class CreateGroupCloneSimulatorOperation method updateOnAsynchronousSuccess.
@Override
public void updateOnAsynchronousSuccess() {
CreateGroupCloneDriverTask createCloneTask = (CreateGroupCloneDriverTask) _task;
List<VolumeClone> clones = createCloneTask.getClones();
VolumeConsistencyGroup consistencyGroup = createCloneTask.getConsistencyGroup();
updateGroupCloneInfo(consistencyGroup, clones);
}
use of com.emc.storageos.storagedriver.task.CreateGroupCloneDriverTask in project coprhd-controller by CoprHD.
the class CreateGroupCloneExternalDeviceJob method doTaskSucceeded.
/**
* {@inheritDoc}
*/
@Override
protected void doTaskSucceeded(DriverTask driverTask, DbClient dbClient) throws Exception {
s_logger.info(String.format("Successfully created group clone: %s", driverTask.getMessage()));
// Update the ViPR volumes representing the clone with the
// corresponding driver clone.
List<Volume> updatedVolumes = new ArrayList<>();
for (URI volumeURI : _volumeURIs) {
Volume volume = dbClient.queryObject(Volume.class, volumeURI);
if (volume == null) {
s_logger.error(String.format("Failed to find volume %s", volumeURI));
throw DeviceControllerException.exceptions.objectNotFound(volumeURI);
}
// Update the ViPR clone with the driver clone information.
CreateGroupCloneDriverTask createCloneDriverTask = (CreateGroupCloneDriverTask) driverTask;
List<VolumeClone> updatedClones = createCloneDriverTask.getClones();
for (VolumeClone updatedClone : updatedClones) {
if (ExternalDeviceUtils.isVolumeExternalDeviceClone(volume, updatedClone, dbClient)) {
ExternalDeviceUtils.updateNewlyCreatedGroupClone(volume, updatedClone, _cgURI, dbClient);
updatedVolumes.add(volume);
break;
}
}
}
dbClient.updateObject(updatedVolumes);
try {
// post process storage pool capacity for clone's pools
// map clones to their storage pool
updateStoragePoolCapacityAfterOperationComplete(updatedVolumes, dbClient);
} catch (Exception ex) {
s_logger.error("Failed to update storage pool after create group clone operation completion.", ex);
}
}
use of com.emc.storageos.storagedriver.task.CreateGroupCloneDriverTask in project coprhd-controller by CoprHD.
the class CreateGroupCloneSimulatorOperation method createDriverTask.
/**
* Create the create consistency group clone task that is returned by the request.
*
* @param consistencyGroup A reference to the consistency group.
* @param clones A list of the clones to be created.
*/
private void createDriverTask(VolumeConsistencyGroup consistencyGroup, List<VolumeClone> clones) {
String taskId = String.format("%s+%s+%s", StorageDriverSimulator.DRIVER_NAME, OP_NAME, UUID.randomUUID().toString());
_log.info("Creating task {} for operation of type {}", taskId, OP_NAME);
_task = new CreateGroupCloneDriverTask(taskId, consistencyGroup, clones);
_task.setStatus(DriverTask.TaskStatus.PROVISIONING);
}
Aggregations