Frank Kobzik has uploaded a new change for review. Change subject: backend: RNG device sources reporting ......................................................................
backend: RNG device sources reporting This is a follow-up to original VirtIO RNG patches (18176, 18497). This patch adds - required rng sources to cluster (set by admin), - supported rng sources to host (reported by VDSM). The host-supported rng sources must comply with cluster-required rng sources, otherwise corresponding host is set to non-operational state. Configuration: - VirtioRngDeviceSupported config value which cluster versions are allowed to operate with virtio rng devices - ClusterRequiredRngSourcesDefault config value contains comma-separated value with rng device sources that are required by newly created clusters (e.g. "random,hwrng") (Notable) affected behavior: - rng device crud: - AddRngDeviceCommand: the rng device is not added when it's source doesn't comply with the cluster required rng sources - UpdateRngDeviceCommand - now when the admin weakens the rng sources requirements for a cluster but some VM in this cluster has a random number generator device with this source assigned, this device is deleted when UpdateRngDeviceCommand is invoked (which happens on VM/Template update). - cluster crud: - when adding/updating cluster, the logic checks if its version supports rng devices (configurable via VirtioRngDeviceSupported). Change-Id: Id60a39118aef439146e6f0f308eec84e1ccaab9a Signed-off-by: Frantisek Kobzik <[email protected]> Bug-Url: https://bugzilla.redhat.com/977079 --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractRngDeviceCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddRngDeviceCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateRngDeviceCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmRngDevice.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.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/queries/ConfigurationValues.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java M backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategyTest.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java M frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties M packaging/dbscripts/create_views.sql A packaging/dbscripts/upgrade/03_04_0160_add_rng_device_columns.sql M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql M packaging/dbscripts/vds_groups_sp.sql M packaging/dbscripts/vds_sp.sql 33 files changed, 155 insertions(+), 14 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/22258/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractRngDeviceCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractRngDeviceCommand.java index 26de07c..a968b35 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractRngDeviceCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractRngDeviceCommand.java @@ -10,6 +10,7 @@ import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.VmDevice; import org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.common.businessentities.VmTemplate; import org.ovirt.engine.core.common.errors.VdcBllMessages; import org.ovirt.engine.core.compat.Guid; @@ -50,6 +51,12 @@ return true; } + protected boolean isRngSourceCompatibleWithCluster() { + VDSGroup cluster = getClusterForEntity(); + VmRngDevice.Source source = getParameters().getRngDevice().getSource(); + return cluster.getRequiredRngSources().contains(source); + } + protected VDSGroup getClusterForEntity(){ Guid entityId = getParameters().getRngDevice().getVmId(); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddRngDeviceCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddRngDeviceCommand.java index 5168eb4..6be3a94 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddRngDeviceCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddRngDeviceCommand.java @@ -34,13 +34,20 @@ if (!super.canDoAction()) { return false; } + if (getParameters().getRngDevice() == null) { return failCanDoAction(VdcBllMessages.RNG_NOT_FOUND); } + if (!getRngDevices().isEmpty()) { return failCanDoAction(VdcBllMessages.RNG_ALREADY_EXISTS); } + if (!isRngSourceCompatibleWithCluster()) { + return failCanDoAction(VdcBllMessages.RNG_SOURCE_NOT_SUPPORTED); + } + return true; } + } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java index 5761888..b78fcb9 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsGroupCommand.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.bll.utils.PermissionSubject; import org.ovirt.engine.core.bll.utils.VersionSupport; import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.common.FeatureSupported; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.VdsGroupOperationParameters; import org.ovirt.engine.core.common.businessentities.StoragePool; @@ -156,6 +157,13 @@ if (result) { result = validateClusterPolicy(); } + // non-empty required sources list and rng-unsupported cluster version + if (result && !getVdsGroup().getRequiredRngSources().isEmpty() + && !FeatureSupported.virtIoRngSupported(getVdsGroup().getcompatibility_version())) { + addCanDoActionMessage(VdcBllMessages.RNG_SOURCE_NOT_SUPPORTED); + result = false; + } + return result; } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java index c2cc8eb..b958b98 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetNonOperationalVdsCommand.java @@ -134,6 +134,8 @@ return AuditLogType.GLUSTER_HOST_UUID_NOT_FOUND; case EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER: return AuditLogType.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER; + case RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER: + return AuditLogType.RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER; case UNTRUSTED: return AuditLogType.VDS_UNTRUSTED; default: diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateRngDeviceCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateRngDeviceCommand.java index e6efa4b..f9bf257 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateRngDeviceCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateRngDeviceCommand.java @@ -1,7 +1,9 @@ package org.ovirt.engine.core.bll; import org.ovirt.engine.core.common.action.RngDeviceParameters; +import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.businessentities.VmDevice; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.common.errors.VdcBllMessages; public class UpdateRngDeviceCommand extends AbstractRngDeviceCommand<RngDeviceParameters> { @@ -20,6 +22,16 @@ return failCanDoAction(VdcBllMessages.RNG_NOT_FOUND); } + if (!isRngSourceCompatibleWithCluster()) { + VmRngDevice device = getParameters().getRngDevice(); + log.infoFormat("RNG Device id: %s of VM id: %s is no more compatible with cluster. Removing the device.", + device.getId(), device.getVmId()); + + Backend.getInstance().runAction(VdcActionType.RemoveRngDevice, getParameters()); + + return failCanDoAction(VdcBllMessages.RNG_SOURCE_NOT_SUPPORTED); + } + return true; } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java index e6464a2..df4300c 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java @@ -6,6 +6,7 @@ import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.utils.VersionSupport; import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.common.FeatureSupported; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.action.VdcReturnValueBase; @@ -316,6 +317,12 @@ if (result) { result = validateClusterPolicy(); } + // non-empty required sources list and rng-unsupported cluster version + if (result && !getVdsGroup().getRequiredRngSources().isEmpty() + && !FeatureSupported.virtIoRngSupported(getVdsGroup().getcompatibility_version())) { + addCanDoActionMessage(VdcBllMessages.RNG_SOURCE_NOT_SUPPORTED); + result = false; + } return result; } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java index 18b5dfe..4c7196c 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java @@ -745,6 +745,8 @@ EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER(9604, AuditLogTimeInterval.MINUTE.getValue()), + RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER(9608, AuditLogTimeInterval.MINUTE.getValue()), + /** * A highly available virtual machine went down. */ diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java index d872e6d..8f1015b 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/NonOperationalReason.java @@ -19,7 +19,8 @@ EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER(11), UNTRUSTED(12), UNINITIALIZED(13), - CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER(14); + CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER(14), + RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER(15); private final int value; diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java index 7f7be68..d28db05 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; +import java.util.Set; import org.ovirt.engine.core.common.businessentities.network.Network; import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; import org.ovirt.engine.core.common.utils.ObjectUtils; @@ -1289,4 +1290,8 @@ public String getSupportedEmulatedMachines() { return mVdsDynamic.getSupportedEmulatedMachines(); } + + public Set<VmRngDevice.Source> getSupportedRngSources() { + return mVdsDynamic.getSupportedRngSources(); + } } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java index c8c8883..3721d6a 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDSGroup.java @@ -1,8 +1,10 @@ package org.ovirt.engine.core.common.businessentities; import java.io.Serializable; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -75,10 +77,13 @@ private Map<String, String> clusterPolicyProperties; private boolean detectEmulatedMachine; + private Set<VmRngDevice.Source> requiredRngSources; + public VDSGroup() { migrateOnError = MigrateOnErrorOptions.YES; name = ""; virtService = true; + requiredRngSources = new HashSet<VmRngDevice.Source>(); } @Override @@ -274,6 +279,10 @@ return detectEmulatedMachine; } + public Set<VmRngDevice.Source> getRequiredRngSources() { + return requiredRngSources; + } + @Override public int hashCode() { final int prime = 31; @@ -297,6 +306,7 @@ result = prime * result + (trustedService ? 1231 : 1237); result = prime * result + ((clusterPolicyName == null) ? 0 : clusterPolicyName.hashCode()); result = prime * result + (clusterPolicyProperties == null ? 0 : clusterPolicyProperties.hashCode()); + result = prime * result + (requiredRngSources == null ? 0 : requiredRngSources.hashCode()); result = prime * result + (enableBallooning ? 1231 : 1237); return result; } @@ -334,6 +344,7 @@ && ObjectUtils.objectsEqual(clusterPolicyName, other.clusterPolicyName) && ObjectUtils.objectsEqual(clusterPolicyProperties, other.clusterPolicyProperties) && enableBallooning == other.enableBallooning + && ObjectUtils.objectsEqual(requiredRngSources, other.requiredRngSources) && detectEmulatedMachine == other.detectEmulatedMachine); } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java index 8c36f2a..832332e 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; +import java.util.Set; import javax.validation.constraints.Size; import org.ovirt.engine.core.common.utils.ObjectUtils; @@ -135,6 +136,8 @@ */ private String supportedEmulatedMachines; + private Set<VmRngDevice.Source> supportedRngSources; + public void setVersion(RpmVersion value) { rpmVersion = value; } @@ -167,6 +170,7 @@ vm_count = 0; vms_cores_count = 0; guest_overhead = 0; + supportedRngSources = new HashSet<VmRngDevice.Source>(); } public Integer getcpu_cores() { @@ -573,6 +577,10 @@ this.nonOperationalReason = (nonOperationalReason == null ? NonOperationalReason.NONE : nonOperationalReason); } + public Set<VmRngDevice.Source> getSupportedRngSources() { + return supportedRngSources; + } + @Override public int hashCode() { final int prime = 31; @@ -617,6 +625,7 @@ result = prime * result + ((versionName == null) ? 0 : versionName.hashCode()); result = prime * result + ((vm_active == null) ? 0 : vm_active.hashCode()); result = prime * result + vm_count; + result = prime * result + ((supportedRngSources == null) ? 0 : supportedRngSources.hashCode()); result = prime * result + ((vm_migrating == null) ? 0 : vm_migrating.hashCode()); result = prime * result + ((vms_cores_count == null) ? 0 : vms_cores_count.hashCode()); result = prime * result + ((hwManufacturer == null) ? 0 : hwManufacturer.hashCode()); @@ -690,6 +699,7 @@ && ObjectUtils.objectsEqual(hwUUID, other.hwUUID) && ObjectUtils.objectsEqual(hwFamily, other.hwFamily) && ObjectUtils.objectsEqual(HBAs, other.HBAs) + && ObjectUtils.objectsEqual(supportedRngSources, other.supportedRngSources) && ObjectUtils.objectsEqual(supportedEmulatedMachines, other.supportedEmulatedMachines)); } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmRngDevice.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmRngDevice.java index 54713c0..5331b67 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmRngDevice.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmRngDevice.java @@ -1,8 +1,11 @@ package org.ovirt.engine.core.common.businessentities; import java.io.Serializable; +import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import org.ovirt.engine.core.compat.Guid; /** diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java index 1295101..9332561 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java @@ -1547,5 +1547,9 @@ @DefaultValueAttribute("300") HostPreparingForMaintenanceIdleTime, + @TypeConverterAttribute(String.class) + @DefaultValueAttribute("random") + ClusterRequiredRngSourcesDefault, + Invalid; } 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 8572414..7d3de61 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 @@ -839,6 +839,7 @@ //rng device RNG_NOT_FOUND(ErrorType.CONFLICT), RNG_ALREADY_EXISTS(ErrorType.CONFLICT), + RNG_SOURCE_NOT_SUPPORTED(ErrorType.CONFLICT), // network QoS ACTION_TYPE_FAILED_NETWORK_QOS_MISSING_VALUES(ErrorType.BAD_PARAMETERS), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java index c29cc78..701e78a 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java @@ -107,7 +107,8 @@ AttestationServer, DefaultGeneralTimeZone, DefaultWindowsTimeZone, - VirtIoRngDeviceSupported(ConfigAuthType.User); + VirtIoRngDeviceSupported(ConfigAuthType.User), + ClusterRequiredRngSourcesDefault(ConfigAuthType.User); public static enum ConfigAuthType { Admin, diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java index d264e89..09a06a3 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java @@ -345,6 +345,7 @@ severities.put(AuditLogType.VDS_ACTIVATE_FAILED_ASYNC, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS, AuditLogSeverity.WARNING); severities.put(AuditLogType.EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER, AuditLogSeverity.WARNING); + severities.put(AuditLogType.RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER, AuditLogSeverity.WARNING); severities.put(AuditLogType.VDS_TIME_DRIFT_ALERT, AuditLogSeverity.WARNING); severities.put(AuditLogType.PROXY_HOST_SELECTION, AuditLogSeverity.NORMAL); severities.put(AuditLogType.VDS_UNTRUSTED, AuditLogSeverity.ERROR); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java index 1f26158..3acc20f 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java @@ -12,6 +12,7 @@ import org.ovirt.engine.core.common.businessentities.VDSType; import org.ovirt.engine.core.common.businessentities.VdsSpmStatus; import org.ovirt.engine.core.common.businessentities.VdsTransparentHugePagesState; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.compat.RpmVersion; import org.ovirt.engine.core.compat.Version; @@ -339,6 +340,8 @@ entity.setConsoleAddress(rs.getString("console_address")); entity.setSupportedEmulatedMachines(rs.getString("supported_emulated_machines")); entity.setHighlyAvailableScore(rs.getInt("ha_score")); + entity.getSupportedRngSources().clear(); + entity.getSupportedRngSources().addAll(VmRngDevice.csvToSourcesSet(rs.getString("supported_rng_sources"))); entity.calculateFreeVirtualMemory(); return entity; } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java index 171ab20..2903a1a 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java @@ -10,6 +10,7 @@ import org.ovirt.engine.core.common.businessentities.VDSStatus; import org.ovirt.engine.core.common.businessentities.VdsDynamic; import org.ovirt.engine.core.common.businessentities.VdsTransparentHugePagesState; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.compat.RpmVersion; import org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils; @@ -154,6 +155,7 @@ .addValue("hw_uuid", vds.getHardwareUUID()) .addValue("hw_family", vds.getHardwareFamily()) .addValue("hbas", new JsonObjectSerializer().serialize(vds.getHBAs())) + .addValue("supported_rng_sources", VmRngDevice.sourcesToCsv(vds.getSupportedRngSources())) .addValue("supported_emulated_machines", vds.getSupportedEmulatedMachines()); getCallsHandler().executeModification("InsertVdsDynamic", parameterSource); @@ -213,6 +215,7 @@ .addValue("hw_uuid", vds.getHardwareUUID()) .addValue("hw_family", vds.getHardwareFamily()) .addValue("hbas", new JsonObjectSerializer().serialize(vds.getHBAs())) + .addValue("supported_rng_sources", VmRngDevice.sourcesToCsv(vds.getSupportedRngSources())) .addValue("supported_emulated_machines", vds.getSupportedEmulatedMachines()); getCallsHandler().executeModification("UpdateVdsDynamic", parameterSource); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java index af94bab..322e11c 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java @@ -8,6 +8,7 @@ import org.ovirt.engine.core.common.businessentities.ActionGroup; import org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions; import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils; @@ -176,6 +177,7 @@ .addValue("virt_service", group.supportsVirtService()) .addValue("gluster_service", group.supportsGlusterService()) .addValue("tunnel_migration", group.isTunnelMigration()) + .addValue("required_rng_sources", VmRngDevice.sourcesToCsv(group.getRequiredRngSources())) .addValue("emulated_machine", group.getEmulatedMachine()) .addValue("detect_emulated_machine", group.isDetectEmulatedMachine()) .addValue("trusted_service", group.supportsTrustedService()) @@ -214,6 +216,8 @@ entity.setVirtService(rs.getBoolean("virt_service")); entity.setGlusterService(rs.getBoolean("gluster_service")); entity.setTunnelMigration(rs.getBoolean("tunnel_migration")); + entity.getRequiredRngSources().clear(); + entity.getRequiredRngSources().addAll(VmRngDevice.csvToSourcesSet(rs.getString("required_rng_sources"))); entity.setEmulatedMachine(rs.getString("emulated_machine")); entity.setDetectEmulatedMachine(rs.getBoolean("detect_emulated_machine")); entity.setTrustedService(rs.getBoolean("trusted_service")); diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties index 88f5cb6..feea766 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties @@ -591,6 +591,7 @@ ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES=While adding vm ${EntityName} from snapshot, the Network/s ${Networks} were found to be Non-VM Networks or do not exist in Cluster. Network Name was not set in the Interface/s ${Interfaces}. VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS=Host ${VdsName} does not comply with the cluster ${VdsGroupName} networks, the following VM networks are non-VM networks: '${Networks}' EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER=Host ${VdsName} does not comply with the cluster ${VdsGroupName} emulated machines. The Hosts emulated machines are ${hostSupportedEmulatedMachines} and the cluster is ${clusterEmulatedMachines}} +RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER=Host ${VdsName} does not comply with the cluster ${VdsGroupName} Random Number Generator sources. The Hosts supported sources are: ${hostSupportedRngSources}; and the cluster requirements are: ${clusterRequiredRngSources}.} # Gluster Messages GLUSTER_VOLUME_CREATE=Gluster Volume ${glusterVolumeName} created. GLUSTER_VOLUME_CREATE_FAILED=Creation of Gluster Volume ${glusterVolumeName} failed. diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java index a990586..9632f96 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategy.java @@ -10,6 +10,7 @@ import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.businessentities.VDSGroup; import org.ovirt.engine.core.common.businessentities.VDSStatus; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.common.config.Config; import org.ovirt.engine.core.common.config.ConfigValues; import org.ovirt.engine.core.common.utils.ListUtils; @@ -63,6 +64,18 @@ vds.setStatus(VDSStatus.NonOperational); } + if (!hostCompliesWithRngDeviceSources(vds, vdsGroup) && vds.getStatus() != VDSStatus.NonOperational) { + Map<String, String> customLogValues = new HashMap<>(); + customLogValues.put("hostSupportedRngSources", VmRngDevice.sourcesToCsv(vds.getSupportedRngSources())); + customLogValues.put("clusterRequiredRngSources", VmRngDevice.sourcesToCsv(vdsGroup.getRequiredRngSources())); + + vdsNonOperational(vds, NonOperationalReason.RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER, customLogValues); + vds.setStatus(VDSStatus.NonOperational); + } + } + + private boolean hostCompliesWithRngDeviceSources(VDS vds, VDSGroup vdsGroup) { + return vds.getSupportedRngSources().containsAll(vdsGroup.getRequiredRngSources()); } @Override diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java index 722395b..61cfcb4 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java @@ -31,6 +31,7 @@ import org.ovirt.engine.core.common.businessentities.VmExitStatus; import org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface; import org.ovirt.engine.core.common.businessentities.VmPauseStatus; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.common.businessentities.VmStatistics; import org.ovirt.engine.core.common.businessentities.network.InterfaceStatus; import org.ovirt.engine.core.common.businessentities.network.Network; @@ -348,7 +349,8 @@ vds.setSupportedEmulatedMachines(AssignStringValueFromArray(xmlRpcStruct, VdsProperties.emulatedMachines)); - // todo process rngSources too + vds.getSupportedRngSources().clear(); + vds.getSupportedRngSources().addAll(VmRngDevice.csvToSourcesSet(AssignStringValueFromArray(xmlRpcStruct, VdsProperties.rngSources))); String hooksStr = ""; // default value if hooks is not in the xml rpc struct if (xmlRpcStruct.containsKey(VdsProperties.hooks)) { diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java index 605e032..c8edc69 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java @@ -110,6 +110,7 @@ public static final String supported_engines = "supportedENGINEs"; public static final String emulatedMachine = "emulatedMachine"; public static final String emulatedMachines = "emulatedMachines"; + public static final String rngSources = "rngSources"; public static final String host_os = "operatingSystem"; public static final String packages = "packages"; public static final String packages2 = "packages2"; diff --git a/backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategyTest.java b/backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategyTest.java index 1bffd74..2beeecf 100644 --- a/backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategyTest.java +++ b/backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/VirtMonitoringStrategyTest.java @@ -14,6 +14,7 @@ import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.businessentities.VDSGroup; import org.ovirt.engine.core.common.businessentities.VDSStatus; +import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dao.VdsGroupDAO; @@ -52,6 +53,7 @@ public void testProcessSpecialSoftwareCapabilities() { VDS vds = new VDS(); vds.setSupportedEmulatedMachines("pc-1.0"); + vds.getSupportedRngSources().add(VmRngDevice.Source.RANDOM); vds.setStatus(VDSStatus.Up); virtStrategy.processSoftwareCapabilities(vds); assertTrue(vds.getStatus().equals(VDSStatus.Up)); @@ -59,6 +61,13 @@ virtStrategy.processSoftwareCapabilities(vds); assertTrue(vds.getStatus().equals(VDSStatus.Up)); vds.setKvmEnabled(Boolean.FALSE); + virtStrategy.processSoftwareCapabilities(vds); + assertTrue(vds.getStatus().equals(VDSStatus.NonOperational)); + vds.setKvmEnabled(Boolean.TRUE); + vds.setStatus(VDSStatus.Up); + virtStrategy.processSoftwareCapabilities(vds); + assertTrue(vds.getStatus().equals(VDSStatus.Up)); + vds.getSupportedRngSources().clear(); virtStrategy.processSoftwareCapabilities(vds); assertTrue(vds.getStatus().equals(VDSStatus.NonOperational)); } @@ -88,6 +97,7 @@ VdsGroupDAO mock = mock(VdsGroupDAO.class); VDSGroup value = new VDSGroup(); value.setEmulatedMachine("pc-1.0"); + value.getRequiredRngSources().add(VmRngDevice.Source.RANDOM); org.mockito.Mockito.when(mock.get(any(Guid.class))).thenReturn(value); return mock; } diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java index 1a3bbd9..fefc08d 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java @@ -34,6 +34,8 @@ String NonOperationalReason___EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER(); + String NonOperationalReason___RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER(); + String UsbPolicy___ENABLED_LEGACY(); String UsbPolicy___ENABLED_NATIVE(); diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index 249ba59..cb41adb 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -2083,7 +2083,7 @@ @DefaultStringValue("If period is specified, bytes per period must be specified as well.") String rngRateInvalid(); - @DefaultStringValue("Random Number Generator not supported for this cluster level or is disabled in the engine config.") - String rngNotSupported(); + @DefaultStringValue("Random Number Generator requirements must be set in Cluster.") + String rngNotSupportedByCluster(); } diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java index ca4c173..06eb8fc 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java @@ -324,4 +324,7 @@ @DefaultMessage("Cannot connect to the console for {0}") String cannotConnectToTheConsole(String vmName); + + @DefaultMessage("Random Number Generator source ''{0}'' is not supported by the cluster") + String rngSourceNotSupportedByCluster(String source); } diff --git a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties index 5446f53..1802edd 100644 --- a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties +++ b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties @@ -11,6 +11,7 @@ NonOperationalReason___GLUSTER_COMMAND_FAILED=Gluster command failed on server. NonOperationalReason___GLUSTER_HOST_UUID_NOT_FOUND=Could not find Gluster UUID of the server. NonOperationalReason___EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER=The Host emulated machine flags doesn't match one of the cluster emulated machines. +NonOperationalReason___RNG_SOURCES_INCOMPATIBLE_WITH_CLUSTER=The Host supported Random Number Generator sources doesn't comply with sources required by Cluster. NonOperationalReason___UNTRUSTED=Host is untrusted. NonOperationalReason___UNINITIALIZED=Host is uninitialized as it is not attested yet. UsbPolicy___ENABLED_LEGACY=Legacy diff --git a/packaging/dbscripts/create_views.sql b/packaging/dbscripts/create_views.sql index d2b8b2d..61ec5aa 100644 --- a/packaging/dbscripts/create_views.sql +++ b/packaging/dbscripts/create_views.sql @@ -701,7 +701,7 @@ vds_dynamic.transparent_hugepages_state as transparent_hugepages_state, vds_dynamic.anonymous_hugepages as anonymous_hugepages, vds_dynamic.non_operational_reason as non_operational_reason, vds_static.recoverable as recoverable, vds_static.sshKeyFingerprint as sshKeyFingerprint, vds_dynamic.hw_manufacturer as hw_manufacturer, vds_dynamic.hw_product_name as hw_product_name, vds_dynamic.hw_version as hw_version, vds_dynamic.hw_serial_number as hw_serial_number, vds_dynamic.hw_uuid as hw_uuid, vds_dynamic.hw_family as hw_family, vds_static.console_address as console_address, - vds_dynamic.hbas as hbas, vds_dynamic.supported_emulated_machines as supported_emulated_machines, vds_static.ssh_port as ssh_port, vds_static.ssh_username as ssh_username, vds_statistics.ha_score as ha_score + vds_dynamic.hbas as hbas, vds_dynamic.supported_emulated_machines as supported_emulated_machines, vds_dynamic.supported_rng_sources as supported_rng_sources, vds_static.ssh_port as ssh_port, vds_static.ssh_username as ssh_username, vds_statistics.ha_score as ha_score FROM vds_groups INNER JOIN vds_static ON vds_groups.vds_group_id = vds_static.vds_group_id INNER JOIN vds_dynamic ON vds_static.vds_id = vds_dynamic.vds_id INNER JOIN diff --git a/packaging/dbscripts/upgrade/03_04_0160_add_rng_device_columns.sql b/packaging/dbscripts/upgrade/03_04_0160_add_rng_device_columns.sql new file mode 100644 index 0000000..3d30500 --- /dev/null +++ b/packaging/dbscripts/upgrade/03_04_0160_add_rng_device_columns.sql @@ -0,0 +1,4 @@ +-- rng sources required by cluster +select fn_db_add_column('vds_groups', 'required_rng_sources', 'varchar(255)'); +-- rng sources supported by host +select fn_db_add_column('vds_dynamic', 'supported_rng_sources', 'varchar(255)'); diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql index f946922..1e84f6b 100644 --- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql +++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql @@ -227,6 +227,13 @@ select fn_db_add_config_value('HotPlugDiskSnapshotSupported','false','3.1'); select fn_db_add_config_value('HotPlugDiskSnapshotSupported','false','3.2'); +-- default requirement for rng sources (comma-separated string of 'random' and 'hwrng') +select fn_db_add_config_value('ClusterRequiredRngSourcesDefault','','3.0'); +select fn_db_add_config_value('ClusterRequiredRngSourcesDefault','','3.1'); +select fn_db_add_config_value('ClusterRequiredRngSourcesDefault','','3.2'); +select fn_db_add_config_value('ClusterRequiredRngSourcesDefault','','3.3'); +select fn_db_add_config_value('ClusterRequiredRngSourcesDefault','random','3.4'); + -- by default use no proxy select fn_db_add_config_value('SpiceProxyDefault','','general'); diff --git a/packaging/dbscripts/vds_groups_sp.sql b/packaging/dbscripts/vds_groups_sp.sql index 00217b3..63928cd 100644 --- a/packaging/dbscripts/vds_groups_sp.sql +++ b/packaging/dbscripts/vds_groups_sp.sql @@ -27,15 +27,16 @@ v_trusted_service BOOLEAN, v_cluster_policy_id UUID, v_cluster_policy_custom_properties text, + v_required_rng_sources varchar(255), v_enable_balloon BOOLEAN) RETURNS VOID AS $procedure$ BEGIN INSERT INTO vds_groups(vds_group_id,description, name, free_text_comment, cpu_name, storage_pool_id, max_vds_memory_over_commit, count_threads_as_cores, compatibility_version, transparent_hugepages, migrate_on_error, virt_service, gluster_service, tunnel_migration, emulated_machine, detect_emulated_machine, trusted_service, cluster_policy_id, - cluster_policy_custom_properties, enable_balloon) + cluster_policy_custom_properties, required_rng_sources, enable_balloon) VALUES(v_vds_group_id,v_description, v_name, v_free_text_comment, v_cpu_name, v_storage_pool_id, v_max_vds_memory_over_commit, v_count_threads_as_cores, v_compatibility_version, - v_transparent_hugepages, v_migrate_on_error, v_virt_service, v_gluster_service, v_tunnel_migration, v_emulated_machine, v_detect_emulated_machine, v_trusted_service, v_cluster_policy_id, v_cluster_policy_custom_properties, v_enable_balloon); + v_transparent_hugepages, v_migrate_on_error, v_virt_service, v_gluster_service, v_tunnel_migration, v_emulated_machine, v_detect_emulated_machine, v_trusted_service, v_cluster_policy_id, v_cluster_policy_custom_properties, v_required_rng_sources, v_enable_balloon); END; $procedure$ LANGUAGE plpgsql; @@ -62,6 +63,7 @@ v_trusted_service BOOLEAN, v_cluster_policy_id UUID, v_cluster_policy_custom_properties text, + v_required_rng_sources varchar(255), v_enable_balloon BOOLEAN) RETURNS VOID @@ -77,7 +79,7 @@ migrate_on_error = v_migrate_on_error, virt_service = v_virt_service, gluster_service = v_gluster_service, tunnel_migration = v_tunnel_migration, emulated_machine = v_emulated_machine, detect_emulated_machine = v_detect_emulated_machine, trusted_service = v_trusted_service, cluster_policy_id = v_cluster_policy_id, - cluster_policy_custom_properties = v_cluster_policy_custom_properties, enable_balloon = v_enable_balloon + cluster_policy_custom_properties = v_cluster_policy_custom_properties, required_rng_sources = v_required_rng_sources, enable_balloon = v_enable_balloon WHERE vds_group_id = v_vds_group_id; END; $procedure$ LANGUAGE plpgsql; diff --git a/packaging/dbscripts/vds_sp.sql b/packaging/dbscripts/vds_sp.sql index e8ebdcc..f041453 100644 --- a/packaging/dbscripts/vds_sp.sql +++ b/packaging/dbscripts/vds_sp.sql @@ -185,14 +185,15 @@ v_hw_uuid VARCHAR(255), v_hw_family VARCHAR(255), v_hbas VARCHAR(255), - v_supported_emulated_machines VARCHAR(255)) + v_supported_emulated_machines VARCHAR(255), + v_supported_rng_sources VARCHAR(255)) RETURNS VOID AS $procedure$ BEGIN BEGIN -INSERT INTO vds_dynamic(cpu_cores, cpu_threads, cpu_model, cpu_speed_mh, if_total_speed, kvm_enabled, mem_commited, physical_mem_mb, status, vds_id, vm_active, vm_count, vm_migrating, reserved_mem, guest_overhead, rpm_version, software_version, version_name, build_name, previous_status, cpu_flags, cpu_over_commit_time_stamp, vms_cores_count, pending_vcpus_count, pending_vmem_size, cpu_sockets,net_config_dirty, supported_cluster_levels, supported_engines, host_os, kvm_version, libvirt_version, spice_version, gluster_version, kernel_version, iscsi_initiator_name, transparent_hugepages_state, anonymous_hugepages,hooks, hw_manufacturer, hw_product_name, hw_version, hw_serial_number, hw_uuid, hw_family, hbas, supported_emulated_machines) - VALUES(v_cpu_cores, v_cpu_threads, v_cpu_model, v_cpu_speed_mh, v_if_total_speed, v_kvm_enabled, v_mem_commited, v_physical_mem_mb, v_status, v_vds_id, v_vm_active, v_vm_count, v_vm_migrating, v_reserved_mem, v_guest_overhead, v_rpm_version, v_software_version, v_version_name, v_build_name, v_previous_status, v_cpu_flags, v_cpu_over_commit_time_stamp, v_vms_cores_count,v_pending_vcpus_count, v_pending_vmem_size, v_cpu_sockets, v_net_config_dirty, v_supported_cluster_levels, v_supported_engines, v_host_os, v_kvm_version, v_libvirt_version, v_spice_version, v_gluster_version, v_kernel_version, v_iscsi_initiator_name, v_transparent_hugepages_state, v_anonymous_hugepages,v_hooks, v_hw_manufacturer, v_hw_product_name, v_hw_version, v_hw_serial_number, v_hw_uuid, v_hw_family, v_hbas, v_supported_emulated_machines); +INSERT INTO vds_dynamic(cpu_cores, cpu_threads, cpu_model, cpu_speed_mh, if_total_speed, kvm_enabled, mem_commited, physical_mem_mb, status, vds_id, vm_active, vm_count, vm_migrating, reserved_mem, guest_overhead, rpm_version, software_version, version_name, build_name, previous_status, cpu_flags, cpu_over_commit_time_stamp, vms_cores_count, pending_vcpus_count, pending_vmem_size, cpu_sockets,net_config_dirty, supported_cluster_levels, supported_engines, host_os, kvm_version, libvirt_version, spice_version, gluster_version, kernel_version, iscsi_initiator_name, transparent_hugepages_state, anonymous_hugepages,hooks, hw_manufacturer, hw_product_name, hw_version, hw_serial_number, hw_uuid, hw_family, hbas, supported_emulated_machines, supported_rng_sources) + VALUES(v_cpu_cores, v_cpu_threads, v_cpu_model, v_cpu_speed_mh, v_if_total_speed, v_kvm_enabled, v_mem_commited, v_physical_mem_mb, v_status, v_vds_id, v_vm_active, v_vm_count, v_vm_migrating, v_reserved_mem, v_guest_overhead, v_rpm_version, v_software_version, v_version_name, v_build_name, v_previous_status, v_cpu_flags, v_cpu_over_commit_time_stamp, v_vms_cores_count,v_pending_vcpus_count, v_pending_vmem_size, v_cpu_sockets, v_net_config_dirty, v_supported_cluster_levels, v_supported_engines, v_host_os, v_kvm_version, v_libvirt_version, v_spice_version, v_gluster_version, v_kernel_version, v_iscsi_initiator_name, v_transparent_hugepages_state, v_anonymous_hugepages,v_hooks, v_hw_manufacturer, v_hw_product_name, v_hw_version, v_hw_serial_number, v_hw_uuid, v_hw_family, v_hbas, v_supported_emulated_machines, v_supported_rng_sources); END; RETURN; @@ -250,7 +251,8 @@ v_hw_uuid VARCHAR(255), v_hw_family VARCHAR(255), v_hbas VARCHAR(255), - v_supported_emulated_machines VARCHAR(255)) + v_supported_emulated_machines VARCHAR(255), + v_supported_rng_sources VARCHAR(255)) RETURNS VOID --The [vds_dynamic] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated @@ -281,7 +283,8 @@ _update_date = LOCALTIMESTAMP,non_operational_reason = v_non_operational_reason, hw_manufacturer = v_hw_manufacturer, hw_product_name = v_hw_product_name, hw_version = v_hw_version, hw_serial_number = v_hw_serial_number, - hw_uuid = v_hw_uuid, hw_family = v_hw_family, hbas = v_hbas, supported_emulated_machines = v_supported_emulated_machines + hw_uuid = v_hw_uuid, hw_family = v_hw_family, hbas = v_hbas, supported_emulated_machines = v_supported_emulated_machines, + supported_rng_sources = v_supported_rng_sources WHERE vds_id = v_vds_id; END; -- To view, visit http://gerrit.ovirt.org/22258 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id60a39118aef439146e6f0f308eec84e1ccaab9a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Frank Kobzik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
