Jiří Moskovčák has uploaded a new change for review.

Change subject: engine: don't allow to create VM with balloon on ppc64
......................................................................

engine: don't allow to create VM with balloon on ppc64

Change-Id: Iee077b08a825e65de2cddce85bc88573e89da4ab
Bug-Url: https://bugzilla.redhat.com/1127677
Signed-off-by: Jiri Moskovcak <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.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/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
6 files changed, 29 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/32038/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
index a5e491f..4294120 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
@@ -595,6 +595,12 @@
             return false;
         }
 
+        if (isBalloonEnabled() && 
!osRepository.isBalloonEnabled(getParameters().getVmStaticData().getOsId(),
+                    getVdsGroup().getcompatibility_version())) {
+            return 
failCanDoAction(VdcBllMessages.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH,
+                    String.format("$clusterArch %1$s", 
getVdsGroup().getArchitecture()));
+        }
+
         return true;
     }
 
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
index fac5612..5210d81 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
@@ -1056,7 +1056,10 @@
 
     // Kdump detection
     KDUMP_DETECTION_NOT_ENABLED_FOR_VDS(ErrorType.BAD_PARAMETERS),
-    KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS(ErrorType.BAD_PARAMETERS);
+    KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS(ErrorType.BAD_PARAMETERS),
+
+    //balloon on ppc
+    BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH(ErrorType.NOT_SUPPORTED);
 
     private ErrorType messageType;
 
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 c5b3ff3..6c0c239 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -92,7 +92,7 @@
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
-VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
+VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host.
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.
 VDS_CANNOT_REMOVE_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Host is 
operational. Please switch Host to Maintenance mode first.
 VDS_NOT_EXIST=Cannot ${action} ${type}. Internal Error: Host does not exists 
in DB.
@@ -1167,8 +1167,8 @@
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FILTER_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement Filtering.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FUNCTION_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement score function.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_BALANCE_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement load balancing logic.
-ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_FIRST=Cannot 
${action} ${type}. Only a single filter can be selected as first. 
-ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_LAST=Cannot ${action} 
${type}. Only a single filter can be selected as last. 
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_FIRST=Cannot 
${action} ${type}. Only a single filter can be selected as first.
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_LAST=Cannot ${action} 
${type}. Only a single filter can be selected as last.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FUNCTION_FACTOR_NEGATIVE=Cannot ${action} 
${type}. Function factor cannot be negative.
 ACTION_TYPE_FAILED_CANNOT_REMOVE_POLICY_UNIT_ATTACHED_TO_CLUSTER_POLICY=Cannot 
${action} ${type}. Policy unit is attached to the following cluster policies: 
${cpNames}.
 # External Events Errors Messages
@@ -1263,3 +1263,4 @@
 KDUMP_DETECTION_NOT_ENABLED_FOR_VDS=Cannot ${action} ${type}. Kdump 
integration is not enabled for host '${VdsName}'.
 KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS=Cannot ${action} ${type}. Kdump is not 
properly configured on host '${VdsName}'.
 
+BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH=Cannot ${action} ${type}. Balloon is 
not supported on '${clusterArch}' architecture.
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 09726cb..1d26cc8 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
@@ -3369,4 +3369,7 @@
 
     @DefaultStringValue("Cannot ${action} ${type}. Target cluster belongs to 
different Data Center.")
     String VDS_CLUSTER_ON_DIFFERENT_STORAGE_POOL();
+
+    @DefaultStringValue("Cannot ${action} ${type}. Balloon is not supported on 
'${VdsName}'.")
+    String BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH();
 }
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index c0c2e96..7bd868e 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -83,7 +83,7 @@
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
-VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
+VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host.
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.
 VDS_CANNOT_REMOVE_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Host is 
operational. Please switch Host to Maintenance mode first.
 VDS_PROTOCOL_ERROR=Internal error: Host protocol error.
@@ -496,7 +496,7 @@
 ERROR_CANNOT_DESTROY_LAST_STORAGE_DOMAIN=Cannot destroy the master Storage 
Domain from the Data Center without another active Storage Domain to take its 
place.\n\
        -Either activate another Storage Domain in the Data Center, or remove 
the Data Center.\n\
        -If you have problems with the master Data Domain, consider following 
the recovery process described in the documentation, or contact your system 
administrator.
-       
+
 ERROR_CANNOT_DESTROY_LAST_STORAGE_DOMAIN_HOST_NOT_ACTIVE=In order to complete 
the operation a new master Storage Domain needs to be elected, which requires 
at least one active Host in the Data Center.\n\
                                -Please make sure one of the Hosts is active in 
the Data Center first.
 NETWORK_VLAN_OUT_OF_RANGE=VLAN ID must be a number between 0 and 4094.
@@ -514,7 +514,7 @@
 EN_UNSUPPORTED_NOTIFICATION_EVENT=The notification event ${eventName} is 
unsupported.
 EN_EVENT_UP_SUBJECT_TEXT=Alert Notification.
 EN_EVENT_DOWN_SUBJECT_TEXT=Issue Solved Notification.
-EN_ALREADY_SUBSCRIBED=User is already subscribed to this event with the same 
Notification method. 
+EN_ALREADY_SUBSCRIBED=User is already subscribed to this event with the same 
Notification method.
 EN_NOT_SUBSCRIBED=Cannot ${action} ${type}.User is not subscribed to this 
event with the given Notification method.
 ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL=Cannot ${action} ${type}. 
Storage Domain type not specified.
 ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL=Cannot ${action} ${type}. 
Storage Domain format ${storageFormat} is illegal.
@@ -1047,3 +1047,5 @@
 
 KDUMP_DETECTION_NOT_ENABLED_FOR_VDS=Cannot ${action} ${type}. Kdump 
integration is not enabled for host '${VdsName}'.
 KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS=Cannot ${action} ${type}. Kdump is not 
properly configured on host '${VdsName}'.
+
+BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH=Cannot ${action} ${type}. Balloon is 
not supported on '${clusterArch}' architecture.
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 410811f..d5d27e9 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
@@ -92,7 +92,7 @@
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
-VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
+VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host.
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.
 VDS_CANNOT_REMOVE_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Host is 
operational. Please switch Host to Maintenance mode first.
 VDS_NOT_EXIST=Cannot ${action} ${type}. Internal Error: Host does not exists 
in DB.
@@ -534,7 +534,7 @@
 ERROR_CANNOT_DESTROY_LAST_STORAGE_DOMAIN=Cannot destroy the master Storage 
Domain from the Data Center without another active Storage Domain to take its 
place.\n\
        -Either activate another Storage Domain in the Data Center, or remove 
the Data Center.\n\
        -If you have problems with the master Data Domain, consider following 
the recovery process described in the documentation, or contact your system 
administrator.
-       
+
 ERROR_CANNOT_DESTROY_LAST_STORAGE_DOMAIN_HOST_NOT_ACTIVE=In order to complete 
the operation a new master Storage Domain needs to be elected, which requires 
at least one active Host in the Data Center.\n\
                                -Please make sure one of the Hosts is active in 
the Data Center first.
 NETWORK_VLAN_OUT_OF_RANGE=VLAN ID must be a number between 0 and 4094.
@@ -554,7 +554,7 @@
 EN_UNSUPPORTED_NOTIFICATION_EVENT=The notification event ${eventName} is 
unsupported.
 EN_EVENT_UP_SUBJECT_TEXT=Alert Notification.
 EN_EVENT_DOWN_SUBJECT_TEXT=Issue Solved Notification.
-EN_ALREADY_SUBSCRIBED=User is already subscribed to this event with the same 
Notification method. 
+EN_ALREADY_SUBSCRIBED=User is already subscribed to this event with the same 
Notification method.
 EN_NOT_SUBSCRIBED=Cannot ${action} ${type}.User is not subscribed to this 
event with the given Notification method.
 ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL=Cannot ${action} ${type}. 
Storage Domain type not specified.
 ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL=Cannot ${action} ${type}. 
Storage Domain format ${storageFormat} is illegal.
@@ -1139,8 +1139,8 @@
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FILTER_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement Filtering.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FUNCTION_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement score function.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_BALANCE_NOT_IMPLEMENTED=Cannot ${action} 
${type}. Policy unit doesn't implement load balancing logic.
-ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_FIRST=Cannot 
${action} ${type}. Only a single filter can be selected as first. 
-ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_LAST=Cannot ${action} 
${type}. Only a single filter can be selected as last. 
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_FIRST=Cannot 
${action} ${type}. Only a single filter can be selected as first.
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ONLY_ONE_FILTER_CAN_BE_LAST=Cannot ${action} 
${type}. Only a single filter can be selected as last.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_FUNCTION_FACTOR_NEGATIVE=Cannot ${action} 
${type}. Function factor cannot be negative.
 ACTION_TYPE_FAILED_CANNOT_REMOVE_POLICY_UNIT_ATTACHED_TO_CLUSTER_POLICY=Cannot 
${action} ${type}. Policy unit is attached to the following cluster policies: 
${cpNames}.
 # External Events Errors Messages
@@ -1228,3 +1228,5 @@
 
 KDUMP_DETECTION_NOT_ENABLED_FOR_VDS=Cannot ${action} ${type}. Kdump 
integration is not enabled for host '${VdsName}'.
 KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS=Cannot ${action} ${type}. Kdump is not 
properly configured on host '${VdsName}'.
+
+BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH=Cannot ${action} ${type}. Balloon is 
not supported on '${clusterArch}' architecture.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee077b08a825e65de2cddce85bc88573e89da4ab
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Jiří Moskovčák <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to