DaanHoogland commented on a change in pull request #3794: [WIP] create Volume
Access Groups per cluster instead of CloudStack-RandomUUID()
URL: https://github.com/apache/cloudstack/pull/3794#discussion_r372334935
##########
File path:
plugins/storage/volume/solidfire/src/main/java/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
##########
@@ -513,12 +513,18 @@ public static void hostAddedToCluster(long hostId, long
clusterId, String storag
// creating a new VAG won't exceed 4 VAGs for the computer cluster).
// If none of the hosts in the cluster are in a VAG, then leave this host
out of a VAG.
// Place applicable volume IDs in VAG, if need be (account of volume
starts with SF_CS_ACCOUNT_PREFIX).
- private static void handleVagForHost(SolidFireUtil.SolidFireConnection
sfConnection, List<SolidFireUtil.SolidFireVag> sfVags, Host host, HostDao
hostDao) {
+ private static void handleVagForHost(SolidFireUtil.SolidFireConnection
sfConnection, List<SolidFireUtil.SolidFireVag> sfVags, Host host, HostDao
hostDao, ClusterDao clusterDao) {
List<HostVO> hostVOs = hostDao.findByClusterId(host.getClusterId());
if (hostVOs != null) {
int numVags = 0;
+ String clusterUuId =
clusterDao.findById(host.getClusterId()).getUuid();
+ SolidFireVag sfVagMatchingClusterId = sfVags.stream().filter(vag
-> vag.getName().equals("CloudStack-"+clusterUuId)).findFirst().orElse(null);
+ if (sfVagMatchingClusterId != null &&
sfVagMatchingClusterId.getInitiators().length < MAX_NUM_INITIATORS_PER_VAG) {
+ addInitiatorsToSolidFireVag(sfConnection,
sfVagMatchingClusterId.getId(), new String[]{host.getStorageUrl()});
+ }
Review comment:
can you make this a method with a good descriptive name?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services