use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DefaultDriverTask method abort.
@Override
public DriverTask abort(DriverTask task) {
DriverTask abortTaskTask = new DriverTask("AbortTask_" + task.getTaskId()) {
public DriverTask abort(DriverTask task) {
throw new UnsupportedOperationException("Cannot abort abort task");
}
};
abortTaskTask.setStatus(TaskStatus.FAILED);
abortTaskTask.setMessage("abort operation is not supported for default tasks.");
return abortTaskTask;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class HP3PARStorageDriver method discoverStoragePorts.
/**
* Get storage port information
*/
@Override
public DriverTask discoverStoragePorts(StorageSystem storageSystem, List<StoragePort> storagePorts) {
// For this 3PAR system
_log.info("3PARDriver: discoverStoragePorts information for storage system {}, nativeId {} - start", storageSystem.getIpAddress(), storageSystem.getNativeId());
DriverTask task = createDriverTask(HP3PARConstants.TASK_TYPE_DISCOVER_STORAGE_PORTS);
try {
hp3parUtil.discoverStoragePortsById(storageSystem.getNativeId(), storagePorts, this.driverRegistry);
storageSystem.setAccessStatus(AccessStatus.READ_WRITE);
task.setStatus(DriverTask.TaskStatus.READY);
_log.info("3PARDriver: discoverStoragePorts information for storage system {}, nativeId {} - end", storageSystem.getIpAddress(), storageSystem.getNativeId());
} catch (Exception e) {
String msg = String.format("3PARDriver: Unable to discover the storage port information for storage system %s native id %s; Error: %s.\n", storageSystem.getSystemName(), storageSystem.getNativeId(), e);
_log.error(msg);
_log.error(CompleteError.getStackTrace(e));
task.setMessage(msg);
task.setStatus(DriverTask.TaskStatus.FAILED);
e.printStackTrace();
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class HP3PARStorageDriver method discoverStorageSystem.
/**
* Get storage system information and capabilities
*/
@Override
public DriverTask discoverStorageSystem(StorageSystem storageSystem) {
DriverTask task = createDriverTask(HP3PARConstants.TASK_TYPE_DISCOVER_STORAGE_SYSTEM);
try {
_log.info("3PARDriver:discoverStorageSystem information for storage system {}, name {} - start", storageSystem.getIpAddress(), storageSystem.getSystemName());
URI deviceURI = new URI("https", null, storageSystem.getIpAddress(), storageSystem.getPortNumber(), "/", null, null);
// remove '/' as lock fails with this name
String uniqueId = deviceURI.toString();
uniqueId = uniqueId.replace("/", "");
HP3PARApi hp3parApi = hp3parUtil.getHP3PARDevice(storageSystem);
String authToken = hp3parApi.getAuthToken(storageSystem.getUsername(), storageSystem.getPassword());
if (authToken == null) {
throw new HP3PARException("Could not get authentication token");
}
// Verify user role
hp3parApi.verifyUserRole(storageSystem.getUsername());
// get storage details
SystemCommandResult systemRes = hp3parApi.getSystemDetails();
storageSystem.setSerialNumber(systemRes.getSerialNumber());
storageSystem.setMajorVersion(systemRes.getSystemVersion());
// as there is no individual portion in 3par api
storageSystem.setMinorVersion("0");
// protocols supported
List<String> protocols = new ArrayList<String>();
protocols.add(Protocols.iSCSI.toString());
protocols.add(Protocols.FC.toString());
storageSystem.setProtocols(protocols);
storageSystem.setFirmwareVersion(systemRes.getSystemVersion());
if (systemRes.getSystemVersion().startsWith("3.1") || systemRes.getSystemVersion().startsWith("3.2.1")) {
// SDK is taking care of unsupported message
storageSystem.setIsSupportedVersion(false);
} else {
storageSystem.setIsSupportedVersion(true);
}
storageSystem.setModel(systemRes.getModel());
storageSystem.setProvisioningType(SupportedProvisioningType.THIN_AND_THICK);
Set<StorageSystem.SupportedReplication> supportedReplications = new HashSet<>();
supportedReplications.add(StorageSystem.SupportedReplication.elementReplica);
supportedReplications.add(StorageSystem.SupportedReplication.groupReplica);
storageSystem.setSupportedReplications(supportedReplications);
// Storage object properties
storageSystem.setNativeId(uniqueId + ":" + systemRes.getSerialNumber());
if (storageSystem.getDeviceLabel() == null) {
if (storageSystem.getDisplayName() != null) {
storageSystem.setDeviceLabel(storageSystem.getDisplayName());
} else if (systemRes.getName() != null) {
storageSystem.setDeviceLabel(systemRes.getName());
storageSystem.setDisplayName(systemRes.getName());
}
}
storageSystem.setAccessStatus(AccessStatus.READ_WRITE);
setConnInfoToRegistry(storageSystem.getNativeId(), storageSystem.getIpAddress(), storageSystem.getPortNumber(), storageSystem.getUsername(), storageSystem.getPassword());
task.setStatus(DriverTask.TaskStatus.READY);
_log.info("3PARDriver: Successfull discovery storage system {}, name {} - end", storageSystem.getIpAddress(), storageSystem.getSystemName());
} catch (Exception e) {
String msg = String.format("3PARDriver: Unable to discover the storage system %s ip %s; Error: %s.\n", storageSystem.getSystemName(), storageSystem.getIpAddress(), e);
_log.error(msg);
_log.error(CompleteError.getStackTrace(e));
task.setMessage(msg);
task.setStatus(DriverTask.TaskStatus.FAILED);
e.printStackTrace();
}
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class HP3PARStorageDriver method addVolumesToConsistencyGroup.
@Override
public DriverTask addVolumesToConsistencyGroup(List<StorageVolume> volumes, StorageCapabilities capabilities) {
int addVolume = 1;
DriverTask task = createDriverTask(HP3PARConstants.TASK_TYPE_ADD_VOLUME_TO_CONSISTENCY_GROUP);
return cgHelper.addOrRemoveConsistencyGroupVolume(volumes, task, driverRegistry, addVolume);
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DellSCDriverTask method abort.
/*
* (non-Javadoc)
*
* @see com.emc.storageos.storagedriver.DriverTask#abort(com.emc.storageos.storagedriver.DriverTask)
*/
@Override
public DriverTask abort(DriverTask task) {
DriverTask abortTask = new DriverTask("Abort driver task") {
@Override
public DriverTask abort(DriverTask task) {
return null;
}
};
abortTask.setStatus(TaskStatus.FAILED);
abortTask.setMessage("Operation is not supported.");
return abortTask;
}
Aggregations