use of com.emc.storageos.storagedriver.task.ExpandVolumeDriverTask in project coprhd-controller by CoprHD.
the class ExpandVolumeExternalDeviceJob method doTaskSucceeded.
/**
* {@inheritDoc}
*/
@Override
protected void doTaskSucceeded(DriverTask driverTask, DbClient dbClient) throws Exception {
// Get the ViPR volume.
s_logger.info(String.format("Successfully expanded volume %s:%s", _volumeURI, driverTask.getMessage()));
Volume volume = dbClient.queryObject(Volume.class, _volumeURI);
if (volume == null) {
s_logger.error(String.format("Failed to find volume %s", _volumeURI));
throw DeviceControllerException.exceptions.objectNotFound(_volumeURI);
}
// Update the ViPR volume with the driver volume information.
ExpandVolumeDriverTask expandVolumeDriverTask = (ExpandVolumeDriverTask) driverTask;
StorageVolume updatedDeviceVolume = expandVolumeDriverTask.getStorageVolume();
ExternalDeviceUtils.updateExpandedVolume(volume, updatedDeviceVolume, dbClient);
try {
// Update storage pool capacity in database.
ExternalDeviceUtils.updateStoragePoolCapacityAfterOperationComplete(volume.getPool(), _storageSystemURI, Collections.singletonList(_volumeURI), dbClient);
} catch (Exception ex) {
s_logger.error("Failed to update storage pool {} after volume expand operation completion.", volume.getPool(), ex);
}
}
use of com.emc.storageos.storagedriver.task.ExpandVolumeDriverTask in project coprhd-controller by CoprHD.
the class ExpandVolumeSimulatorOperation method updateOnAsynchronousSuccess.
@Override
public void updateOnAsynchronousSuccess() {
ExpandVolumeDriverTask expandVolumeTask = (ExpandVolumeDriverTask) _task;
StorageVolume volume = expandVolumeTask.getStorageVolume();
long newCapacity = expandVolumeTask.getExpandedCapacity();
updateVolumeInfo(volume, newCapacity);
}
use of com.emc.storageos.storagedriver.task.ExpandVolumeDriverTask in project coprhd-controller by CoprHD.
the class ExpandVolumeSimulatorOperation method createDriverTask.
/**
* Create the expand volume task that is returned by the request.
*
* @param volume A reference to the storage volume being expanded.
* @param newCapacity The requested new capacity.
*/
private void createDriverTask(StorageVolume volume, long newCapacity) {
String taskId = String.format("%s+%s+%s", StorageDriverSimulator.DRIVER_NAME, OP_NAME, UUID.randomUUID().toString());
_log.info("Creating task {} for operation of type {}", taskId, OP_NAME);
_task = new ExpandVolumeDriverTask(taskId, volume, newCapacity);
_task.setStatus(DriverTask.TaskStatus.PROVISIONING);
}
use of com.emc.storageos.storagedriver.task.ExpandVolumeDriverTask in project coprhd-controller by CoprHD.
the class ExpandVolumeSimulatorOperation method getSuccessMessage.
@Override
public String getSuccessMessage(Object... args) {
StorageVolume volume;
if ((args != null) && (args.length > 0)) {
volume = (StorageVolume) args[0];
} else {
// Must be asynchronous, so updated volume is in the task.
ExpandVolumeDriverTask expandVolumeTask = (ExpandVolumeDriverTask) _task;
volume = expandVolumeTask.getStorageVolume();
}
return String.format("StorageDriver: expandVolume information for storage system %s, volume nativeIds %s, new capacity %s - end", volume.getStorageSystemId(), volume.toString(), volume.getRequestedCapacity());
}
Aggregations