use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method getStorageVolumes.
@Override
public DriverTask getStorageVolumes(StorageSystem storageSystem, List<StorageVolume> storageVolumes, MutableInt token) {
// all volumes on the same page belong to the same consistency group
if (token.intValue() == 0) {
arrayToVolumeToVolumeExportInfoMap.clear();
}
List<StoragePort> ports = new ArrayList<>();
discoverStoragePorts(storageSystem, ports);
for (int vol = 0; vol < NUMBER_OF_VOLUMES_ON_PAGE; vol++) {
StorageVolume driverVolume = new StorageVolume();
driverVolume.setStorageSystemId(storageSystem.getNativeId());
driverVolume.setStoragePoolId("pool-1234577-" + token.intValue() + storageSystem.getNativeId());
driverVolume.setNativeId("driverSimulatorVolume-1234567-" + token.intValue() + "-" + vol);
if (VOLUMES_IN_CG) {
driverVolume.setConsistencyGroup("driverSimulatorCG-" + token.intValue());
}
driverVolume.setAccessStatus(StorageVolume.AccessStatus.READ_WRITE);
driverVolume.setThinlyProvisioned(true);
driverVolume.setThinVolumePreAllocationSize(3000L);
driverVolume.setProvisionedCapacity(3 * 1024 * 1024 * 1024L);
driverVolume.setAllocatedCapacity(50000L);
driverVolume.setDeviceLabel(driverVolume.getNativeId());
driverVolume.setWwn(String.format("%s%s", driverVolume.getStorageSystemId(), driverVolume.getNativeId()));
storageVolumes.add(driverVolume);
_log.info("Unmanaged volume info: pool {}, volume {}", driverVolume.getStoragePoolId(), driverVolume);
if (GENERATE_EXPORT_DATA) {
// get host for this page
for (String hostName : pageToHostMap.get(token.intValue())) {
_log.info("Process host {}", hostName);
generateExportDataForVolume(hostName, driverVolume.getStorageSystemId(), driverVolume.getNativeId(), vol, ports, token.intValue());
}
}
}
String taskType = "create-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);
task.setMessage("Get storage volumes: page " + token);
_log.info("StorageDriver: get storage volumes information for storage system {}, token {} - end", storageSystem.getNativeId(), token);
// set next value
if (token.intValue() < NUMBER_OF_VOLUME_PAGES - 1) {
// each page has different consistency group
token.setValue(token.intValue() + 1);
// token.setValue(0); // last page
} else {
// last page
token.setValue(0);
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method createVolumeSnapshot.
@Override
public DriverTask createVolumeSnapshot(List<VolumeSnapshot> snapshots, StorageCapabilities capabilities) {
String snapTimestamp = Long.toString(System.currentTimeMillis());
for (VolumeSnapshot snapshot : snapshots) {
snapshot.setNativeId("snap-" + snapshot.getParentId() + UUID.randomUUID().toString());
snapshot.setConsistencyGroup(snapTimestamp);
snapshot.setAllocatedCapacity(1000L);
snapshot.setProvisionedCapacity(2000L);
}
String taskType = "create-volume-snapshot";
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: createVolumeSnapshot information for storage system {}, snapshots nativeIds {} - end", snapshots.get(0).getStorageSystemId(), snapshots.toString());
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method deleteVolumeClone.
@Deprecated
public DriverTask deleteVolumeClone(VolumeClone clone) {
String taskType = "delete-volume-clone";
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: deleteVolumeClone for storage system %s, " + "clones nativeId %s - end", clone.getStorageSystemId(), clone.toString());
_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 exportVolumesToInitiators.
@Override
public DriverTask exportVolumesToInitiators(List<Initiator> initiators, List<StorageVolume> volumes, Map<String, String> volumeToHLUMap, List<StoragePort> recommendedPorts, List<StoragePort> availablePorts, StorageCapabilities capabilities, MutableBoolean usedRecommendedPorts, List<StoragePort> selectedPorts) {
usedRecommendedPorts.setValue(true);
selectedPorts.addAll(recommendedPorts);
String taskType = "export-volumes-to-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: exportVolumesToInitiators: export type %s, initiators %s .", initiators.get(0).getInitiatorType(), initiators.toString());
_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 createVolumes.
@Override
public DriverTask createVolumes(List<StorageVolume> volumes, StorageCapabilities capabilities) {
// String newVolumes = "";
Set<String> newVolumes = new HashSet<>();
for (StorageVolume volume : volumes) {
volume.setNativeId("driverSimulatorVolume" + UUID.randomUUID().toString());
volume.setAccessStatus(StorageVolume.AccessStatus.READ_WRITE);
volume.setProvisionedCapacity(volume.getRequestedCapacity());
volume.setAllocatedCapacity(volume.getRequestedCapacity());
volume.setDeviceLabel(volume.getNativeId());
volume.setWwn(String.format("%s%s", volume.getStorageSystemId(), volume.getNativeId()));
// newVolumes = newVolumes + volume.getNativeId() + " ";
newVolumes.add(volume.getNativeId());
}
String taskType = "create-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);
String msg = String.format("StorageDriver: createVolumes information for storage system %s, volume nativeIds %s - end", volumes.get(0).getStorageSystemId(), newVolumes.toString());
_log.info(msg);
task.setMessage(msg);
return task;
}
Aggregations