use of com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeExpandVolumeJob in project coprhd-controller by CoprHD.
the class VNXUnityBlockStorageDevice method doExpandVolume.
@Override
public void doExpandVolume(StorageSystem storage, StoragePool pool, Volume volume, Long size, TaskCompleter taskCompleter) throws DeviceControllerException {
logger.info(String.format("Expand Volume Start - Array: %s, Pool: %s, Volume: %s, New size: %d", storage.getSerialNumber(), pool.getNativeGuid(), volume.getLabel(), size));
String cgName = volume.getReplicationGroupInstance();
String consistencyGroupId = null;
try {
VNXeApiClient apiClient = getVnxUnityClient(storage);
if (NullColumnValueGetter.isNotNullValue(cgName)) {
consistencyGroupId = apiClient.getConsistencyGroupIdByName(cgName);
VNXeUtils.getCGLock(workflowService, storage, cgName, taskCompleter.getOpId());
}
VNXeCommandJob commandJob = apiClient.expandLun(volume.getNativeId(), size, consistencyGroupId);
VNXeExpandVolumeJob expandVolumeJob = new VNXeExpandVolumeJob(commandJob.getId(), storage.getId(), taskCompleter);
ControllerServiceImpl.enqueueJob(new QueueJob(expandVolumeJob));
} catch (VNXeException e) {
logger.error("Expand volume got the exception", e);
taskCompleter.error(dbClient, e);
} catch (Exception ex) {
logger.error("Expand volume got the exception", ex);
ServiceError error = DeviceControllerErrors.vnxe.jobFailed("ExpandVolume", ex.getMessage());
taskCompleter.error(dbClient, error);
}
}
use of com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeExpandVolumeJob in project coprhd-controller by CoprHD.
the class VNXeStorageDevice method doExpandVolume.
@Override
public void doExpandVolume(StorageSystem storage, StoragePool pool, Volume volume, Long size, TaskCompleter taskCompleter) throws DeviceControllerException {
_logger.info(String.format("Expand Volume Start - Array: %s, Pool: %s, Volume: %s, New size: %d", storage.getSerialNumber(), pool.getNativeGuid(), volume.getLabel(), size));
String consistencyGroupId = null;
URI consistencyGroupURI = volume.getConsistencyGroup();
if (consistencyGroupURI != null) {
BlockConsistencyGroup consistencyGroup = _dbClient.queryObject(BlockConsistencyGroup.class, consistencyGroupURI);
if (consistencyGroup != null) {
consistencyGroupId = consistencyGroup.getCgNameOnStorageSystem(storage.getId());
}
}
try {
VNXeApiClient apiClient = getVnxeClient(storage);
VNXeCommandJob commandJob = apiClient.expandLun(volume.getNativeId(), size, consistencyGroupId);
VNXeExpandVolumeJob expandVolumeJob = new VNXeExpandVolumeJob(commandJob.getId(), storage.getId(), taskCompleter);
ControllerServiceImpl.enqueueJob(new QueueJob(expandVolumeJob));
} catch (VNXeException e) {
_logger.error("Expand volume got the exception", e);
taskCompleter.error(_dbClient, e);
} catch (Exception ex) {
_logger.error("Expand volume got the exception", ex);
ServiceError error = DeviceControllerErrors.vnxe.jobFailed("ExpandVolume", ex.getMessage());
taskCompleter.error(_dbClient, error);
}
}
Aggregations