mike-tutkowski 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_r373235404
 
 

 ##########
 File path: 
plugins/storage/volume/solidfire/src/main/java/org/apache/cloudstack/storage/datastore/util/SolidFireUtil.java
 ##########
 @@ -683,19 +694,58 @@ private static SolidFireVag 
getVagForRandomHostInCluster(List<SolidFireUtil.Soli
         return null;
     }
 
-    public static void placeVolumeInVolumeAccessGroups(SolidFireConnection 
sfConnection, long sfVolumeId, List<HostVO> hosts) {
+    public static void placeVolumeInVolumeAccessGroups(SolidFireConnection 
sfConnection, long sfVolumeId, List<HostVO> hosts, String clusterUuId) {
         if (!SolidFireUtil.hostsSupport_iScsi(hosts)) {
             String errMsg = "Not all hosts in the compute cluster support 
iSCSI.";
 
             LOGGER.warn(errMsg);
 
             throw new CloudRuntimeException(errMsg);
         }
-
         List<SolidFireUtil.SolidFireVag> sfVags = 
SolidFireUtil.getAllVags(sfConnection);
+        Map<SolidFireUtil.SolidFireVag, List<String>> sfVagToIqnsMap = 
buildVagToIQNMap(hosts, sfVags);
+        if (sfVagToIqnsMap.size() > MAX_NUM_VAGS_PER_VOLUME) {
+            throw new CloudRuntimeException("A SolidFire volume can be in at 
most four volume access groups simultaneously.");
+        }
+        if (sfVagToIqnsMap.containsKey(null)) {
+            sfVagToIqnsMap = updateNullKeyInsfVagToIqnsMap(sfVagToIqnsMap, 
sfVags, sfConnection, clusterUuId, sfVolumeId);
 
 Review comment:
   Might want to maintain camel case here:
   
   "updateNullKeyInsfVagToIqnsMap" -> "updateNullKeyInSfVagToIqnsMap"

----------------------------------------------------------------
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

Reply via email to