Eldan Shachar has uploaded a new change for review. Change subject: core: Cluster parameters override - fields\db ......................................................................
core: Cluster parameters override - fields\db 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: I64d829aa6a68b1c97fb59d2a7a21351a00c92c40 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/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/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/VmDynamic.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/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/annotation/ValidI18NExtraName.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmBaseDaoDbFacade.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.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 M packaging/dbscripts/create_views.sql A packaging/dbscripts/upgrade/03_06_0330_add_cluster_parameters_override_to_vm.sql M packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql M packaging/dbscripts/vm_templates_sp.sql M packaging/dbscripts/vms_sp.sql 20 files changed, 225 insertions(+), 26 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/46/32546/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 2152032..9df844e 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 @@ -577,7 +577,9 @@ getParameters().getMasterVm().isBootMenuEnabled(), getParameters().getMasterVm().isSpiceFileTransferEnabled(), getParameters().getMasterVm().isSpiceCopyPasteEnabled(), - getParameters().getMasterVm().getCpuProfileId())); + getParameters().getMasterVm().getCpuProfileId(), + getParameters().getMasterVm().getCustomEmulatedMachine(), + getParameters().getMasterVm().getCustomCpuName())); DbFacade.getInstance().getVmTemplateDao().save(getVmTemplate()); getCompensationContext().snapshotNewEntity(getVmTemplate()); setActionReturnValue(getVmTemplate().getId()); 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 1902702..e26499a 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,8 @@ // VM (vm_statis) public static final int VM_NAME_SIZE = 255; public static final int VM_DESCRIPTION_SIZE = 255; + public static final int VM_EMULATED_MACHINE_SIZE = 30; + public static final int VM_CPU_NAME_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/VM.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java index 8f3694c..76deaf9 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 @@ -220,6 +220,22 @@ this.vmStatic.setComment(value); } + public String getEmulatedMachine() { + return this.vmDynamic.getEmulatedMachine(); + } + + public void setEmulatedMachine(String value) { + this.vmDynamic.setEmulatedMachine(value); + } + + public String getCustomEmulatedMachine() { + return this.vmStatic.getCustomEmulatedMachine(); + } + + public void setCustomEmulatedMachine(String value) { + this.vmStatic.setCustomEmulatedMachine(value); + } + @Override public String getStopReason() { return this.vmDynamic.getStopReason(); @@ -1042,6 +1058,14 @@ this.vmDynamic.setHibernationVolHandle(value); } + public String getCustomCpuName() { + return this.vmStatic.getCustomCpuName(); + } + + public void setCustomCpuName(String value) { + this.vmStatic.setCustomCpuName(value); + } + public String getCpuName() { return this.vmDynamic.getCpuName(); } 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 f6afc3c..7691019 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.ValidI18NExtraName; 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,22 @@ @EditableOnVmStatusField @EditableOnTemplate private int cpuPerSocket; + + @CopyOnNewVersion + @EditableOnVmStatusField + @EditableOnTemplate + @Size(max = BusinessEntitiesDefinitions.VM_EMULATED_MACHINE_SIZE) + @ValidI18NExtraName(message = "ACTION_TYPE_FAILED_EMULATED_MACHINE_MAY_NOT_CONTAIN_SPECIAL_CHARS", + groups = { CreateEntity.class, UpdateEntity.class }) + private String customEmulatedMachine; + + @CopyOnNewVersion + @EditableOnVmStatusField + @EditableOnTemplate + @Size(max = BusinessEntitiesDefinitions.VM_CPU_NAME_SIZE) + @ValidI18NExtraName(message = "ACTION_TYPE_FAILED_CPU_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS", + groups = { CreateEntity.class, UpdateEntity.class }) + private String customCpuName; // overrides cluster cpu. (holds the actual vdsVerb) @CopyOnNewVersion @EditableOnVmStatusField @@ -378,7 +395,9 @@ vmBase.isBootMenuEnabled(), vmBase.isSpiceFileTransferEnabled(), vmBase.isSpiceCopyPasteEnabled(), - vmBase.getCpuProfileId()); + vmBase.getCpuProfileId(), + vmBase.getCustomEmulatedMachine(), + vmBase.getCustomCpuName()); } public VmBase( @@ -429,7 +448,9 @@ boolean bootMenuEnabled, boolean spiceFileTransferEnabled, boolean spiceCopyPasteEnabled, - Guid cpuProfileId) { + Guid cpuProfileId, + String customEmulatedMachine, + String customCpuName) { this(); this.name = name; this.id = id; @@ -479,6 +500,8 @@ this.spiceFileTransferEnabled = spiceFileTransferEnabled; this.spiceCopyPasteEnabled = spiceCopyPasteEnabled; this.cpuProfileId = cpuProfileId; + this.customEmulatedMachine = customEmulatedMachine; + this.customCpuName = customCpuName; } public long getDbGeneration() { @@ -820,6 +843,8 @@ result = prime * result + (spiceFileTransferEnabled ? 1231 : 1237); result = prime * result + (spiceCopyPasteEnabled ? 1231 : 1237); result = prime * result + ((cpuProfileId == null) ? 0 : cpuProfileId.hashCode()); + result = prime * result + ((customEmulatedMachine == null) ? 0 : customEmulatedMachine.hashCode()); + result = prime * result + ((customCpuName== null) ? 0 : customCpuName.hashCode()); return result; } @@ -875,7 +900,9 @@ && bootMenuEnabled == other.bootMenuEnabled && spiceFileTransferEnabled == other.spiceFileTransferEnabled && spiceCopyPasteEnabled == other.spiceCopyPasteEnabled - && ObjectUtils.objectsEqual(cpuProfileId, other.cpuProfileId); + && ObjectUtils.objectsEqual(cpuProfileId, other.cpuProfileId) + && ObjectUtils.objectsEqual(customEmulatedMachine, other.customEmulatedMachine) + && ObjectUtils.objectsEqual(customCpuName, other.customCpuName); } public Guid getQuotaId() { @@ -1054,4 +1081,20 @@ public void setCpuProfileId(Guid cpuProfileId) { this.cpuProfileId = cpuProfileId; } + + public String getCustomEmulatedMachine() { + return customEmulatedMachine; + } + + public void setCustomEmulatedMachine(String customEmulatedMachine) { + this.customEmulatedMachine = ((customEmulatedMachine == null || customEmulatedMachine.length()==0) ? null : customEmulatedMachine); + } + + public String getCustomCpuName() { + return customCpuName; + } + + public void setCustomCpuName(String customCpuName) { + this.customCpuName = ((customCpuName==null || customCpuName.length()==0) ? null : customCpuName); + } } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java index ca32358..4bf6979 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java @@ -66,6 +66,8 @@ private boolean runOnce; @UnchangeableByVdsm private String cpuName; + @UnchangeableByVdsm + private String emulatedMachine; private String currentCd; @UnchangeableByVdsm private String stopReason; @@ -122,6 +124,7 @@ result = prime * result + (currentCd == null ? 0 : currentCd.hashCode()); result = prime * result + (stopReason == null ? 0 : stopReason.hashCode()); result = prime * result + exitReason.hashCode(); + result = prime * result + (emulatedMachine == null ? 0 : emulatedMachine.hashCode()); return result; } @@ -179,7 +182,8 @@ && ObjectUtils.objectsEqual(cpuName, other.cpuName) && ObjectUtils.objectsEqual(currentCd, other.currentCd) && ObjectUtils.objectsEqual(stopReason, other.stopReason) - && exitReason == other.exitReason); + && exitReason == other.exitReason + && ObjectUtils.objectsEqual(emulatedMachine, other.emulatedMachine)); } public String getExitMessage() { @@ -571,4 +575,12 @@ public int getGuestCpuCount() { return guestCpuCount; } + + 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/VmTemplate.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java index d226fe4..862cf06 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 @@ -78,7 +78,7 @@ Guid baseTemplateId, String templateVersionName, SerialNumberPolicy serialNumberPolicy, String customSerialNumber, boolean bootMenuEnabled, boolean spiceFIleTransferEnabled, boolean spiceCopyPasteEnabled, - Guid cpuProfileId) { + Guid cpuProfileId, String emulatedMachine, String customCpuName) { super(name, vmtGuid, vdsGroupId, @@ -126,7 +126,9 @@ bootMenuEnabled, spiceFIleTransferEnabled, spiceCopyPasteEnabled, - cpuProfileId); + cpuProfileId, + emulatedMachine, + customCpuName); diskTemplateMap = new HashMap<Guid, DiskImage>(); diskImageMap = new HashMap<Guid, DiskImage>(); @@ -193,6 +195,8 @@ setBootMenuEnabled(template.isBootMenuEnabled()); setSpiceFileTransferEnabled(template.isSpiceFileTransferEnabled()); setSpiceCopyPasteEnabled(template.isSpiceCopyPasteEnabled()); + setCustomEmulatedMachine(template.getCustomEmulatedMachine()); + setCustomCpuName(template.getCustomCpuName()); } 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 fac5612..1ce7f77 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 @@ -284,6 +284,8 @@ 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_CPU_NAME_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), @@ -1003,6 +1005,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/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java index bd006b4..bad18c2 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java @@ -16,6 +16,7 @@ public class ValidationUtils { + public static final String NO_SPECIAL_CHARACTERS_EXTRA_I18N = "^[\\p{L}0-9._\\+-]*$"; public static final String NO_SPECIAL_CHARACTERS_I18N = "^[\\p{L}0-9._-]*$"; public static final String NO_SPECIAL_CHARACTERS = "[0-9a-zA-Z_-]+"; public static final String ONLY_I18N_ASCII_OR_NONE = "[\\p{ASCII}\\p{L}]*"; diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/annotation/ValidI18NExtraName.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/annotation/ValidI18NExtraName.java new file mode 100644 index 0000000..92fe698 --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/annotation/ValidI18NExtraName.java @@ -0,0 +1,30 @@ +package org.ovirt.engine.core.common.validation.annotation; + +import org.ovirt.engine.core.common.utils.ValidationUtils; + +import javax.validation.Constraint; +import javax.validation.Payload; +import javax.validation.ReportAsSingleViolation; +import javax.validation.constraints.Pattern; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +@Target({ ANNOTATION_TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +@Pattern(regexp = ValidationUtils.NO_SPECIAL_CHARACTERS_EXTRA_I18N) +@Constraint(validatedBy = {}) +@ReportAsSingleViolation +public @interface ValidI18NExtraName { + String message() default "VALIDATION_FIELD_CONTAINS_SPECIAL_CHARACTERS"; + + Class<?>[] groups() default {}; + + Class<? extends Payload>[] payload() default {}; +} 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 063efed..f7c2943 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 @@ -68,7 +68,9 @@ .addValue("is_boot_menu_enabled", entity.isBootMenuEnabled()) .addValue("is_spice_file_transfer_enabled", entity.isSpiceFileTransferEnabled()) .addValue("is_spice_copy_paste_enabled", entity.isSpiceCopyPasteEnabled()) - .addValue("cpu_profile_id", entity.getCpuProfileId()); + .addValue("cpu_profile_id", entity.getCpuProfileId()) + .addValue("custom_emulated_machine", entity.getCustomEmulatedMachine()) + .addValue("custom_cpu_name", entity.getCustomCpuName()); } /** @@ -123,6 +125,8 @@ entity.setMinAllocatedMem(rs.getInt("min_allocated_mem")); entity.setQuotaId(getGuid(rs, "quota_id")); entity.setCpuProfileId(getGuid(rs, "cpu_profile_id")); + entity.setCustomEmulatedMachine(rs.getString("custom_emulated_machine")); + entity.setCustomCpuName(rs.getString("custom_cpu_name")); } } } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.java index d225781..d241eb4 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.java @@ -126,7 +126,8 @@ .addValue("current_cd", vm.getCurrentCd()) .addValue("reason", vm.getStopReason()) .addValue("exit_reason", vm.getExitReason().getValue()) - .addValue("guest_cpu_count", vm.getGuestCpuCount()); + .addValue("guest_cpu_count", vm.getGuestCpuCount()) + .addValue("emulated_machine", vm.getEmulatedMachine()); } @Override @@ -185,6 +186,7 @@ VmExitReason exitReason = VmExitReason.forValue(rs.getInt("exit_reason")); entity.setExitReason(exitReason); entity.setGuestCpuCount(rs.getInt("guest_cpu_count")); + entity.setEmulatedMachine(rs.getString("emulated_machine")); return entity; } } 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 5235cc4..940732e 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -858,6 +858,8 @@ 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_CPU_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot ${action} ${type}. The given CPU 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. 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. @@ -1211,6 +1213,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/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 9f2f749..a6eaf04 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 @@ -3237,6 +3237,15 @@ @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("Cannot ${action} ${type}. The given CPU name contains special characters. Only lower-case and upper-case letters, numbers, '_', '-', '.' are allowed.") + String ACTION_TYPE_FAILED_CPU_NAME_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 888e556..9172b2c 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 @@ -810,6 +810,8 @@ 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_CPU_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot ${action} ${type}. The given CPU 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. 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. @@ -1008,6 +1010,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 da25c07..6b39777 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 @@ -847,6 +847,8 @@ 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_CPU_NAME_MAY_NOT_CONTAIN_SPECIAL_CHARS=Cannot ${action} ${type}. The given CPU name 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. @@ -1177,6 +1179,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 8726340..609e380 100644 --- a/packaging/dbscripts/create_views.sql +++ b/packaging/dbscripts/create_views.sql @@ -446,7 +446,9 @@ 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.cpu_profile_id as cpu_profile_id + vm_templates.cpu_profile_id as cpu_profile_id, + vm_templates.custom_emulated_machine as custom_emulated_machine, + vm_templates.custom_cpu_name as custom_cpu_name 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 @@ -657,7 +659,7 @@ vm_static.default_display_type as default_display_type, vm_static.priority as priority,vm_static.iso_path as iso_path, vm_static.origin as origin, vds_groups.compatibility_version as vds_group_compatibility_version, vm_static.initrd_url as initrd_url, vm_static.kernel_url as kernel_url, vm_static.kernel_params as kernel_params, vm_dynamic.pause_status as pause_status, vm_dynamic.exit_message as exit_message, vm_dynamic.exit_status as exit_status,vm_static.migration_support as migration_support,vm_static.predefined_properties as predefined_properties,vm_static.userdefined_properties as userdefined_properties,vm_static.min_allocated_mem as min_allocated_mem, vm_dynamic.hash as hash, vm_static.cpu_pinning as cpu_pinning, vm_static.db_generation as db_generation, vm_static.host_cpu_flags as host_cpu_flags, vm_static.tunnel_migration as tunnel_migration, vm_static.vnc_keyboard_layout as vnc_keyboard_layout, vm_static.is_run_and_pause as is_run_and_pause, vm_static.created_by_user_id as created_by_user_id, - vm_dynamic.last_watchdog_event as last_watchdog_event, vm_dynamic.last_watchdog_action as last_watchdog_action, vm_dynamic.is_run_once as is_run_once, vm_dynamic.vm_fqdn as vm_fqdn, vm_dynamic.cpu_name as cpu_name, vm_dynamic.current_cd as current_cd, vm_dynamic.reason as reason, vm_dynamic.exit_reason as exit_reason, + vm_dynamic.last_watchdog_event as last_watchdog_event, vm_dynamic.last_watchdog_action as last_watchdog_action, vm_dynamic.is_run_once as is_run_once, vm_dynamic.vm_fqdn as vm_fqdn, vm_dynamic.cpu_name as cpu_name, vm_dynamic.emulated_machine as emulated_machine, vm_dynamic.current_cd as current_cd, vm_dynamic.reason as reason, vm_dynamic.exit_reason as exit_reason, vm_static.instance_type_id as instance_type_id, vm_static.image_type_id as image_type_id, vds_groups.architecture as architecture, vm_static.original_template_id as original_template_id, vm_static.original_template_name as original_template_name, vm_dynamic.last_stop_time as last_stop_time, vm_static.migration_downtime as migration_downtime, vm_static.template_version_number as template_version_number, vm_static.serial_number_policy as serial_number_policy, vm_static.custom_serial_number as custom_serial_number, @@ -665,7 +667,9 @@ (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.cpu_profile_id as cpu_profile_id + vm_static.cpu_profile_id as cpu_profile_id, + vm_static.custom_emulated_machine as custom_emulated_machine, + vm_static.custom_cpu_name as custom_cpu_name 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 @@ -703,7 +707,7 @@ vms.vds_group_compatibility_version, vms.initrd_url, vms.kernel_url, vms.kernel_params, vms.pause_status, vms.exit_status, vms.exit_message, vms.min_allocated_mem, storage_domain_static.id AS storage_id, vms.quota_id as quota_id, vms.quota_name as quota_name, vms.tunnel_migration as tunnel_migration, - vms.vnc_keyboard_layout as vnc_keyboard_layout, vms.is_run_and_pause as is_run_and_pause, vms.created_by_user_id as created_by_user_id, vms.vm_fqdn, vms.cpu_name as cpu_name, + vms.vnc_keyboard_layout as vnc_keyboard_layout, vms.is_run_and_pause as is_run_and_pause, vms.created_by_user_id as created_by_user_id, vms.vm_fqdn, vms.cpu_name as cpu_name, vms.emulated_machine as emulated_machine, vms.vm_pool_spice_proxy as vm_pool_spice_proxy, vms.vds_group_spice_proxy as vds_group_spice_proxy, vms.instance_type_id as instance_type_id, vms.image_type_id as image_type_id, vms.architecture as architecture, vms.original_template_id as original_template_id, vms.original_template_name as original_template_name, vms.migration_downtime as migration_downtime, vms.template_version_number as template_version_number, diff --git a/packaging/dbscripts/upgrade/03_06_0330_add_cluster_parameters_override_to_vm.sql b/packaging/dbscripts/upgrade/03_06_0330_add_cluster_parameters_override_to_vm.sql new file mode 100644 index 0000000..9f43a3a --- /dev/null +++ b/packaging/dbscripts/upgrade/03_06_0330_add_cluster_parameters_override_to_vm.sql @@ -0,0 +1,30 @@ +-- add basic fields to db (cpu_name already exists) +select fn_db_add_column('vm_static', 'custom_emulated_machine', 'character varying(40)'); +select fn_db_add_column('vm_static', 'custom_cpu_name', 'character varying(40)'); +select fn_db_add_column('vm_dynamic', 'emulated_machine', 'varchar(255)'); + +-- cpu_name now represents the vdsVerb, convert all old values +UPDATE vm_dynamic SET cpu_name=converted_query.new_cpu_name FROM (SELECT vm_guid, CASE cpu_name + WHEN 'Intel Conroe Family' THEN 'Conroe' + WHEN 'Intel Penryn Family' THEN 'Penryn' + WHEN 'Intel Nehalem Family' THEN 'Nehalem' + WHEN 'Intel Westmere Family' THEN 'Westmere' + WHEN 'Intel SandyBridge Family' THEN 'Conroe' + WHEN 'Intel Haswell Family' THEN 'Haswell' + + WHEN 'AMD Opteron G1' THEN 'Opteron_G1' + WHEN 'AMD Opteron G2' THEN 'Opteron_G2' + WHEN 'AMD Opteron G3' THEN 'Opteron_G3' + WHEN 'AMD Opteron G4' THEN 'Opteron_G4' + WHEN 'AMD Opteron G5' THEN 'Opteron_G5' + + WHEN 'IBM POWER 7 v2.0' THEN 'POWER7_v2.0' + WHEN 'IBM POWER 7 v2.1' THEN 'POWER7_v2.1' + WHEN 'IBM POWER 7 v2.3' THEN 'POWER7_v2.3' + WHEN 'IBM POWER 7+ v2.1' THEN 'POWER7+_v2.1' + WHEN 'IBM POWER 8 v1.0' THEN 'POWER8_v1.0' + + ELSE inner_dynamic.cpu_name + + END AS new_cpu_name +FROM vm_dynamic AS inner_dynamic) AS converted_query WHERE vm_dynamic.vm_guid=converted_query.vm_guid; diff --git a/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql b/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql index 46dae5e..26236cf 100644 --- a/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql +++ b/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql @@ -76,3 +76,6 @@ select fn_db_add_column_to_object_white_list('vds', 'is_numa_supported'); select fn_db_add_column_to_object_white_list('vds', 'is_live_snapshot_supported'); select fn_db_add_column_to_object_white_list('vds', 'protocol'); + +-- allow query of the host supported emulated machines via the user interface (for VM combobox population) +select fn_db_add_column_to_object_white_list('vds', 'supported_emulated_machines'); diff --git a/packaging/dbscripts/vm_templates_sp.sql b/packaging/dbscripts/vm_templates_sp.sql index 7f81570..515043a 100644 --- a/packaging/dbscripts/vm_templates_sp.sql +++ b/packaging/dbscripts/vm_templates_sp.sql @@ -59,7 +59,9 @@ v_is_boot_menu_enabled BOOLEAN, v_is_spice_file_transfer_enabled BOOLEAN, v_is_spice_copy_paste_enabled BOOLEAN, - v_cpu_profile_id UUID) + v_cpu_profile_id UUID, + v_custom_emulated_machine VARCHAR(40), + v_custom_cpu_name VARCHAR(40)) RETURNS VOID AS $procedure$ @@ -132,7 +134,9 @@ is_boot_menu_enabled, is_spice_file_transfer_enabled, is_spice_copy_paste_enabled, - cpu_profile_id) + cpu_profile_id, + custom_emulated_machine, + custom_cpu_name) VALUES( v_child_count, v_creation_date, @@ -187,7 +191,9 @@ v_is_boot_menu_enabled, v_is_spice_file_transfer_enabled, v_is_spice_copy_paste_enabled, - v_cpu_profile_id); + v_cpu_profile_id, + v_custom_emulated_machine, + v_custom_cpu_name); -- 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) @@ -252,7 +258,9 @@ v_is_boot_menu_enabled BOOLEAN, v_is_spice_file_transfer_enabled BOOLEAN, v_is_spice_copy_paste_enabled BOOLEAN, - v_cpu_profile_id UUID) + v_cpu_profile_id UUID, + v_custom_emulated_machine VARCHAR(40), + v_custom_cpu_name VARCHAR(40)) RETURNS VOID --The [vm_templates] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated @@ -280,7 +288,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, cpu_profile_id = v_cpu_profile_id + is_spice_file_transfer_enabled = v_is_spice_file_transfer_enabled, is_spice_copy_paste_enabled = v_is_spice_copy_paste_enabled, cpu_profile_id = v_cpu_profile_id, + custom_emulated_machine = v_custom_emulated_machine, custom_cpu_name = v_custom_cpu_name 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 9892e54..9344231 100644 --- a/packaging/dbscripts/vms_sp.sql +++ b/packaging/dbscripts/vms_sp.sql @@ -271,14 +271,15 @@ v_last_watchdog_action VARCHAR(8), v_is_run_once BOOLEAN, v_cpu_name VARCHAR(255), + v_emulated_machine VARCHAR(255), v_current_cd VARCHAR(4000), v_exit_reason INTEGER, v_guest_cpu_count INTEGER) RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vm_dynamic(app_list, guest_cur_user_name, console_cur_user_name, guest_last_login_time, guest_last_logout_time, console_user_id, guest_os, migrating_to_vds, RUN_ON_VDS, status, vm_guid, vm_host, vm_ip, last_start_time, last_stop_time, vm_pid, display, acpi_enable, session, display_ip, display_type, kvm_enable, boot_sequence, display_secure_port, utc_diff, last_vds_run_on, client_ip, guest_requested_memory, hibernation_vol_handle,exit_status,pause_status,exit_message, guest_agent_nics_hash, last_watchdog_event, last_watchdog_action, is_run_once, vm_fqdn, cpu_name, current_cd, exit_reason, guest_cpu_count) - VALUES(v_app_list, v_guest_cur_user_name, v_console_cur_user_name, v_guest_last_login_time, v_guest_last_logout_time, v_console_user_id, v_guest_os, v_migrating_to_vds, v_run_on_vds, v_status, v_vm_guid, v_vm_host, v_vm_ip, v_last_start_time, v_last_stop_time, v_vm_pid, v_display, v_acpi_enable, v_session, v_display_ip, v_display_type, v_kvm_enable, v_boot_sequence, v_display_secure_port, v_utc_diff, v_last_vds_run_on, v_client_ip, v_guest_requested_memory, v_hibernation_vol_handle, v_exit_status, v_pause_status, v_exit_message, v_guest_agent_nics_hash, v_last_watchdog_event, v_last_watchdog_action, v_is_run_once, v_vm_fqdn, v_cpu_name, v_current_cd, v_exit_reason, +INSERT INTO vm_dynamic(app_list, guest_cur_user_name, console_cur_user_name, guest_last_login_time, guest_last_logout_time, console_user_id, guest_os, migrating_to_vds, RUN_ON_VDS, status, vm_guid, vm_host, vm_ip, last_start_time, last_stop_time, vm_pid, display, acpi_enable, session, display_ip, display_type, kvm_enable, boot_sequence, display_secure_port, utc_diff, last_vds_run_on, client_ip, guest_requested_memory, hibernation_vol_handle,exit_status,pause_status,exit_message, guest_agent_nics_hash, last_watchdog_event, last_watchdog_action, is_run_once, vm_fqdn, cpu_name, emulated_machine, current_cd, exit_reason, guest_cpu_count) + VALUES(v_app_list, v_guest_cur_user_name, v_console_cur_user_name, v_guest_last_login_time, v_guest_last_logout_time, v_console_user_id, v_guest_os, v_migrating_to_vds, v_run_on_vds, v_status, v_vm_guid, v_vm_host, v_vm_ip, v_last_start_time, v_last_stop_time, v_vm_pid, v_display, v_acpi_enable, v_session, v_display_ip, v_display_type, v_kvm_enable, v_boot_sequence, v_display_secure_port, v_utc_diff, v_last_vds_run_on, v_client_ip, v_guest_requested_memory, v_hibernation_vol_handle, v_exit_status, v_pause_status, v_exit_message, v_guest_agent_nics_hash, v_last_watchdog_event, v_last_watchdog_action, v_is_run_once, v_vm_fqdn, v_cpu_name, v_emulated_machine, v_current_cd, v_exit_reason, v_guest_cpu_count); END; $procedure$ LANGUAGE plpgsql; @@ -324,6 +325,7 @@ v_last_watchdog_action VARCHAR(8), v_is_run_once BOOLEAN, v_cpu_name VARCHAR(255), + v_emulated_machine VARCHAR(255), v_current_cd VARCHAR(4000), v_reason VARCHAR(4000), v_exit_reason INTEGER, @@ -351,7 +353,7 @@ guest_requested_memory = v_guest_requested_memory, hibernation_vol_handle = v_hibernation_vol_handle,exit_status = v_exit_status, pause_status = v_pause_status,exit_message = v_exit_message, hash=v_hash, guest_agent_nics_hash = v_guest_agent_nics_hash, - last_watchdog_event = v_last_watchdog_event, last_watchdog_action = v_last_watchdog_action, is_run_once = v_is_run_once, cpu_name = v_cpu_name, + last_watchdog_event = v_last_watchdog_event, last_watchdog_action = v_last_watchdog_action, is_run_once = v_is_run_once, cpu_name = v_cpu_name, emulated_machine = v_emulated_machine, current_cd = v_current_cd, reason = v_reason, exit_reason = v_exit_reason, @@ -510,7 +512,9 @@ v_numatune_mode VARCHAR(20), v_is_spice_file_transfer_enabled BOOLEAN, v_is_spice_copy_paste_enabled BOOLEAN, - v_cpu_profile_id UUID) + v_cpu_profile_id UUID, + v_custom_emulated_machine VARCHAR(40), + v_custom_cpu_name VARCHAR(40)) RETURNS VOID AS $procedure$ DECLARE @@ -518,8 +522,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, cpu_profi! le_id) - 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_cpu_profile_id); +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, cpu_profi! le_id, custom_emulated_machine, custom_cpu_name) + 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_cpu_profile_id, v_custom_emulated_machine, v_custom_cpu_name); -- 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; @@ -651,7 +655,9 @@ v_numatune_mode VARCHAR(20), v_is_spice_file_transfer_enabled BOOLEAN, v_is_spice_copy_paste_enabled BOOLEAN, -v_cpu_profile_id UUID) +v_cpu_profile_id UUID, +v_custom_emulated_machine VARCHAR(40), +v_custom_cpu_name VARCHAR(40)) RETURNS VOID @@ -686,7 +692,9 @@ 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, - cpu_profile_id = v_cpu_profile_id + cpu_profile_id = v_cpu_profile_id, + custom_emulated_machine = v_custom_emulated_machine, + custom_cpu_name = v_custom_cpu_name WHERE vm_guid = v_vm_guid AND entity_type = 'VM'; END; $procedure$ -- To view, visit http://gerrit.ovirt.org/32546 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64d829aa6a68b1c97fb59d2a7a21351a00c92c40 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
