use of org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao in project cloudstack by apache.
the class SolidFireIntegrationTestManagerImpl method getSolidFireVolumeAccessGroupIds.
@Override
public long[] getSolidFireVolumeAccessGroupIds(String csClusterUuid, String storagePoolUuid) {
long storagePoolId = util.getStoragePoolIdForStoragePoolUuid(storagePoolUuid);
SolidFireUtil.SolidFireConnection sfConnection = SolidFireUtil.getSolidFireConnection(storagePoolId, storagePoolDetailsDao);
List<SolidFireUtil.SolidFireVag> sfVags = SolidFireUtil.getAllVags(sfConnection);
long csClusterId = util.getClusterIdForClusterUuid(csClusterUuid);
List<HostVO> hosts = hostDao.findByClusterId(csClusterId);
if (hosts == null) {
return new long[0];
}
List<Long> vagIds = new ArrayList<>(hosts.size());
for (HostVO host : hosts) {
String iqn = host.getStorageUrl();
SolidFireUtil.SolidFireVag sfVag = SolidFireUtil.getVolumeAccessGroup(iqn, sfVags);
if (sfVag != null) {
if (!vagIds.contains(sfVag.getId())) {
vagIds.add(sfVag.getId());
}
}
}
return vagIds.stream().mapToLong(l -> l).toArray();
}
Aggregations