Lior Vernia has uploaded a new change for review.

Change subject: engine: Block moving host with QoS to older cluster
......................................................................

engine: Block moving host with QoS to older cluster

This patch blocks the possibility of moving a host from a cluster that
supports Host Network QoS to one that doesn't, if any of the host's
network interfaces have any QoS capping on them.

Change-Id: I697617fcb943590f2437add7591a81a0b3a0cf3b
Bug-Url: https://bugzilla.redhat.com/1054322
Signed-off-by: Lior Vernia <lver...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
4 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/23405/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
index 3ff94c0..6cf5080 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
@@ -14,6 +14,7 @@
 import org.ovirt.engine.core.bll.utils.GlusterUtil;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.AuditLogType;
+import org.ovirt.engine.core.common.FeatureSupported;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.ChangeVDSClusterParameters;
 import org.ovirt.engine.core.common.action.SetupNetworksParameters;
@@ -121,6 +122,17 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_CLUSTER_DIFFERENT_ARCHITECTURES);
         }
 
+        if 
(FeatureSupported.hostNetworkQos(getSourceCluster().getcompatibility_version())
+                && 
!FeatureSupported.hostNetworkQos(getTargetCluster().getcompatibility_version()))
 {
+            for (VdsNetworkInterface iface : 
getDbFacade().getInterfaceDao().getAllInterfacesForVds(vds.getId())) {
+                if (iface.getQos() != null) {
+                    return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED,
+                            
String.format("$ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST %s",
+                                    iface.getNetworkName()));
+                }
+            }
+        }
+
         return true;
     }
 
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 427b174..b72a749 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -889,7 +889,7 @@
 UNLINKING_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Link state is set to 
'Down' on the virtual machine's interface, this is not supported for clusters 
of version ${clusterVersion}.
 NULL_NETWORK_IS_NOT_SUPPORTED=Cannot ${action} ${type}. There is no network on 
the virtual machine's interface, this is not supported for clusters of version 
${clusterVersion}.
 ACTION_TYPE_FAILED_NETWORK_QOS_IS_NOT_SUPPORTED=Cannot ${action} ${type}. 
There is Network QoS on the profile, this is not supported for clusters of 
version ${clusterVersion}.
-ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED=Cannot ${action} ${type}. 
Host Network QoS is not supported in this host's cluster compatibility version, 
but QoS was configured on the following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.
+ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED=Cannot ${action} ${type}. 
Host Network QoS is not supported in the cluster's compatibility version, but 
QoS was configured on the following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.
 HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Updating 
the virtual machine interface while the virtual machine is running is not 
supported for clusters of version ${clusterVersion}.
 ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS=Cannot ${action} 
${type}. The network interface type is not compatible with the selected 
operating system.
 CANNOT_PERFORM_HOT_UPDATE=Cannot ${action} ${type}. Updating some of the 
properties is not supported while the interface is plugged into a running 
virtual machine. Please un-plug the interface, update the properties, and then 
plug it back.
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index 7a22338..7e1557b 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -2410,7 +2410,7 @@
     @DefaultStringValue("Cannot ${action} ${type}. There is Network QoS on the 
profile, this is not supported for clusters of version ${clusterVersion}.")
     String ACTION_TYPE_FAILED_NETWORK_QOS_IS_NOT_SUPPORTED();
 
-    @DefaultStringValue("Cannot ${action} ${type}. Host Network QoS is not 
supported in this host's cluster compatibility version, but QoS was configured 
on the following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.")
+    @DefaultStringValue("Cannot ${action} ${type}. Host Network QoS is not 
supported in the cluster's compatibility version, but QoS was configured on the 
following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.")
     String ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED();
 
     @DefaultStringValue("Cannot ${action} ${type}. Updating the virtual 
machine interface while the virtual machine is running is not supported for 
clusters of version ${clusterVersion}.")
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index fe488f2..205b0fa 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -890,7 +890,7 @@
 UNLINKING_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Link state is set to 
'Down' on the virtual machine's interface, this is not supported for clusters 
of version ${clusterVersion}.
 NULL_NETWORK_IS_NOT_SUPPORTED=Cannot ${action} ${type}. There is no network on 
the virtual machine's interface, this is not supported for clusters of version 
${clusterVersion}.
 ACTION_TYPE_FAILED_NETWORK_QOS_IS_NOT_SUPPORTED=Cannot ${action} ${type}. 
There is Network QoS on the profile, this is not supported for clusters of 
version ${clusterVersion}.
-ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED=Cannot ${action} ${type}. 
Host Network QoS is not supported in this host's cluster compatibility version, 
but QoS was configured on the following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.
+ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED=Cannot ${action} ${type}. 
Host Network QoS is not supported in the cluster's compatibility version, but 
QoS was configured on the following network(s): 
${ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST}.
 HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Updating 
the virtual machine interface while the virtual machine is running is not 
supported for clusters of version ${clusterVersion}.
 ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS=Cannot ${action} 
${type}. The network interface type is not compatible with the selected 
operating system.
 CANNOT_PERFORM_HOT_UPDATE=Cannot ${action} ${type}. Updating some of the 
properties is not supported while the interface is plugged into a running 
virtual machine. Please un-plug the interface, update the properties, and then 
plug it back.


-- 
To view, visit http://gerrit.ovirt.org/23405
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I697617fcb943590f2437add7591a81a0b3a0cf3b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to