Leonardo Bianconi has uploaded a new change for review.

Change subject: core, webadmin, engine: Added architecture support for VM and 
Template
......................................................................

core, webadmin, engine: Added architecture support for VM and Template

This change introduces the architecture support for VM and Template,
validating and filtering data.

New validation added on commands:
* Check if template has the same architecture of the selected cluster
  when adding VMs and pools
* Check if the selected cluster has blank processor name when updating
  and adding VMs, templates and pools
* Check compatibility of cluster architecture when editing host and VMs
* When migrating VMs the destination host must have the same
  architecture of the cluster
* Do not allow VMs to change their clusters if the destination cluster
  has a different architecture

Change-Id: Ia877dd2d13525de6693883e43d0ca786f77f9310
Signed-off-by: Leonardo Bianconi <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.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
16 files changed, 126 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/18227/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 ce3499b..897b6cf 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
@@ -335,6 +335,10 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_IS_DISABLED);
         }
 
+        if (StringUtils.isEmpty(getVdsGroup().getcpu_name())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME);
+        }
+
         if (!buildAndCheckDestStorageDomains()) {
             return false;
         }
@@ -348,6 +352,16 @@
         }
 
         VM vmFromParams = getParameters().getVm();
+
+        if (getVmTemplate() != null) {
+            // check if the template comes from the same architecture that is 
used by the cluster
+
+            if 
(!getVmTemplate().getId().equals(VmTemplateHandler.BlankVmTemplateId)
+                    && 
!getVdsGroup().getArchitectureType().equals(getVmTemplate().getArchitecture())) 
{
+                
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE);
+                return false;
+            }
+        }
 
         if (StringUtils.isEmpty(vmFromParams.getName())) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY);
@@ -674,8 +688,7 @@
         // predefined and user defined fields
         if (vmStatic.getCustomProperties() != null) {
             VMCustomProperties properties =
-                    
VmPropertiesUtils.getInstance().parseProperties(getVdsGroupDAO()
-                            .get(getParameters().getVm().getVdsGroupId())
+                    VmPropertiesUtils.getInstance().parseProperties(vdsGroup
                             .getcompatibility_version(),
                             vmStatic.getCustomProperties());
             String predefinedProperties = properties.getPredefinedProperties();
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
index 146335b..445edc60 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
@@ -252,6 +252,10 @@
             addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
             return false;
         }
+
+        if (StringUtils.isEmpty(getVdsGroup().getcpu_name())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME);
+        }
         if 
(!VmHandler.isMemorySizeLegal(getParameters().getMasterVm().getOsId(),
                 getParameters().getMasterVm().getMemSizeMb(),
                 getReturnValue().getCanDoActionMessages(), 
getVdsGroup().getcompatibility_version())) {
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
index 54d6e6b..383d6a2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
@@ -4,6 +4,7 @@
 import java.util.List;
 
 import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.network.cluster.NetworkHelper;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.bll.validator.VmNicValidator;
@@ -77,6 +78,14 @@
                 if (!VmHandler.isUsbPolicyLegal(vm.getUsbPolicy(), vm.getOs(), 
targetCluster, getReturnValue().getCanDoActionMessages())) {
                     return false;
                 }
+
+                if (StringUtils.isNotEmpty(targetCluster.getcpu_name()))
+                {
+                    if (!targetCluster.getArchitectureType().equals(
+                            vm.getArchitecture())) {
+                        return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES);
+                    }
+                }
             } else {
                 
addCanDoActionMessage(VdcBllMessages.VM_STATUS_NOT_VALID_FOR_UPDATE);
                 return false;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
index e0efb8a..8945409 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
@@ -5,6 +5,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.bll.job.ExecutionContext;
 import org.ovirt.engine.core.bll.job.ExecutionHandler;
@@ -189,6 +190,10 @@
             return false;
         }
 
+        if (StringUtils.isEmpty(grp.getcpu_name())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME);
+        }
+
         if (!isMemorySizeLegal(grp.getcompatibility_version())) {
             return false;
         }
@@ -202,6 +207,11 @@
         }
         setStoragePoolId(grp.getStoragePoolId());
 
+        if 
(!grp.getArchitectureType().equals(getParameters().getVmStaticData().getArchitecture()))
 {
+            
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE);
+            return false;
+        }
+
         if (getStoragePool() == null || getStoragePool().getstatus() != 
StoragePoolStatus.Up) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND);
         }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
index 6b6774d..653588c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
@@ -274,6 +274,17 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL);
         }
 
+        VDS vds = getDestinationVds();
+
+        if (vds.getCpuName() == null) {
+            
vds.setCpuName(CpuFlagsManagerHandler.FindMaxServerCpuByFlags(vds.getCpuFlags(),
+                    vds.getVdsGroupCompatibilityVersion()));
+        }
+
+        if (!vm.getArchitecture().equals(vds.getCpuName().getArchitecture())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_DIFFERENT_ARCHITECTURES);
+        }
+
         return validate(new 
SnapshotsValidator().vmNotDuringSnapshot(vm.getId()))
                 // This check was added to prevent migration of VM while its 
disks are being migrated
                 // TODO: replace it with a better solution
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
index bc17e60..09c6637 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
@@ -219,6 +219,10 @@
         VM vmFromDB = getVm();
         VM vmFromParams = getParameters().getVm();
 
+        if (StringUtils.isEmpty(getVdsGroup().getcpu_name())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME);
+        }
+
         if (!isVmExist()) {
             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST);
             return false;
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
index e192aea..82bb600 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
@@ -59,6 +59,10 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST);
         }
 
+        if (StringUtils.isEmpty(getVdsGroup().getcpu_name())) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME);
+        }
+
         VmTemplateHandler.UpdateDisksFromDb(mOldTemplate);
         if (mOldTemplate.getStatus() == VmTemplateStatus.Locked) {
             return failCanDoAction(VdcBllMessages.VM_TEMPLATE_IS_LOCKED);
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
index 35723d1..d7290d7 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
@@ -32,12 +32,14 @@
 import org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters;
 import org.ovirt.engine.core.common.action.AddVmFromTemplateParameters;
 import org.ovirt.engine.core.common.action.VmManagementParametersBase;
+import org.ovirt.engine.core.common.businessentities.ArchitectureType;
 import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.DiskImageBase;
 import org.ovirt.engine.core.common.businessentities.Snapshot;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
+import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VM;
 import org.ovirt.engine.core.common.businessentities.VmDynamic;
 import org.ovirt.engine.core.common.businessentities.VmStatic;
@@ -69,6 +71,7 @@
     private static final Guid STORAGE_POOL_ID = Guid.newGuid();
     private static final Guid STORAGE_DOMAIN_ID = Guid.newGuid();
     private VmTemplate vmTemplate = null;
+    private VDSGroup vdsGroup = null;
 
     @Rule
     public MockConfigRule mcr = new MockConfigRule();
@@ -103,6 +106,7 @@
         AddVmFromTemplateCommand<AddVmFromTemplateParameters> cmd = 
createVmFromTemplateCommand(vm);
 
         mockStorageDomainDAOGetForStoragePool();
+        mockVdsGroupDAOReturnVdsGroup();
         mockVmTemplateDAOReturnVmTemplate();
         mockDiskImageDAOGetSnapshotById();
         mockGetImageDomainsListVdsCommand();
@@ -379,6 +383,22 @@
         when(vmTemplateDAO.get(Matchers.<Guid> 
any(Guid.class))).thenReturn(createVmTemplate());
     }
 
+    private void mockVdsGroupDAOReturnVdsGroup() {
+        when(vdsGroupDao.get(Matchers.<Guid> 
any(Guid.class))).thenReturn(createVdsGroup());
+    }
+
+    private VDSGroup createVdsGroup() {
+        if (vdsGroup == null) {
+            vdsGroup = new VDSGroup();
+            vdsGroup.setvds_group_id(Guid.newGuid());
+            vdsGroup.setcompatibility_version(new Version());
+            vdsGroup.setcpu_name("Intel Conroe Family");
+            vdsGroup.setArchitectureType(ArchitectureType.x86_64);
+        }
+
+        return vdsGroup;
+    }
+
     private VmTemplate createVmTemplate() {
         if (vmTemplate == null) {
             vmTemplate = new VmTemplate();
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
index eaa2da6..cec4b9c 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
@@ -12,6 +12,7 @@
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.ovirt.engine.core.common.action.AddVmTemplateParameters;
+import org.ovirt.engine.core.common.businessentities.ArchitectureType;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VM;
 import org.ovirt.engine.core.common.businessentities.VMStatus;
@@ -60,6 +61,8 @@
 
         // The cluster to use
         vdsGroup = new VDSGroup();
+        vdsGroup.setcpu_name("Intel Conroe Family");
+        vdsGroup.setArchitectureType(ArchitectureType.x86_64);
         vdsGroup.setId(vdsGroupId);
         vdsGroup.setStoragePoolId(spId);
         vdsGroup.setcompatibility_version(Version.v3_2);
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
index 575074c..6e492c9 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
@@ -19,6 +19,7 @@
 import org.mockito.MockitoAnnotations;
 import org.ovirt.engine.core.bll.interfaces.BackendInternal;
 import org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters;
+import org.ovirt.engine.core.common.businessentities.ArchitectureType;
 import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
@@ -251,6 +252,8 @@
         group.setvds_group_id(vdsGroupId);
         group.setcompatibility_version(new Version());
         group.setStoragePoolId(storagePoolId);
+        group.setcpu_name("Intel Conroe Family");
+        group.setArchitectureType(ArchitectureType.x86_64);
         return group;
     }
 
@@ -261,6 +264,7 @@
         VmTemplate template = new VmTemplate();
         template.setId(vmTemplateId);
         template.setStoragePoolId(storagePoolId);
+        template.setArchitecture(ArchitectureType.x86_64);
         setDiskList(template);
 
         return template;
@@ -320,6 +324,7 @@
         vmStatic.setMemSizeMb(300);
         vmStatic.setStateless(false);
         vmStatic.setVmtGuid(vmTemplateId);
+        vmStatic.setArchitecture(ArchitectureType.x86_64);
         return vmStatic;
     }
 
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
index c7aae29..cf598e3 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
@@ -21,6 +21,7 @@
 import org.mockito.runners.MockitoJUnitRunner;
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VmManagementParametersBase;
+import org.ovirt.engine.core.common.businessentities.ArchitectureType;
 import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -79,11 +80,15 @@
         vm = new VM();
         vmStatic = new VmStatic();
         group = new VDSGroup();
+        group.setcpu_name("Intel Conroe Family");
         group.setId(Guid.newGuid());
         group.setcompatibility_version(Version.v3_0);
+        group.setArchitectureType(ArchitectureType.x86_64);
 
         vm.setVdsGroupId(group.getId());
+        vm.setArchitecture(ArchitectureType.x86_64);
         vmStatic.setVdsGroupId(group.getId());
+        vmStatic.setArchitecture(ArchitectureType.x86_64);
 
         SimpleDependecyInjector.getInstance().bind(OsRepository.class, 
osRepository);
         when(osRepository.getMinimumRam(0, Version.v3_0)).thenReturn(0);
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 276e24f..db38f5b 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
@@ -131,6 +131,7 @@
     ACTION_TYPE_FAILED_VM_RUNNING_STATELESS(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER(ErrorType.DATA_CORRUPTION),
     ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER(ErrorType.CONFLICT),
+    
ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_DELETE_PROTECTION_ENABLED(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_EXCEEDED_MAX_PCI_SLOTS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_EXCEEDED_MAX_IDE_SLOTS(ErrorType.CONFLICT),
@@ -152,6 +153,7 @@
     
ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST(ErrorType.CONFLICT),
+    ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_VDS_VM_CLUSTER(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_VDS_VM_MEMORY(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_VDS_VM_VERSION(ErrorType.INCOMPATIBLE_VERSION),
@@ -207,6 +209,8 @@
     CANNOT_MAINTENANCE_VDS_RUN_VMS_NO_OTHER_RUNNING_VDS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY(ErrorType.BAD_PARAMETERS),
+    
ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE(ErrorType.BAD_PARAMETERS),
+    
ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_INVALID_VDS_HOSTNAME(ErrorType.BAD_PARAMETERS),
     
ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_HOSNAME_CANNOT_CHANGE(ErrorType.BAD_PARAMETERS),
@@ -220,6 +224,7 @@
     ACTION_TYPE_FAILED_DETECTED_PINNED_VMS(ErrorType.CONFLICT),
     VDS_CANNOT_REMOVE_VDS_STATUS_ILLEGAL(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL(ErrorType.CONFLICT),
+    
ACTION_TYPE_FAILED_VDS_VM_DIFFERENT_ARCHITECTURES(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_MIGRATE_BETWEEN_TWO_CLUSTERS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_VDS_INTERMITENT_CONNECTIVITY(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_MOM_UPDATE_VDS_VERSION(ErrorType.INCOMPATIBLE_VERSION),
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 47cb478..ffd6361 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -131,6 +131,7 @@
 VMT_CANNOT_UPDATE_ILLEGAL_FIELD=Failed updating the properties of the VM 
template.
 DIRECTORY_GROUP_CANNOT_REMOVE_DIRECTORY_GROUP_ATTACHED_TO_VM=Cannot remove 
Directory Group. Detach Directory Group from VM first.
 VM_NOT_FOUND=VM not found
+ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME=Cannot ${action} ${type}. The 
cluster has an empty processor name.
 ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS=Cannot ${action} ${type}. 
One or more provided storage domains are in maintenance/non-operational status.
 ACTION_TYPE_FAILED_STOARGE_DOMAIN_IS_WRONG=Cannot ${action} ${type}. Provided 
wrong storage domain, which is not related to disk.
 ACTION_TYPE_FAILED_VM_IN_PREVIEW=Cannot ${action} ${type}. VM is previewing a 
Snapshot.
@@ -530,6 +531,8 @@
 ACTION_LIST_CANNOT_BE_EMPTY=Actions list cannot be empty.
 ACTION_TYPE_FAILED_BOOKMARK_INVALID_ID=Cannot ${action} ${type}. Bookmark ID 
is not valid.
 ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Operation can 
be performed only when Host status is ${hostStatus}.
+ACTION_TYPE_FAILED_VDS_VM_DIFFERENT_ARCHITECTURES=Cannot ${action} ${type}. 
The source and destination architectures do not match.
+ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES=Cannot ${action} 
${type}. The VM and the destination cluster architectures do not match. 
 ACTION_TYPE_FAILED_MIGRATE_BETWEEN_TWO_CLUSTERS=Cannot ${action} ${type}. VM 
can be migrated only between Hosts in the same Cluster.\n\
        -Please select target Host in the same Cluster to run the VM.
 VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE=Cannot get Host version when Host 
is in Non Responsive status.
@@ -718,6 +721,8 @@
 
ACTION_TYPE_FAILED_LINUX_BOOT_PARAMS_MAY_NOT_CONTAIN_TRIMMING_WHITESPACES=Cannot
 ${action} ${type}. Linux boot parameters contain trimming whitespace 
characters.
 ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG=Cannot ${action} ${type}. The given 
name is too long.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY=Can not ${action} ${type}. The given 
name is empty.
+ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} 
${type}. The selected template is not compatible with pool architecture.
+ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} ${type}. 
The selected template is not compatible with VM architecture.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Can not ${action} 
${type}. The given name contains special characters. Only lower-case and 
upper-case letters, numbers, '_', '-', '.' are allowed.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS_OR_DASH=Can not 
${action} ${type}. The given name contains special characters. Only lower-case 
and upper-case letters, numbers, '_', allowed.
 ACTION_TYPE_FAILED_INVALID_VDS_HOSTNAME=Can not ${action} ${type}. The given 
Host name is invalid. Only Host names corresponding to RFC-952 and RFC-1123 are 
allowed.
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 6f30ea8..60efeff 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
@@ -160,6 +160,12 @@
     @DefaultStringValue("Cannot switch Host to Maintenance mode. Host is 
already in Maintenance mode.")
     String VDS_CANNOT_MAINTENANCE_VDS_IS_IN_MAINTENANCE();
 
+    @DefaultStringValue("Cannot ${action} ${type}. The VM and the destination 
cluster architectures do not match.")
+    String ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES();
+
+    @DefaultStringValue("The host and destination cluster architectures do not 
match.")
+    String ACTION_TYPE_FAILED_VDS_CLUSTER_DIFFERENT_ARCHITECTURES();
+
     @DefaultStringValue("Cannot switch Host to Maintenance mode. Host has 
asynchronous running tasks,\nwait for operation to complete and retry.")
     String VDS_CANNOT_MAINTENANCE_SPM_WITH_RUNNING_TASKS();
 
@@ -259,6 +265,7 @@
     @DefaultStringValue("Cannot fence Host, Host fence is disabled.")
     String VDS_FENCE_DISABLED();
 
+
     @DefaultStringValue("Fence is disabled due to the Engine Service start up 
sequence.")
     String VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL();
 
@@ -345,6 +352,9 @@
 
     @DefaultStringValue("Cannot ${action} ${type}. The following disks already 
exist: ${diskAliases}. Please import as a clone.")
     String ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST();
+
+    @DefaultStringValue("Cannot ${action} ${type}. The cluster has an empty 
processor name.")
+    String ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME();
 
     @DefaultStringValue("Cannot ${action} ${type}: VM is locked. Please try 
again in a few minutes.")
     String ACTION_TYPE_FAILED_VM_IS_LOCKED();
@@ -1933,6 +1943,12 @@
     @DefaultStringValue("Can not ${action} ${type}. The given name is empty.")
     String ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY();
 
+    @DefaultStringValue("Can not ${action} ${type}. The selected template is 
not compatible with pool architecture.")
+    String ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE();
+
+    @DefaultStringValue("Can not ${action} ${type}. The selected template is 
not compatible with VM architecture.")
+    String ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE();
+
     @DefaultStringValue("Can not ${action} ${type}. The given name contains 
special characters. Only lower-case and upper-case letters, numbers, '_', '-', 
'.' are allowed.")
     String ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS();
 
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 8adafcf..5918eee 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
@@ -126,6 +126,7 @@
 VMT_CANNOT_UPDATE_ILLEGAL_FIELD=Failed updating the properties of the VM 
template.
 DIRECTORY_GROUP_CANNOT_REMOVE_DIRECTORY_GROUP_ATTACHED_TO_VM=Cannot remove 
Directory Group. Detach Directory Group from VM first.
 VM_NOT_FOUND=VM not found
+ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME=Cannot ${action} ${type}. The 
cluster has an empty processor name.
 ACTION_TYPE_FAILED_VM_IN_PREVIEW=Cannot ${action} ${type}. VM is previewing a 
Snapshot.
 ACTION_TYPE_FAILED_DISKS_LOCKED=Cannot ${action} ${type}: The following disks 
are locked: ${diskAliases}. Please try again in a few minutes.
 ACTION_TYPE_FAILED_DISKS_ILLEGAL=Cannot ${action} ${type}. The following 
attached disks are in ILLEGAL status: ${diskAliases} - please remove them and 
try again.
@@ -517,6 +518,8 @@
 ACTION_LIST_CANNOT_BE_EMPTY=Actions list cannot be empty.
 ACTION_TYPE_FAILED_BOOKMARK_INVALID_ID=Cannot ${action} ${type}. Bookmark ID 
is not valid.
 ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Operation can 
be performed only when Host status is ${hostStatus}.
+ACTION_TYPE_FAILED_VDS_VM_DIFFERENT_ARCHITECTURES=Cannot ${action} ${type}. 
The source and destination architectures do not match.
+ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES=Cannot ${action} 
${type}. The VM and the destination cluster architectures do not match.
 ACTION_TYPE_FAILED_MIGRATE_BETWEEN_TWO_CLUSTERS=Cannot ${action} ${type}. VM 
can be migrated only between Hosts in the same Cluster.\n\
        -Please select target Host in the same Cluster to run the VM.
 VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE=Cannot get Host version when Host 
is in Non Responsive status.
@@ -699,6 +702,8 @@
 
ACTION_TYPE_FAILED_LINUX_BOOT_PARAMS_MAY_NOT_CONTAIN_TRIMMING_WHITESPACES=Cannot
 ${action} ${type}. Linux boot parameters contain trimming whitespace 
characters.
 ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG=Cannot ${action} ${type}. The given 
name is too long.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY=Can not ${action} ${type}. The given 
name is empty.
+ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} 
${type}. The selected template is not compatible with pool architecture.
+ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} ${type}. 
The selected template is not compatible with VM architecture.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Can not ${action} 
${type}. The given name contains special characters. Only lower-case and 
upper-case letters, numbers, '_', '-', '.' are allowed.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS_OR_DASH=Can not 
${action} ${type}. The given name contains special characters. Only lower-case 
and upper-case letters, numbers, '_', allowed.
 ACTION_TYPE_FAILED_INVALID_POOL_NAME=Can not ${action} ${type}. The given name 
is invalid for pool name. Only lower-case and upper-case letters, numbers, '_', 
'-', '.', and one mask sequence are allowed.
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 c60e334..9fefa47 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
@@ -130,6 +130,7 @@
 VMT_CANNOT_UPDATE_ILLEGAL_FIELD=Failed updating the properties of the VM 
template.
 DIRECTORY_GROUP_CANNOT_REMOVE_DIRECTORY_GROUP_ATTACHED_TO_VM=Cannot remove 
Directory Group. Detach Directory Group from VM first.
 VM_NOT_FOUND=VM not found
+ACTION_TYPE_FAILED_CLUSTER_EMPTY_PROCESSOR_NAME=Cannot ${action} ${type}. The 
cluster has an empty processor name.
 ACTION_TYPE_FAILED_VM_IN_PREVIEW=Cannot ${action} ${type}. VM is previewing a 
Snapshot.
 ACTION_TYPE_FAILED_DISKS_LOCKED=Cannot ${action} ${type}: The following disks 
are locked: ${diskAliases}. Please try again in a few minutes.
 ACTION_TYPE_FAILED_DISKS_ILLEGAL=Cannot ${action} ${type}. The following 
attached disks are in ILLEGAL status: ${diskAliases} - please remove them and 
try again.
@@ -534,6 +535,8 @@
 ACTION_LIST_CANNOT_BE_EMPTY=Actions list cannot be empty.
 ACTION_TYPE_FAILED_BOOKMARK_INVALID_ID=Cannot ${action} ${type}. Bookmark ID 
is not valid.
 ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL=Cannot ${action} ${type}. Operation can 
be performed only when Host status is ${hostStatus}.
+ACTION_TYPE_FAILED_VDS_VM_DIFFERENT_ARCHITECTURES=Cannot ${action} ${type}. 
The source and destination architectures do not match.
+ACTION_TYPE_FAILED_VM_CLUSTER_DIFFERENT_ARCHITECTURES=Cannot ${action} 
${type}. The VM and the destination cluster architectures do not match.
 ACTION_TYPE_FAILED_MIGRATE_BETWEEN_TWO_CLUSTERS=Cannot ${action} ${type}. VM 
can be migrated only between Hosts in the same Cluster.\n\
        -Please select target Host in the same Cluster to run the VM.
 VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE=Cannot get Host version when Host 
is in Non Responsive status.
@@ -719,6 +722,8 @@
 
ACTION_TYPE_FAILED_LINUX_BOOT_PARAMS_MAY_NOT_CONTAIN_TRIMMING_WHITESPACES=Cannot
 ${action} ${type}. Linux boot parameters contain trimming whitespace 
characters.
 ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG=Cannot ${action} ${type}. The given 
name is too long.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY=Can not ${action} ${type}. The given 
name is empty.
+ACTION_TYPE_FAILED_POOL_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} 
${type}. The selected template is not compatible with pool architecture.
+ACTION_TYPE_FAILED_VM_AND_TEMPLATE_ARE_INCOMPATIBLE=Can not ${action} ${type}. 
The selected template is not compatible with VM architecture.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Can not ${action} 
${type}. The given name contains special characters. Only lower-case and 
upper-case letters, numbers, '_', '-', '.' are allowed.
 ACTION_TYPE_FAILED_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS_OR_DASH=Can not 
${action} ${type}. The given name contains special characters. Only lower-case 
and upper-case letters, numbers, '_', allowed.
 ACTION_TYPE_FAILED_INVALID_POOL_NAME=Can not ${action} ${type}. The given name 
is invalid for pool name. Only lower-case and upper-case letters, numbers, '_', 
'-', '.', and one mask sequence are allowed.


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

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

Reply via email to