use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCStorageDriver method deleteConsistencyGroupSnapshot.
/**
* Delete a consistency group snapshot set.
*
* @param snapshots The snapshots to delete.
* @return The delete task.
*/
@Override
public DriverTask deleteConsistencyGroupSnapshot(List<VolumeSnapshot> snapshots) {
LOG.info("Deleting consistency group snapshot");
DellSCDriverTask task = new DellSCDriverTask("deleteConsistencyGroupSnapshot");
StringBuilder errBuffer = new StringBuilder();
int deletedCount = 0;
for (VolumeSnapshot snapshot : snapshots) {
DriverTask subTask = snapshotHelper.deleteVolumeSnapshot(snapshot);
if (subTask.getStatus() == TaskStatus.FAILED) {
errBuffer.append(String.format("%s%n", subTask.getMessage()));
} else {
deletedCount++;
}
}
task.setMessage(errBuffer.toString());
if (deletedCount == snapshots.size()) {
task.setStatus(TaskStatus.READY);
} else if (deletedCount == 0) {
task.setStatus(TaskStatus.FAILED);
} else {
task.setStatus(TaskStatus.PARTIALLY_FAILED);
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCStorageDriver method deleteConsistencyGroupMirror.
/*
* (non-Javadoc)
*
* @see com.emc.storageos.storagedriver.DefaultStorageDriver#deleteConsistencyGroupMirror(java.util.List)
*/
@Override
public DriverTask deleteConsistencyGroupMirror(List<VolumeMirror> mirrors) {
DellSCDriverTask task = new DellSCDriverTask("deleteConsistencyGroupMirror");
StringBuilder errBuffer = new StringBuilder();
int deletedCount = 0;
for (VolumeMirror mirror : mirrors) {
DriverTask subTask = mirrorHelper.deleteVolumeMirror(mirror);
if (subTask.getStatus() == TaskStatus.FAILED) {
errBuffer.append(String.format("%s%n", subTask.getMessage()));
} else {
deletedCount++;
}
}
task.setMessage(errBuffer.toString());
if (deletedCount == mirrors.size()) {
task.setStatus(TaskStatus.READY);
} else if (deletedCount == 0) {
task.setStatus(TaskStatus.FAILED);
} else {
task.setStatus(TaskStatus.PARTIALLY_FAILED);
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCCloning method detachVolumeClone.
/**
* Detach volume clones.
*
* @param clones The clones to detach.
* @return The detach task.
*/
public DriverTask detachVolumeClone(List<VolumeClone> clones) {
LOG.info("Detaching volume clone");
// Clones are not connected to the original volume, so already "detached".
// Potential future optimization: One volume can only have so many snapshots.
// We could use this to perform a migrate operation to a new volume to make
// the clone completely independent of the source and reduce the snapshot count.
DriverTask task = new DellSCDriverTask("detachVolumeClone");
task.setStatus(TaskStatus.READY);
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCDiscovery method discoverStorageSystem.
/**
* Discover storage systems and their capabilities.
*
* @param storageSystem Storage system to discover.
* @return The discovery task.
*/
public DriverTask discoverStorageSystem(StorageSystem storageSystem) {
DriverTask task = new DellSCDriverTask("discover");
try {
LOG.info("Getting information for storage system [{}] - {}", storageSystem.getIpAddress(), storageSystem.getSystemName());
String sn = storageSystem.getSerialNumber();
if (sn == null || sn.length() == 0) {
// Directly added system, no SSN yet so we use the name field
sn = storageSystem.getSystemName();
// name with provider_name+serial_number
if (sn.contains("+")) {
String[] parts = sn.split("\\+");
sn = parts[1];
}
}
int port = storageSystem.getPortNumber();
if (port == 0) {
port = 3033;
}
StorageCenterAPI api = connectionManager.getConnection(storageSystem.getIpAddress(), port, storageSystem.getUsername(), storageSystem.getPassword(), false);
// Populate the SC information
StorageCenter sc = api.findStorageCenter(sn);
util.getStorageSystemFromStorageCenter(api, sc, storageSystem);
storageSystem.setSystemType(driverName);
task.setStatus(DriverTask.TaskStatus.READY);
} catch (Exception e) {
String msg = String.format("Exception encountered getting storage system information: %s", e);
LOG.error(msg);
task.setMessage(msg);
task.setStatus(DriverTask.TaskStatus.FAILED);
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCMirroring method resumeVolumeMirror.
/**
* Resume volume mirrors. Not supported as once a mirror is split,
* we no longer have any way of knowing what the target was.
*
* @param mirrors The mirrors to resume.
* @return The mirror task.
*/
public DriverTask resumeVolumeMirror(List<VolumeMirror> mirrors) {
LOG.info("Resuming volume mirror not supported.");
DriverTask task = new DellSCDriverTask("resumeVolumeMirror");
task.setStatus(TaskStatus.FAILED);
return null;
}
Aggregations