use of com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSVolumeExpandJob in project coprhd-controller by CoprHD.
the class HDSStorageDevice method doExpandVolume.
/*
* (non-Javadoc)
*
* @see com.emc.storageos.volumecontroller.BlockStorageDevice#doExpandVolume(com.emc.storageos.db.client.model.StorageSystem,
* com.emc.storageos.db.client.model.StoragePool, com.emc.storageos.db.client.model.Volume, java.lang.Long,
* com.emc.storageos.volumecontroller.TaskCompleter)
*/
@Override
public void doExpandVolume(StorageSystem storageSystem, StoragePool storagePool, Volume volume, Long size, TaskCompleter taskCompleter) throws DeviceControllerException {
log.info(String.format("Expand Volume Start - Array: %s, Pool: %s, Volume: %s, New size: %d", storageSystem.getSerialNumber(), storagePool.getNativeGuid(), volume.getLabel(), size));
try {
HDSApiClient hdsApiClient = hdsApiFactory.getClient(HDSUtils.getHDSServerManagementServerInfo(storageSystem), storageSystem.getSmisUserName(), storageSystem.getSmisPassword());
String systemObjectID = HDSUtils.getSystemObjectID(storageSystem);
String asyncTaskMessageId = null;
if (volume.getThinlyProvisioned()) {
asyncTaskMessageId = hdsApiClient.modifyThinVolume(systemObjectID, HDSUtils.getLogicalUnitObjectId(volume.getNativeId(), storageSystem), size, storageSystem.getModel());
}
if (null != asyncTaskMessageId) {
HDSJob expandVolumeJob = new HDSVolumeExpandJob(asyncTaskMessageId, storageSystem.getId(), storagePool.getId(), taskCompleter, "ExpandVolume");
ControllerServiceImpl.enqueueJob(new QueueJob(expandVolumeJob));
} else {
throw HDSException.exceptions.asyncTaskFailed("Unable to get async taskId from HiCommand Device Manager for the expand volume call");
}
} catch (final InternalException e) {
log.error("Problem in doExpandVolume: ", e);
taskCompleter.error(dbClient, e);
} catch (final Exception e) {
log.error("Problem in doExpandVolume: ", e);
ServiceError serviceError = DeviceControllerErrors.hds.methodFailed("doExpandVolume", e.getMessage());
taskCompleter.error(dbClient, serviceError);
}
log.info(String.format("Expand Volume End - Array: %s, Pool: %s, Volume: %s", storageSystem.getSerialNumber(), storagePool.getNativeGuid(), volume.getLabel()));
}
Aggregations