Search in sources :

Example 31 with DriverTask

use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.

the class DriverSimulatorTask method abort.

public DriverTask abort(DriverTask task) {
    DriverTask abortTaskTask = new DriverTask("AbortTask_" + getTaskId()) {

        public DriverTask abort(DriverTask task) {
            throw new UnsupportedOperationException("Cannot abort abort task");
        }
    };
    abortTaskTask.setStatus(TaskStatus.FAILED);
    abortTaskTask.setMessage("Operation is not supported for simulator tasks.");
    return abortTaskTask;
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask)

Example 32 with DriverTask

use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.

the class StorageDriverSimulator method restoreFromClone.

@Override
public DriverTask restoreFromClone(List<VolumeClone> clones) {
    RestoreFromCloneSimulatorOperation restoreCloneSimulatorOperation = new RestoreFromCloneSimulatorOperation(clones);
    if (simulatorConfig.getSimulateAsynchronousResponses()) {
        DriverTask driverTask = restoreCloneSimulatorOperation.getDriverTask();
        taskOperationMap.put(driverTask.getTaskId(), restoreCloneSimulatorOperation);
        return driverTask;
    } else if (simulatorConfig.getSimulateFailures()) {
        String failMsg = restoreCloneSimulatorOperation.getFailureMessage();
        return restoreCloneSimulatorOperation.doFailure(failMsg);
    } else {
        restoreCloneSimulatorOperation.updateCloneInfo(clones);
        String successMsg = restoreCloneSimulatorOperation.getSuccessMessage(clones);
        return restoreCloneSimulatorOperation.doSuccess(successMsg);
    }
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask) RestoreFromCloneSimulatorOperation(com.emc.storageos.driver.driversimulator.operations.RestoreFromCloneSimulatorOperation)

Example 33 with DriverTask

use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.

the class StorageDriverSimulator method unexportVolumesFromInitiators.

@Override
public DriverTask unexportVolumesFromInitiators(List<Initiator> initiators, List<StorageVolume> volumes) {
    String taskType = "unexport-volumes-from-initiators";
    String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
    DriverTask task = new DriverSimulatorTask(taskId);
    task.setStatus(DriverTask.TaskStatus.READY);
    String msg = String.format("StorageDriver: unexportVolumesFromInitiators: export type %s, initiators %s .", initiators.get(0).getInitiatorType(), initiators.toString());
    _log.info(msg);
    task.setMessage(msg);
    return task;
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask)

Example 34 with DriverTask

use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.

the class StorageDriverSimulator method removeVolumesFromConsistencyGroup.

@Override
public DriverTask removeVolumesFromConsistencyGroup(List<StorageVolume> volumes, StorageCapabilities capabilities) {
    _log.info("Remove {} Volumes from Consistency Group {}", volumes.toString(), volumes.get(0).getConsistencyGroup());
    String taskType = "remove-volumes-to-consistency-groupd";
    String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
    DriverTask task = new DriverSimulatorTask(taskId);
    task.setStatus(DriverTask.TaskStatus.READY);
    String msg = String.format("StorageDriver: removeVolumesFromConsistencyGroup information for storage system %s, volume nativeIds %s, Consistency Group - end", volumes.get(0).getStorageSystemId(), volumes.toString());
    _log.info(msg);
    task.setMessage(msg);
    return task;
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask)

Example 35 with DriverTask

use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.

the class StorageDriverSimulator method deleteVolume.

@Override
public DriverTask deleteVolume(StorageVolume volume) {
    String taskType = "delete-storage-volumes";
    String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
    DriverTask task = new DriverSimulatorTask(taskId);
    task.setStatus(DriverTask.TaskStatus.READY);
    _log.info("StorageDriver: deleteVolumes information for storage system {}, volume nativeIds {} - end", volume.getStorageSystemId(), volume.toString());
    return task;
}
Also used : DriverTask(com.emc.storageos.storagedriver.DriverTask)

Aggregations

DriverTask (com.emc.storageos.storagedriver.DriverTask)80 BlockStorageDriver (com.emc.storageos.storagedriver.BlockStorageDriver)26 StorageVolume (com.emc.storageos.storagedriver.model.StorageVolume)26 ArrayList (java.util.ArrayList)26 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)22 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)21 Volume (com.emc.storageos.db.client.model.Volume)15 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)15 IOException (java.io.IOException)15 URI (java.net.URI)15 HashMap (java.util.HashMap)13 DellSCDriverTask (com.emc.storageos.driver.dellsc.DellSCDriverTask)10 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)9 HashSet (java.util.HashSet)9 VolumeClone (com.emc.storageos.storagedriver.model.VolumeClone)7 VolumeSnapshot (com.emc.storageos.storagedriver.model.VolumeSnapshot)7 BlockObject (com.emc.storageos.db.client.model.BlockObject)6 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)6 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)6 ExportMask (com.emc.storageos.db.client.model.ExportMask)6