Pearl1594 commented on code in PR #12617:
URL: https://github.com/apache/cloudstack/pull/12617#discussion_r3389667999


##########
engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java:
##########
@@ -2320,7 +2434,26 @@ String getVolumeBackingFile(VolumeInfo srcVolumeInfo) {
         return null;
     }
 
-    private void handlePostMigration(boolean success, Map<VolumeInfo, 
VolumeInfo> srcVolumeInfoToDestVolumeInfo, VirtualMachineTO vmTO, Host 
destHost) {
+    private void sendClvmLockCommand(long hostId, StoragePoolVO pool, 
VolumeInfo volumeInfo,
+            ClvmLockTransferCommand.Operation operation) {
+        String vgName = pool.getPath();
+        if (vgName.startsWith("/")) {
+            vgName = vgName.substring(1);
+        }
+        String lvPath = String.format("/dev/%s/%s", vgName, 
volumeInfo.getPath());
+        try {
+            Answer answer = agentManager.send(hostId,
+                    new ClvmLockTransferCommand(operation, lvPath, 
volumeInfo.getUuid()));
+            if (answer == null || !answer.getResult()) {
+                String details = answer != null ? answer.getDetails() : "null 
answer";
+                logger.warn("CLVM lock command [{}] failed for LV [{}] on host 
[{}]: {}", operation, lvPath, hostId, details);

Review Comment:
   The locking here is not about making the device accessible for the migration 
itself, that's handled earlier (pre-migration ACTIVATE_SHARED, which 
hard-fails). These post-migration  ACTIVATE_EXCLUSIVE calls are state 
normalization.                             



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to