use of com.emc.storageos.vnxe.models.VNXePool in project coprhd-controller by CoprHD.
the class VNXeJob method updateStoragePoolCapacity.
/**
* Update storage pool capacity
*
* @param dbClient
* @param vnxeApiClient
* @param storagePoolUri
* @param reservedCapacityVolumesIds The volumes reserved capacity in the pool that needs to be removed
*/
public static void updateStoragePoolCapacity(DbClient dbClient, VNXeApiClient vnxeApiClient, URI storagePoolUri, List<String> reservedCapacityVolumeIds) {
StoragePool storagePool = dbClient.queryObject(StoragePool.class, storagePoolUri);
if (reservedCapacityVolumeIds != null && !reservedCapacityVolumeIds.isEmpty()) {
storagePool.removeReservedCapacityForVolumes(reservedCapacityVolumeIds);
}
String poolNativeId = storagePool.getNativeId();
VNXePool pool = vnxeApiClient.getPool(poolNativeId);
storagePool.setFreeCapacity(VNXeUtils.convertDoubleSizeToViPRLong(pool.getSizeFree()));
storagePool.setSubscribedCapacity(VNXeUtils.convertDoubleSizeToViPRLong(pool.getSizeSubscribed()));
dbClient.updateObject(storagePool);
}
Aggregations