use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method createVolumeClone.
@Override
public DriverTask createVolumeClone(List<VolumeClone> clones, StorageCapabilities capabilities) {
CreateVolumeCloneSimulatorOperation createCloneSimulatorOperation = new CreateVolumeCloneSimulatorOperation(clones);
if (simulatorConfig.getSimulateAsynchronousResponses()) {
DriverTask driverTask = createCloneSimulatorOperation.getDriverTask();
taskOperationMap.put(driverTask.getTaskId(), createCloneSimulatorOperation);
return driverTask;
} else if (simulatorConfig.getSimulateFailures()) {
String failMsg = createCloneSimulatorOperation.getFailureMessage();
return createCloneSimulatorOperation.doFailure(failMsg);
} else {
createCloneSimulatorOperation.updateCloneInfo(clones);
String successMsg = createCloneSimulatorOperation.getSuccessMessage(clones);
return createCloneSimulatorOperation.doSuccess(successMsg);
}
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method discoverStorageProvider.
@Override
public DriverTask discoverStorageProvider(StorageProvider storageProvider, List<StorageSystem> storageSystems) {
storageProvider.setIsSupportedVersion(true);
StorageSystem providerSystem = new StorageSystem();
providerSystem.setSystemType("providersystem");
providerSystem.setNativeId("providerSystem-1");
providerSystem.setSerialNumber("1234567-1");
providerSystem.setFirmwareVersion("1.2.3");
storageSystems.add(providerSystem);
providerSystem = new StorageSystem();
providerSystem.setSystemType("providersystem");
providerSystem.setNativeId("providerSystem-2");
providerSystem.setSerialNumber("1234567-2");
providerSystem.setFirmwareVersion("1.2.3");
storageSystems.add(providerSystem);
providerSystem = new StorageSystem();
providerSystem.setSystemType("providersystem");
providerSystem.setNativeId("providerSystem-3");
providerSystem.setSerialNumber("1234567-3");
providerSystem.setFirmwareVersion("1.2.3");
storageSystems.add(providerSystem);
String taskType = "discover-storage-provider";
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("Discovered provider: %s, discovered %s storage systems.", storageProvider.getProviderName(), storageSystems.size());
task.setMessage(msg);
_log.info(msg);
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method discoverStorageSystem.
// DiscoveryDriver implementation
@Override
public DriverTask discoverStorageSystem(StorageSystem storageSystem) {
_log.info("StorageDriver: discoverStorageSystem information for storage system {}, name {} - start", storageSystem.getIpAddress(), storageSystem.getSystemName());
String taskType = "discover-storage-system";
String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
DriverTask task = new DriverSimulatorTask(taskId);
try {
if (storageSystem.getSerialNumber() == null) {
storageSystem.setSerialNumber(storageSystem.getSystemName());
}
if (storageSystem.getNativeId() == null) {
storageSystem.setNativeId(storageSystem.getSystemName());
}
storageSystem.setFirmwareVersion("2.4-3.12");
storageSystem.setIsSupportedVersion(true);
setConnInfoToRegistry(storageSystem.getNativeId(), storageSystem.getIpAddress(), storageSystem.getPortNumber(), storageSystem.getUsername(), storageSystem.getPassword());
// Support both, element and group replicas.
Set<StorageSystem.SupportedReplication> supportedReplications = new HashSet<>();
supportedReplications.add(StorageSystem.SupportedReplication.elementReplica);
supportedReplications.add(StorageSystem.SupportedReplication.groupReplica);
storageSystem.setSupportedReplications(supportedReplications);
task.setStatus(DriverTask.TaskStatus.READY);
_log.info("StorageDriver: discoverStorageSystem information for storage system {}, nativeId {} - end", storageSystem.getIpAddress(), storageSystem.getNativeId());
return task;
} catch (Exception e) {
task.setStatus(DriverTask.TaskStatus.FAILED);
e.printStackTrace();
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method stopManagement.
@Override
public DriverTask stopManagement(StorageSystem driverStorageSystem) {
_log.info("Stopping management for StorageSystem {}", driverStorageSystem.getNativeId());
String driverName = this.getClass().getSimpleName();
String taskId = String.format("%s+%s+%s", driverName, "stopManagement", UUID.randomUUID().toString());
DriverTask task = new DriverSimulatorTask(taskId);
task.setStatus(DriverTask.TaskStatus.READY);
String msg = String.format("Driver stopped managing storage system %s.", driverStorageSystem.getNativeId());
_log.info(msg);
task.setMessage(msg);
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method createConsistencyGroupClone.
@Override
public DriverTask createConsistencyGroupClone(VolumeConsistencyGroup consistencyGroup, List<VolumeClone> clones, List<CapabilityInstance> capabilities) {
CreateGroupCloneSimulatorOperation createCloneSimulatorOperation = new CreateGroupCloneSimulatorOperation(consistencyGroup, clones);
if (simulatorConfig.getSimulateAsynchronousResponses()) {
DriverTask driverTask = createCloneSimulatorOperation.getDriverTask();
taskOperationMap.put(driverTask.getTaskId(), createCloneSimulatorOperation);
return driverTask;
} else if (simulatorConfig.getSimulateFailures()) {
String failMsg = createCloneSimulatorOperation.getFailureMessage();
return createCloneSimulatorOperation.doFailure(failMsg);
} else {
createCloneSimulatorOperation.updateGroupCloneInfo(consistencyGroup, clones);
String successMsg = createCloneSimulatorOperation.getSuccessMessage(clones);
return createCloneSimulatorOperation.doSuccess(successMsg);
}
}
Aggregations