Eldan Shachar has uploaded a new change for review.

Change subject: core: Cluster parameters override - backend
......................................................................

core: Cluster parameters override - backend

This feature allows to configure the 'emulated machine' and 'cpu model' 
parameters for each VM separately instead of relying on the cluster default.

Change-Id: I04423e9847fbf98fb62c55c08a16c73108e7354c
Bug-Url: https://bugzilla.redhat.com/838487
Feature-page: http://www.ovirt.org/Features/Cluster_parameters_override
Signed-off-by: Eldan Shachar <[email protected]>
---
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/scheduling/PolicyUnitImpl.java
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EmulatedMachineFilterPolicyUnit.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmManagementParametersBase.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitiesDefinitions.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/InstanceType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
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
M packaging/dbscripts/create_views.sql
A packaging/dbscripts/upgrade/03_06_0070_add_emulated_machine_to_vm.sql
A packaging/dbscripts/upgrade/03_06_0080_add_emulated_machine_policy_unit.sql
M packaging/dbscripts/vm_templates_sp.sql
M packaging/dbscripts/vms_sp.sql
24 files changed, 170 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/31580/1

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 e1a50f9..9981878 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
@@ -553,7 +553,8 @@
                         getParameters().getMasterVm().getCustomSerialNumber(),
                         getParameters().getMasterVm().isBootMenuEnabled(),
                         
getParameters().getMasterVm().isSpiceFileTransferEnabled(),
-                        
getParameters().getMasterVm().isSpiceCopyPasteEnabled()));
+                        
getParameters().getMasterVm().isSpiceCopyPasteEnabled(),
+                        getParameters().getMasterVm().getEmulatedMachine()));
         DbFacade.getInstance().getVmTemplateDao().save(getVmTemplate());
         getCompensationContext().snapshotNewEntity(getVmTemplate());
         setActionReturnValue(getVmTemplate().getId());
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
index aa827df..7d907e9 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/PolicyUnitImpl.java
@@ -7,6 +7,7 @@
 import org.apache.commons.lang.NotImplementedException;
 import org.ovirt.engine.core.bll.scheduling.policyunits.CPUPolicyUnit;
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.CpuLevelFilterPolicyUnit;
+import 
org.ovirt.engine.core.bll.scheduling.policyunits.EmulatedMachineFilterPolicyUnit;
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit;
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnit;
 import 
org.ovirt.engine.core.bll.scheduling.policyunits.EvenGuestDistributionBalancePolicyUnit;
@@ -105,6 +106,8 @@
             } else if (policyUnit.getPolicyUnitType() == 
PolicyUnitType.WEIGHT) {
                 return new VmAffinityWeightPolicyUnit(policyUnit);
             }
+            case "Emulated-Machine":
+                return new EmulatedMachineFilterPolicyUnit(policyUnit);
         default:
             break;
         }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EmulatedMachineFilterPolicyUnit.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EmulatedMachineFilterPolicyUnit.java
new file mode 100644
index 0000000..a72f2c0
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EmulatedMachineFilterPolicyUnit.java
@@ -0,0 +1,49 @@
+package org.ovirt.engine.core.bll.scheduling.policyunits;
+
+import org.apache.commons.lang.StringUtils;
+import org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl;
+import org.ovirt.engine.core.common.businessentities.VDS;
+import org.ovirt.engine.core.common.businessentities.VM;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+import org.ovirt.engine.core.common.scheduling.PerHostMessages;
+import org.ovirt.engine.core.common.scheduling.PolicyUnit;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+public class EmulatedMachineFilterPolicyUnit extends PolicyUnitImpl {
+    public EmulatedMachineFilterPolicyUnit(PolicyUnit policyUnit) {
+        super(policyUnit);
+    }
+
+    @Override
+    public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> 
parameters,
+                            PerHostMessages messages) {
+        boolean filteredOutHosts = false;
+        String requiredEmulatedMachine = vm.getEmulatedMachine();
+        if (StringUtils.isNotEmpty(requiredEmulatedMachine)) { // if we use 
cluster default than we're safe
+            List<VDS> hostsToRunOn = new ArrayList<VDS>();
+            for (VDS host : hosts) {
+                String supportedEmulatedMachines = 
host.getSupportedEmulatedMachines();
+                if 
(Arrays.asList(supportedEmulatedMachines.split(",")).contains(requiredEmulatedMachine))
 {
+                    hostsToRunOn.add(host);
+                    log.debugFormat("Host {0} wasn't filtered out as it 
supports the VM required emulated machine ({1})",
+                            host.getName(),
+                            requiredEmulatedMachine);
+                } else {
+                    log.debugFormat("Host {0} was filtered out as it doesn't 
support the VM required emulated machine ({1})",
+                            host.getName(),
+                            requiredEmulatedMachine);
+                    messages.addMessage(host.getId(), 
String.format("$vmEmulatedMachine %1$s", requiredEmulatedMachine));
+                    messages.addMessage(host.getId(), 
VdcBllMessages.VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE.toString());
+                }
+            }
+
+            return hostsToRunOn;
+        } else {
+            return hosts;
+        }
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmManagementParametersBase.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmManagementParametersBase.java
index f5f14e85..dab157a 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmManagementParametersBase.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmManagementParametersBase.java
@@ -32,6 +32,7 @@
     private VmRngDevice rngDevice;
     private boolean copyTemplatePermissions;
     private boolean applyChangesLater;
+    private String emulatedMachine;
 
     /*
      * This parameter is needed at update to make sure that when we get a null 
watchdog from rest-api it is not meant to
@@ -239,4 +240,12 @@
     public void setApplyChangesLater(boolean applyChangesLater) {
         this.applyChangesLater = applyChangesLater;
     }
+
+    public String getEmulatedMachine() {
+        return emulatedMachine;
+    }
+
+    public void setEmulatedMachine(String emulatedMachine) {
+        this.emulatedMachine = emulatedMachine;
+    }
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitiesDefinitions.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitiesDefinitions.java
index ff6d14d..648a2c5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitiesDefinitions.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntitiesDefinitions.java
@@ -12,6 +12,7 @@
     // VM (vm_statis)
     public static final int VM_NAME_SIZE = 255;
     public static final int VM_DESCRIPTION_SIZE = 255;
+    public static final int EMULATED_MACHINE_SIZE = 30;
     public static final int VM_SERIAL_NUMBER_SIZE = 255;
 
     // VM Pools (vm_pools)
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/InstanceType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/InstanceType.java
index c5141e1..9f6cc20 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/InstanceType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/InstanceType.java
@@ -85,6 +85,10 @@
 
     public Integer getMigrationDowntime();
 
+    String getEmulatedMachine();
+
+    void setEmulatedMachine(String emulatedMachine);
+
     // TODO: these should be add as well
     // userdefined_properties
     // predefined_properties
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
index 03fad41..e128a42 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
@@ -218,6 +218,14 @@
         this.vmStatic.setComment(value);
     }
 
+    public String getEmulatedMachine() {
+        return this.vmStatic.getEmulatedMachine();
+    }
+
+    public void setEmulatedMachine(String value) {
+        this.vmStatic.setEmulatedMachine(value);
+    }
+
     @Override
     public String getStopReason() {
         return this.vmDynamic.getStopReason();
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
index 8f5d44c..72f67a7 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
@@ -19,6 +19,7 @@
 import 
org.ovirt.engine.core.common.validation.annotation.IntegerContainedInConfigValueList;
 import 
org.ovirt.engine.core.common.validation.annotation.NullOrStringContainedInConfigValueList;
 import org.ovirt.engine.core.common.validation.annotation.ValidDescription;
+import org.ovirt.engine.core.common.validation.annotation.ValidI18NName;
 import 
org.ovirt.engine.core.common.validation.annotation.ValidSerialNumberPolicy;
 import org.ovirt.engine.core.common.validation.annotation.ValidTimeZone;
 import org.ovirt.engine.core.common.validation.group.CreateEntity;
@@ -80,6 +81,14 @@
     @EditableOnVmStatusField
     @EditableOnTemplate
     private int cpuPerSocket;
+
+    @CopyOnNewVersion
+    @EditableOnVmStatusField
+    @EditableOnTemplate
+    @Size(max = BusinessEntitiesDefinitions.EMULATED_MACHINE_SIZE)
+    @ValidI18NName(message = 
"ACTION_TYPE_FAILED_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS",
+            groups = { CreateEntity.class, UpdateEntity.class })
+    private String emulatedMachine;
 
     @CopyOnNewVersion
     @EditableOnVmStatusField
@@ -371,7 +380,8 @@
                 vmBase.getCustomSerialNumber(),
                 vmBase.isBootMenuEnabled(),
                 vmBase.isSpiceFileTransferEnabled(),
-                vmBase.isSpiceCopyPasteEnabled());
+                vmBase.isSpiceCopyPasteEnabled(),
+                vmBase.getEmulatedMachine());
     }
 
     public VmBase(
@@ -421,7 +431,8 @@
             String customSerialNumber,
             boolean bootMenuEnabled,
             boolean spiceFileTransferEnabled,
-            boolean spiceCopyPasteEnabled) {
+            boolean spiceCopyPasteEnabled,
+            String emulatedMachine) {
         this();
         this.name = name;
         this.id = id;
@@ -470,6 +481,7 @@
         this.bootMenuEnabled = bootMenuEnabled;
         this.spiceFileTransferEnabled = spiceFileTransferEnabled;
         this.spiceCopyPasteEnabled = spiceCopyPasteEnabled;
+        this.emulatedMachine = emulatedMachine;
     }
 
     public long getDbGeneration() {
@@ -810,6 +822,7 @@
         result = prime * result + (bootMenuEnabled ? 1231 : 1237);
         result = prime * result + (spiceFileTransferEnabled ? 1231 : 1237);
         result = prime * result + (spiceCopyPasteEnabled ? 1231 : 1237);
+        result = prime * result + ((emulatedMachine == null) ? 0 : 
emulatedMachine.hashCode());
         return result;
     }
 
@@ -864,7 +877,8 @@
                 && ObjectUtils.objectsEqual(customSerialNumber, 
other.customSerialNumber)
                 && bootMenuEnabled == other.bootMenuEnabled
                 && spiceFileTransferEnabled == other.spiceFileTransferEnabled
-                && spiceCopyPasteEnabled == other.spiceCopyPasteEnabled;
+                && spiceCopyPasteEnabled == other.spiceCopyPasteEnabled
+                && ObjectUtils.objectsEqual(emulatedMachine, 
other.emulatedMachine);
     }
 
     public Guid getQuotaId() {
@@ -1035,4 +1049,12 @@
     public boolean isSpiceCopyPasteEnabled() { return spiceCopyPasteEnabled; }
 
     public void setSpiceCopyPasteEnabled(boolean spiceCopyPasteEnabled) { 
this.spiceCopyPasteEnabled = spiceCopyPasteEnabled; }
+
+    public String getEmulatedMachine() {
+        return emulatedMachine;
+    }
+
+    public void setEmulatedMachine(String emulatedMachine) {
+        this.emulatedMachine = ((emulatedMachine == null || 
emulatedMachine.length()==0) ? null : emulatedMachine);
+    }
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java
index a380f06..d0a05ce 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java
@@ -77,7 +77,7 @@
             boolean allowConsoleReconnect, String isoPath, Integer 
migrationDowntime,
             Guid baseTemplateId, String templateVersionName,
             SerialNumberPolicy serialNumberPolicy, String customSerialNumber,
-            boolean bootMenuEnabled, boolean spiceFIleTransferEnabled, boolean 
spiceCopyPasteEnabled) {
+            boolean bootMenuEnabled, boolean spiceFIleTransferEnabled, boolean 
spiceCopyPasteEnabled, String emulatedMachine) {
         super(name,
                 vmtGuid,
                 vdsGroupId,
@@ -124,7 +124,8 @@
                 customSerialNumber,
                 bootMenuEnabled,
                 spiceFIleTransferEnabled,
-                spiceCopyPasteEnabled);
+                spiceCopyPasteEnabled,
+                emulatedMachine);
 
         diskTemplateMap = new HashMap<Guid, DiskImage>();
         diskImageMap = new HashMap<Guid, DiskImage>();
@@ -191,6 +192,7 @@
         setBootMenuEnabled(template.isBootMenuEnabled());
         setSpiceFileTransferEnabled(template.isSpiceFileTransferEnabled());
         setSpiceCopyPasteEnabled(template.isSpiceCopyPasteEnabled());
+        setEmulatedMachine(template.getEmulatedMachine());
     }
 
     public ArchitectureType getClusterArch() {
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 3fc6733..6edfcf8 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
@@ -277,6 +277,7 @@
     ACTION_TYPE_FAILED_TEMPLATE_IS_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_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_HOST_NOT_EXIST(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_VM_SNAPSHOT_NOT_IN_PREVIEW(ErrorType.CONFLICT),
@@ -973,6 +974,7 @@
     VAR__DETAIL__AFFINITY_FAILED_POSITIVE,
     VAR__DETAIL__AFFINITY_FAILED_NEGATIVE,
     VAR__DETAIL__LOW_CPU_LEVEL,
+    VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE,
     VAR__DETAIL__SWAP_VALUE_ILLEGAL,
     VAR__DETAIL__NOT_ENOUGH_MEMORY,
     SCHEDULING_NO_HOSTS,
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java
index fdb7f73..44214ce 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java
@@ -67,7 +67,8 @@
                 .addValue("custom_serial_number", 
entity.getCustomSerialNumber())
                 .addValue("is_boot_menu_enabled", entity.isBootMenuEnabled())
                 .addValue("is_spice_file_transfer_enabled", 
entity.isSpiceFileTransferEnabled())
-                .addValue("is_spice_copy_paste_enabled", 
entity.isSpiceCopyPasteEnabled());
+                .addValue("is_spice_copy_paste_enabled", 
entity.isSpiceCopyPasteEnabled())
+                .addValue("emulated_machine", entity.getEmulatedMachine());
     }
 
     /**
@@ -121,6 +122,7 @@
             entity.setDedicatedVmForVds(getGuid(rs, "dedicated_vm_for_vds"));
             entity.setMinAllocatedMem(rs.getInt("min_allocated_mem"));
             entity.setQuotaId(getGuid(rs, "quota_id"));
+            entity.setEmulatedMachine(rs.getString("emulated_machine"));
         }
     }
 }
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 c0fa772..a289c1c 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -842,6 +842,7 @@
 ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY=Can not ${action} ${type}. The given 
name is empty.
 ACTION_TYPE_FAILED_TEMPLATE_IS_INCOMPATIBLE=Can not ${action} ${type}. The 
selected template is not compatible with Cluster 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_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot 
${action} ${type}. The given emulated machine 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.
 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.
@@ -1172,6 +1173,7 @@
 VAR__DETAIL__AFFINITY_FAILED_POSITIVE=$detailMessage it did not match positive 
affinity rules ${affinityRules}
 VAR__DETAIL__AFFINITY_FAILED_NEGATIVE=$detailMessage it matched negative 
affinity rules ${affinityRules}
 VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is 
lower than the VM requires ${vmCPULevel}
+VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE=$detailMessage it doesn't support 
the emulated machine '${vmEmulatedMachine}' which is required by the VM
 VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal
 VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory 
to run the VM
 SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains 
at least one host in Up state.
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java
index db9d012..dfc23ad 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java
@@ -68,4 +68,5 @@
     final static String IS_BOOT_MENU_ENABLED = "IsBootMenuEnabled";
     final static String IS_SPICE_FILE_TRANSFER_ENABLED = 
"IsSpiceFileTransferEnabled";
     final static String IS_SPICE_COPY_PASTE_ENABLED = 
"IsSpiceCopyPasteEnabled";
+    final static String CUSTOM_EMULATED_MACHINE = "CustomEmulatedMachine";
 }
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
index adc8db0..e386141 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
@@ -298,6 +298,13 @@
         if (node != null) {
             _vm.setUseLatestVersion(Boolean.parseBoolean(node.innerText));
         }
+
+        node = content.SelectSingleNode(OvfProperties.CUSTOM_EMULATED_MACHINE);
+        if (node != null) {
+            if (StringUtils.isNotEmpty(node.innerText)) {
+                _vm.setEmulatedMachine(node.innerText);
+            }
+        }
     }
 
     @Override
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java
index 97bd737..d702786 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmWriter.java
@@ -90,6 +90,10 @@
         _writer.WriteRaw(String.valueOf(_vm.isUseLatestVersion()));
         _writer.WriteEndElement();
 
+        _writer.WriteStartElement(OvfProperties.CUSTOM_EMULATED_MACHINE);
+        _writer.WriteRaw(_vm.getEmulatedMachine());
+        _writer.WriteEndElement();
+
         OvfLogEventHandler<VmStatic> handler = new 
VMStaticOvfLogHandler(_vm.getStaticData());
         // Gets a map that its keys are aliases to fields that should be OVF
         // logged.
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
index 43226b8..729a29f 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
@@ -89,7 +89,7 @@
         }
         final String compatibilityVersion = 
vm.getVdsGroupCompatibilityVersion().toString();
         addCpuPinning(compatibilityVersion);
-        createInfo.put(VdsProperties.emulatedMachine, 
getVdsGroup().getEmulatedMachine());
+        createInfo.put(VdsProperties.emulatedMachine, (vm.getEmulatedMachine() 
== null ? getVdsGroup().getEmulatedMachine() : vm.getEmulatedMachine()));
         // send cipher suite and spice secure channels parameters only if ssl
         // enabled.
         if (Config.<Boolean> getValue(ConfigValues.SSLEnabled)) {
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 95be55f..b5dbf2d 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
@@ -3141,6 +3141,12 @@
     @DefaultStringValue("$detailMessage its CPU level ${hostCPULevel} is lower 
than the VM requires ${vmCPULevel}")
     String VAR__DETAIL__LOW_CPU_LEVEL();
 
+    @DefaultStringValue("$detailMessage it doesn't support the emulated 
machine '${vmEmulatedMachine}' which is required by the VM")
+    String VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE();
+
+    @DefaultStringValue("Cannot ${action} ${type}. The given emulated machine 
contains special characters. Only lower-case and upper-case letters, numbers, 
'_', '-', '.' are allowed.")
+    String ACTION_TYPE_FAILED_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS();
+
     @DefaultStringValue("$detailMessage it did not match positive affinity 
rules ${affinityRules}")
     String VAR__DETAIL__AFFINITY_FAILED_POSITIVE();
 
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 88dd5e9..a2a2565 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
@@ -805,6 +805,7 @@
 ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY=Can not ${action} ${type}. The given 
name is empty.
 ACTION_TYPE_FAILED_TEMPLATE_IS_INCOMPATIBLE=Can not ${action} ${type}. The 
selected template is not compatible with Cluster 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_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot 
${action} ${type}. The given emulated machine 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.
 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.
@@ -1002,6 +1003,7 @@
 VAR__DETAIL__AFFINITY_FAILED_POSITIVE=$detailMessage it did not match positive 
affinity rules ${affinityRules}
 VAR__DETAIL__AFFINITY_FAILED_NEGATIVE=$detailMessage it matched negative 
affinity rules ${affinityRules}
 VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is 
lower than the VM requires ${vmCPULevel}
+VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE=$detailMessage it doesn't support 
the emulated machine '${vmEmulatedMachine}' which is required by the VM
 VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal
 VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory 
to run the VM
 SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains 
at least one host in Up state.
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 4e33da1..8ed1cc2 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
@@ -833,6 +833,7 @@
 ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE=Host Address can not be modified due 
to Security restrictions.  In order to change Host Address, Host has to be 
reinstalled
 CAN_DO_ACTION_DATABASE_CONNECTION_FAILURE=Action failed due to database 
connection failure. Please check connectivity to your Database server.
 ACTION_TYPE_FAILED_DESCRIPTION_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot ${action} 
${type}. The given description contains special characters.\nOnly alpha-numeric 
and some special characters that conform to the standard ASCII character set 
are allowed.
+ACTION_TYPE_FAILED_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot 
${action} ${type}. The given emulated machine contains special characters. Only 
lower-case and upper-case letters, numbers, '_', '-', '.' are allowed.
 
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.
@@ -1143,6 +1144,7 @@
 VAR__DETAIL__AFFINITY_FAILED_POSITIVE=$detailMessage it did not match positive 
affinity rules ${affinityRules}
 VAR__DETAIL__AFFINITY_FAILED_NEGATIVE=$detailMessage it matched negative 
affinity rules ${affinityRules}
 VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is 
lower than the VM requires ${vmCPULevel}
+VAR__DETAIL__UNSUPPORTED_EMULATED_MACHINE=$detailMessage it doesn't support 
the emulated machine '${vmEmulatedMachine}' which is required by the VM
 VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal
 VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory 
to run the VM
 SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains 
at least one host in Up state.
diff --git a/packaging/dbscripts/create_views.sql 
b/packaging/dbscripts/create_views.sql
index 4ec47aa..e21e1fb 100644
--- a/packaging/dbscripts/create_views.sql
+++ b/packaging/dbscripts/create_views.sql
@@ -434,7 +434,8 @@
        vm_templates.custom_serial_number as custom_serial_number,
        vm_templates.is_boot_menu_enabled as is_boot_menu_enabled,
        vm_templates.is_spice_file_transfer_enabled as 
is_spice_file_transfer_enabled,
-       vm_templates.is_spice_copy_paste_enabled as is_spice_copy_paste_enabled
+       vm_templates.is_spice_copy_paste_enabled as is_spice_copy_paste_enabled,
+       vm_templates.emulated_machine as emulated_machine
 FROM       vm_static AS vm_templates  LEFT OUTER JOIN
 vds_groups ON vm_templates.vds_group_id = vds_groups.vds_group_id
 left outer JOIN
@@ -648,7 +649,8 @@
                       vm_static.is_boot_menu_enabled as is_boot_menu_enabled, 
vm_dynamic.guest_cpu_count as guest_cpu_count,
                       (snapshots.snapshot_id is not null) as 
next_run_config_exists,
                       vm_static.numatune_mode as numatune_mode,
-                      vm_static.is_spice_file_transfer_enabled as 
is_spice_file_transfer_enabled, vm_static.is_spice_copy_paste_enabled as 
is_spice_copy_paste_enabled
+                      vm_static.is_spice_file_transfer_enabled as 
is_spice_file_transfer_enabled, vm_static.is_spice_copy_paste_enabled as 
is_spice_copy_paste_enabled,
+                      vm_static.emulated_machine as emulated_machine
 FROM         vm_static INNER JOIN
 vm_dynamic ON vm_static.vm_guid = vm_dynamic.vm_guid INNER JOIN
 vm_static AS vm_templates ON vm_static.vmt_guid = vm_templates.vm_guid INNER 
JOIN
diff --git 
a/packaging/dbscripts/upgrade/03_06_0070_add_emulated_machine_to_vm.sql 
b/packaging/dbscripts/upgrade/03_06_0070_add_emulated_machine_to_vm.sql
new file mode 100644
index 0000000..296de09
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_06_0070_add_emulated_machine_to_vm.sql
@@ -0,0 +1 @@
+select fn_db_add_column('vm_static', 'emulated_machine', 'character 
varying(40)');
\ No newline at end of file
diff --git 
a/packaging/dbscripts/upgrade/03_06_0080_add_emulated_machine_policy_unit.sql 
b/packaging/dbscripts/upgrade/03_06_0080_add_emulated_machine_policy_unit.sql
new file mode 100644
index 0000000..d2cfc3e
--- /dev/null
+++ 
b/packaging/dbscripts/upgrade/03_06_0080_add_emulated_machine_policy_unit.sql
@@ -0,0 +1,12 @@
+CREATE FUNCTION _createEmulatedMachineFilter(uuid) RETURNS void AS $$
+  INSERT INTO policy_units (id, name, is_internal, custom_properties_regex, 
type, enabled, description) VALUES ($1, 'Emulated-Machine', true, NULL, 0, 
true, 'Runs VMs only on hosts with a proper emulated machine support');
+  INSERT INTO cluster_policy_units (cluster_policy_id, policy_unit_id, 
filter_sequence, factor) VALUES ('20d25257-b4bd-4589-92a6-c4c5c5d3fd1a', $1, 0, 
0);
+  INSERT INTO cluster_policy_units (cluster_policy_id, policy_unit_id, 
filter_sequence, factor) VALUES ('5a2b0939-7d46-4b73-a469-e9c2c7fc6a53', $1, 0, 
0);
+  INSERT INTO cluster_policy_units (cluster_policy_id, policy_unit_id, 
filter_sequence, factor) VALUES ('b4ed2332-a7ac-4d5f-9596-99a439cb2812', $1, 0, 
0);
+  INSERT INTO cluster_policy_units (cluster_policy_id, policy_unit_id, 
filter_sequence, factor) VALUES ('8d5d7bec-68de-4a67-b53e-0ac54686d579', $1, 0, 
0);
+$$ LANGUAGE SQL;
+
+
+select _createEmulatedMachineFilter(uuid_generate_v1());
+
+DROP FUNCTION  _createEmulatedMachineFilter(uuid);
\ No newline at end of file
diff --git a/packaging/dbscripts/vm_templates_sp.sql 
b/packaging/dbscripts/vm_templates_sp.sql
index be69e9c..9e38e00 100644
--- a/packaging/dbscripts/vm_templates_sp.sql
+++ b/packaging/dbscripts/vm_templates_sp.sql
@@ -58,7 +58,8 @@
  v_custom_serial_number VARCHAR(255),
  v_is_boot_menu_enabled BOOLEAN,
  v_is_spice_file_transfer_enabled BOOLEAN,
- v_is_spice_copy_paste_enabled BOOLEAN)
+ v_is_spice_copy_paste_enabled BOOLEAN,
+ v_emulated_machine VARCHAR(40))
 
 RETURNS VOID
    AS $procedure$
@@ -130,7 +131,8 @@
     custom_serial_number,
     is_boot_menu_enabled,
     is_spice_file_transfer_enabled,
-    is_spice_copy_paste_enabled)
+    is_spice_copy_paste_enabled,
+    emulated_machine)
 VALUES(
     v_child_count,
     v_creation_date,
@@ -184,7 +186,8 @@
     v_custom_serial_number,
     v_is_boot_menu_enabled,
     v_is_spice_file_transfer_enabled,
-    v_is_spice_copy_paste_enabled);
+    v_is_spice_copy_paste_enabled,
+    v_emulated_machine);
 -- perform deletion from vm_ovf_generations to ensure that no record exists 
when performing insert to avoid PK violation.
 DELETE FROM vm_ovf_generations gen WHERE gen.vm_guid = v_vmt_guid;
 INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id)
@@ -248,7 +251,8 @@
  v_custom_serial_number VARCHAR(255),
  v_is_boot_menu_enabled BOOLEAN,
  v_is_spice_file_transfer_enabled BOOLEAN,
- v_is_spice_copy_paste_enabled BOOLEAN)
+ v_is_spice_copy_paste_enabled BOOLEAN,
+ v_emulated_machine VARCHAR(40))
 RETURNS VOID
 
        --The [vm_templates] table doesn't have a timestamp column. Optimistic 
concurrency logic cannot be generated
@@ -276,7 +280,8 @@
       template_version_name = v_template_version_name,
       serial_number_policy = v_serial_number_policy, custom_serial_number = 
v_custom_serial_number,
       is_boot_menu_enabled = v_is_boot_menu_enabled,
-      is_spice_file_transfer_enabled = v_is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled = v_is_spice_copy_paste_enabled
+      is_spice_file_transfer_enabled = v_is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled = v_is_spice_copy_paste_enabled,
+      emulated_machine = v_emulated_machine
       WHERE vm_guid = v_vmt_guid
       AND   entity_type = v_template_type;
 
diff --git a/packaging/dbscripts/vms_sp.sql b/packaging/dbscripts/vms_sp.sql
index bcd6194..b5f5687 100644
--- a/packaging/dbscripts/vms_sp.sql
+++ b/packaging/dbscripts/vms_sp.sql
@@ -502,7 +502,8 @@
     v_is_boot_menu_enabled BOOLEAN,
     v_numatune_mode VARCHAR(20),
     v_is_spice_file_transfer_enabled BOOLEAN,
-    v_is_spice_copy_paste_enabled BOOLEAN)
+    v_is_spice_copy_paste_enabled BOOLEAN,
+    v_emulated_machine VARCHAR(40))
   RETURNS VOID
    AS $procedure$
 DECLARE
@@ -510,8 +511,8 @@
 BEGIN
 -- lock template for child count update
 select vm_guid into v_val FROM vm_static WHERE vm_guid = v_vmt_guid for update;
-INSERT INTO vm_static(description, free_text_comment, mem_size_mb, os, 
vds_group_id, vm_guid, VM_NAME, vmt_guid,creation_date,num_of_monitors, 
single_qxl_pci, 
allow_console_reconnect,is_initialized,num_of_sockets,cpu_per_socket,usb_policy,
 time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, 
default_boot_sequence, vm_type, nice_level, cpu_shares, default_display_type, 
priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,
 entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected, 
sso_method, host_cpu_flags, tunnel_migration, vnc_keyboard_layout, 
is_run_and_pause, created_by_user_id, instance_type_id, image_type_id, 
original_template_id, original_template_name, migration_downtime, 
template_version_number, serial_number_policy, custom_serial_number, 
is_boot_menu_enabled, numatune_mode, is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled)
-       VALUES(v_description, v_free_text_comment, v_mem_size_mb, v_os, 
v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_creation_date, 
v_num_of_monitors,v_single_qxl_pci, v_allow_console_reconnect, 
v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, 
v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, 
v_default_boot_sequence, v_vm_type, v_nice_level, v_cpu_shares, 
v_default_display_type, 
v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,
 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected, 
v_sso_method, v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout, 
v_is_run_and_pause, v_created_by_user_id, v_instance_type_id, v_image_type_id, 
v_original_template_id, v_original_template_name, v_migration_downtime, 
v_template_version_number, v_serial_number_policy, v_custom_serial_number, 
v_is_boot_menu_!
 enabled, v_numatune_mode, v_is_spice_file_transfer_enabled, 
v_is_spice_copy_paste_enabled);
+INSERT INTO vm_static(description, free_text_comment, mem_size_mb, os, 
vds_group_id, vm_guid, VM_NAME, vmt_guid,creation_date,num_of_monitors, 
single_qxl_pci, 
allow_console_reconnect,is_initialized,num_of_sockets,cpu_per_socket,usb_policy,
 time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, 
default_boot_sequence, vm_type, nice_level, cpu_shares, default_display_type, 
priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,
 entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected, 
sso_method, host_cpu_flags, tunnel_migration, vnc_keyboard_layout, 
is_run_and_pause, created_by_user_id, instance_type_id, image_type_id, 
original_template_id, original_template_name, migration_downtime, 
template_version_number, serial_number_policy, custom_serial_number, 
is_boot_menu_enabled, numatune_mode, is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled, emulated_!
 machine)
+       VALUES(v_description, v_free_text_comment, v_mem_size_mb, v_os, 
v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_creation_date, 
v_num_of_monitors,v_single_qxl_pci, v_allow_console_reconnect, 
v_is_initialized, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, 
v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, 
v_default_boot_sequence, v_vm_type, v_nice_level, v_cpu_shares, 
v_default_display_type, 
v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,
 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected, 
v_sso_method, v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout, 
v_is_run_and_pause, v_created_by_user_id, v_instance_type_id, v_image_type_id, 
v_original_template_id, v_original_template_name, v_migration_downtime, 
v_template_version_number, v_serial_number_policy, v_custom_serial_number, 
v_is_boot_menu_!
 enabled, v_numatune_mode, v_is_spice_file_transfer_enabled, 
v_is_spice_copy_paste_enabled, v_emulated_machine);
 
 -- perform deletion from vm_ovf_generations to ensure that no record exists 
when performing insert to avoid PK violation.
 DELETE FROM vm_ovf_generations gen WHERE gen.vm_guid = v_vm_guid;
@@ -642,7 +643,8 @@
 v_is_boot_menu_enabled BOOLEAN,
 v_numatune_mode VARCHAR(20),
 v_is_spice_file_transfer_enabled BOOLEAN,
-v_is_spice_copy_paste_enabled BOOLEAN)
+v_is_spice_copy_paste_enabled BOOLEAN,
+v_emulated_machine VARCHAR(40))
 
 RETURNS VOID
 
@@ -676,7 +678,8 @@
       serial_number_policy = v_serial_number_policy, custom_serial_number = 
v_custom_serial_number,
       is_boot_menu_enabled = v_is_boot_menu_enabled,
       numatune_mode = v_numatune_mode,
-      is_spice_file_transfer_enabled = v_is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled = v_is_spice_copy_paste_enabled
+      is_spice_file_transfer_enabled = v_is_spice_file_transfer_enabled, 
is_spice_copy_paste_enabled = v_is_spice_copy_paste_enabled,
+      emulated_machine = v_emulated_machine
       WHERE vm_guid = v_vm_guid
       AND   entity_type = 'VM';
 END; $procedure$


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

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

Reply via email to