use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.
the class RPBlockServiceApiImpl method rpVPlexGroupedMigrations.
/**
* Calls out to the VPLEX Block Service to group any volumes in RG and migrate
* the volumes together. If there are any volumes not in RGs they are returned
* and then added to the single migration container to be migrated later.
*
* @param volumesToMigrate All volumes to migrate
* @param singleMigrations Container to keep track of single migrations
* @param type Personality type for logging
* @param logMigrations Log buffer
* @param taskList List of tasks that will be returned to user
* @param vpoolChangeParam used to determine if we should suspend on migration commit
*/
private void rpVPlexGroupedMigrations(HashMap<VirtualPool, List<Volume>> volumesToMigrate, Map<Volume, VirtualPool> singleMigrations, String type, StringBuffer logMigrations, TaskList taskList, VirtualPoolChangeParam vpoolChangeParam) {
for (Map.Entry<VirtualPool, List<Volume>> entry : volumesToMigrate.entrySet()) {
// List to hold volumes that are grouped by RG and migrated together
List<Volume> volumesInRG = new ArrayList<Volume>();
// List to hold volumes that are not grouped by RG and will be migrated as single migrations
List<Volume> volumesNotInRG = new ArrayList<Volume>();
VirtualPool migrateToVpool = entry.getKey();
List<Volume> migrateVolumes = entry.getValue();
ControllerOperationValuesWrapper operationsWrapper = new ControllerOperationValuesWrapper();
operationsWrapper.put(ControllerOperationValuesWrapper.MIGRATION_SUSPEND_BEFORE_COMMIT, vpoolChangeParam.getMigrationSuspendBeforeCommit());
operationsWrapper.put(ControllerOperationValuesWrapper.MIGRATION_SUSPEND_BEFORE_DELETE_SOURCE, vpoolChangeParam.getMigrationSuspendBeforeDeleteSource());
TaskList taskList2 = vplexBlockServiceApiImpl.migrateVolumesInReplicationGroup(migrateVolumes, migrateToVpool, volumesNotInRG, volumesInRG, operationsWrapper);
taskList.getTaskList().addAll(taskList2.getTaskList());
for (Volume volumeInRG : volumesInRG) {
logMigrations.append(String.format("\tRP+VPLEX migrate %s [%s](%s) to vpool [%s](%s) - GROUPED BY RG\n", type, volumeInRG.getLabel(), volumeInRG.getId(), migrateToVpool.getLabel(), migrateToVpool.getId()));
}
for (Volume volumeNotInRG : volumesNotInRG) {
logMigrations.append(String.format("\tRP+VPLEX migrate %s [%s](%s) to vpool [%s](%s)\n", type, volumeNotInRG.getLabel(), volumeNotInRG.getId(), migrateToVpool.getLabel(), migrateToVpool.getId()));
singleMigrations.put(volumeNotInRG, migrateToVpool);
}
}
}
use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.
the class RestoreSnapshotSessionForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotSessionRestoreParam input = new VolumeGroupSnapshotSessionRestoreParam();
input.setSnapshotSessions(snapSessions);
input.setPartial(true);
TaskList taskList = getClient().application().restoreApplicationSnapshotSession(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.
the class RestoreSnapshotForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotOperationParam input = new VolumeGroupSnapshotOperationParam();
input.setSnapshots(snapshots);
input.setPartial(true);
TaskList taskList = getClient().application().restoreApplicationSnapshot(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.
the class UnlinkSnapshotSessionForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotSessionUnlinkTargetsParam input = new VolumeGroupSnapshotSessionUnlinkTargetsParam();
input.setSnapshotSessions(snapshotSessions);
input.setPartial(true);
List<SnapshotSessionUnlinkTargetParam> linkedTargets = Lists.newArrayList();
if (existingLinkedSnapshotIds != null) {
for (String linkedSnapshot : existingLinkedSnapshotIds) {
SnapshotSessionUnlinkTargetParam param = new SnapshotSessionUnlinkTargetParam();
param.setId(uri(linkedSnapshot));
if (deleteTarget != null) {
param.setDeleteTarget(deleteTarget);
}
linkedTargets.add(param);
}
}
input.setLinkedTargets(linkedTargets);
TaskList taskList = getClient().application().unlinkApplicationSnapshotSession(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.
the class DeleteSnapshotForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotOperationParam input = new VolumeGroupSnapshotOperationParam();
input.setPartial(true);
input.setSnapshots(snapshots);
TaskList taskList = getClient().application().deactivateApplicationSnapshot(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Aggregations