Tal Nisan has uploaded a new change for review.

Change subject: webadmin: When live migrating a disk filter domains only if 
needed
......................................................................

webadmin: When live migrating a disk filter domains only if needed

Up until now when moving a disk connected to a running VM (LSM) the domains
were filtered so that live move would have been possible only within the
same storage types (block/file).
This patch cause the domains to be filtered only for data centers with
versions up to 3.6 since we from 3.6 onwards we support LSM between
different storage types

Change-Id: I5eaaf8209a8e7187987697baae1086a9d4311ce3
Signed-off-by: Tal Nisan <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/MoveOrCopyDiskModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MoveDiskModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
6 files changed, 32 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/50/40550/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
index 446ffec..4152af4 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
@@ -160,7 +160,8 @@
     CORSSupport,
     CORSAllowedOrigins,
     CinderProviderSupported,
-    NetworkSriovSupported;
+    NetworkSriovSupported,
+    LiveStorageMigrationBetweenDifferentStorageTypes;
 
     public static enum ConfigAuthType {
         Admin,
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
index 0e3bd1e..ac4f382 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
@@ -3785,6 +3785,11 @@
         return (Boolean) 
getConfigValuePreConverted(ConfigurationValues.MixedDomainTypesInDataCenter, 
version.toString());
     }
 
+    public boolean isLsmBetweenMixedStorageDomainsSupported(Version version) {
+        return (Boolean) 
getConfigValuePreConverted(ConfigurationValues.LiveStorageMigrationBetweenDifferentStorageTypes,
+                version.toString());
+    }
+
     public ArrayList<VDSGroup> getClusterByServiceList(List<VDSGroup> list,
             boolean supportsVirtService,
             boolean supportsGlusterService) {
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/MoveOrCopyDiskModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/MoveOrCopyDiskModel.java
index 1c57e5e..ace614e 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/MoveOrCopyDiskModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/MoveOrCopyDiskModel.java
@@ -41,6 +41,7 @@
 public abstract class MoveOrCopyDiskModel extends DisksAllocationModel 
implements ICommandTarget
 {
     private ArrayList<DiskModel> allDisks;
+    private StoragePool dataCenter;
 
     public ArrayList<DiskModel> getAllDisks()
     {
@@ -57,6 +58,14 @@
     }
 
     private ArrayList<DiskImage> diskImages;
+
+    public StoragePool getDataCenter() {
+        return dataCenter;
+    }
+
+    public void setDataCenter(StoragePool dataCenter) {
+        this.dataCenter = dataCenter;
+    }
 
     public ArrayList<DiskImage> getDiskImages()
     {
@@ -165,6 +174,7 @@
                     MoveOrCopyDiskModel model = (MoveOrCopyDiskModel) target;
                     StoragePool dataCenter = (StoragePool) returnValue;
 
+                    model.setDataCenter(dataCenter);
                     
model.setQuotaEnforcementType(dataCenter.getQuotaEnforcementType());
                     model.postInitStorageDomains();
                 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MoveDiskModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MoveDiskModel.java
index 1a02c87..acc3a5a 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MoveDiskModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MoveDiskModel.java
@@ -22,6 +22,7 @@
 import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
 import org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel;
+import org.ovirt.engine.ui.uicompat.ConstantsManager;
 import org.ovirt.engine.ui.uicompat.Event;
 import org.ovirt.engine.ui.uicompat.EventArgs;
 import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult;
@@ -31,6 +32,7 @@
 public class MoveDiskModel extends MoveOrCopyDiskModel
 {
     protected List<String> problematicDisksForWarning = new 
ArrayList<String>();
+    private boolean isLsmBetweenMixedStorageDomainsSupportedInDC;
 
     public MoveDiskModel() {
         super();
@@ -73,14 +75,19 @@
 
     @Override
     protected void postInitStorageDomains() {
+        isLsmBetweenMixedStorageDomainsSupportedInDC = 
AsyncDataProvider.getInstance().
+                
isLsmBetweenMixedStorageDomainsSupported(getDataCenter().getCompatibilityVersion());
+
         super.postInitStorageDomains();
 
+        boolean someDomainsFiltered = false;
         // Add warning for raw/thin disks that reside on a file domain
         // and selected to be cold moved to a block domain (as it will cause
         // the disks to become preallocated, and it may consume considerably
         // more space on the target domain).
         for (final DiskModel diskModel : getDisks()) {
-            if (diskModel.isPluggedToRunningVm()) {
+            if (isFilterDestinationDomainsBySourceType(diskModel)) { // No 
need for warning for this disk domains are filtered
+                someDomainsFiltered = true;
                 continue;
             }
 
@@ -103,6 +110,11 @@
             });
             updateProblematicDisk(diskModel);
         }
+
+        if (someDomainsFiltered) {
+            
setMessage(ConstantsManager.getInstance().getConstants().liveStorageMigrationStorageFilteringNote());
+        }
+
     }
 
     private void updateProblematicDisk(DiskModel diskModel) {
@@ -161,7 +173,7 @@
 
     @Override
     protected boolean isFilterDestinationDomainsBySourceType(DiskModel model) {
-        return model.isPluggedToRunningVm();
+        return model.isPluggedToRunningVm() && 
!isLsmBetweenMixedStorageDomainsSupportedInDC;
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
index 8e4c3e9..4d7e593 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java
@@ -472,7 +472,6 @@
         if (vm.isRunningAndQualifyForDisksMigration()) {
             model.setWarningAvailable(true);
             
model.setMessage(ConstantsManager.getInstance().getConstants().liveStorageMigrationWarning());
-            
model.setMessage(ConstantsManager.getInstance().getConstants().liveStorageMigrationStorageFilteringNote());
         }
 
         
model.setTitle(ConstantsManager.getInstance().getConstants().moveDisksTitle());
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
index fe0766c..33e1f9f 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
@@ -1943,7 +1943,7 @@
     @DefaultStringValue("Moving disk(s) while the VM is running")
     String liveStorageMigrationWarning();
 
-    @DefaultStringValue("Note: Target domains are filtered by the source 
domain type (file/block)")
+    @DefaultStringValue("Note: Some target domains are filtered by the source 
domain type (file/block)")
     String liveStorageMigrationStorageFilteringNote();
 
     @DefaultStringValue("Cannot remove more than one brick from a Replicate 
volume at a time")


-- 
To view, visit https://gerrit.ovirt.org/40550
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5eaaf8209a8e7187987697baae1086a9d4311ce3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to