rp- commented on code in PR #10093:
URL: https://github.com/apache/cloudstack/pull/10093#discussion_r1886658429


##########
plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java:
##########
@@ -311,12 +313,13 @@ public boolean connectPhysicalDisk(String volumePath, 
KVMStoragePool pool, Map<S
             throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
         }
 
-        try
-        {
-            allow2PrimariesIfInUse(api, rscName);
-        } catch (ApiException apiEx) {
-            s_logger.error(apiEx);
-            // do not fail here as adding allow-two-primaries property is only 
a problem while live migrating
+        if (isVMMigration) {
+            try {
+                allow2PrimariesIfInUse(api, rscName);
+            } catch (ApiException apiEx) {
+                s_logger.error(apiEx);
+                // do not fail here as adding allow-two-primaries property is 
only a problem while live migrating
+            }

Review Comment:
   Because right now it kinda always uses allow-two-primaries, if a VM is 
already running somewhere that linstor has a connection too.
   The big problem here was that, only CloudStack thought the host is down, 
even tough it wasn't.
   But with this fix, we would only allow-two-primaries if it is a live 
migration and that only works if also CloudStack has the host running.



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

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to