Skip to content

ARM support engine changes#1063

Open
shubhaOracle wants to merge 1 commit intooVirt:masterfrom
shubhaOracle:arm-changes
Open

ARM support engine changes#1063
shubhaOracle wants to merge 1 commit intooVirt:masterfrom
shubhaOracle:arm-changes

Conversation

@shubhaOracle
Copy link
Contributor

@shubhaOracle shubhaOracle commented Sep 18, 2025

Signed-off-by: ShubhaOracle [email protected]

Fixes issue # (delete if not relevant)

Changes introduced with this PR

  • Updated the engine code to add support for ARM/aarch64 support. Added new architecture type, bios type, and 'virt' for CPU model detection.
  • Associated VDSM changes are added with PR ARM support VDSM changes vdsm#436

Are you the owner of the code you are sending in, or do you have permission of the owner?

[y/n]Yes

Signed-off-by: ShubhaOracle <[email protected]>
Copy link
Member

@dupondje dupondje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also missing tests.
Cause nothing is added to tests now...

.when(FeatureSupported.isBiosTypeSupported(eCluster.getCompatibilityVersion())
&& eCluster.getBiosType() != null
&& eCluster.getBiosType() != BiosType.I440FX_SEA_BIOS
&& eCluster.getBiosType() != BiosType.AMPERE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should validate BiosType together with Architecture.
So that you don't select BiosType.AMPERE on X86 for example.

Next to that, name the BiosType VIRT/VIRT_AAVMF ?
This patch is not ampere-only...

public ValidationResult nonDefaultBiosType() {
Cluster eCluster = newCluster != null ? newCluster : cluster;
ArchitectureType architecture = getArchitecture();
return ValidationResult.failWith(EngineMessage.NON_DEFAULT_BIOS_TYPE_FOR_X86_ONLY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should also change then.

public static ValidationResult isBiosTypeSupported(VmBase vmBase, Cluster cluster, OsRepository osRepository) {
if (FeatureSupported.isBiosTypeSupported(cluster.getCompatibilityVersion())
&& vmBase.getBiosType() != BiosType.I440FX_SEA_BIOS
&& vmBase.getBiosType() != BiosType.AMPERE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

}

// For aarch64, always use host cpu flags
if (getCluster().getArchitecture().getFamily() == ArchitectureType.aarch64) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not do it this way.
When adding the CPU in the ServerCPUList in packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql, I would for example there put no CPU flags.
If you then create a VM with a CPU without CPU flags, it should use auto-passtrough/host cpu flags.

This has the advantage that in the future we can just add new ARM CPU's without messing in the code again.

} else if (sc.getFlags().contains(CpuVendor.IBMS390.getFlag())) {
s390CpuByNameDictionary.put(sc.getCpuName(), sc);
s390CpuByVdsNameDictionary.put(sc.getVdsVerbData(), sc);
} else if (sc.getFlags().contains(CpuVendor.ARM.getFlag())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name it AARCH64 instead of ARM


protected void buildModel(VmBase vmBase,
BuilderExecutor.BuilderExecutionFinished<VmBase, UnitVmModel> callback) {
BuilderExecutor.BuilderExecutionFinished<VmBase, UnitVmModel> callback) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded change

os.ubuntu_16_04_aarch64.id.value = 3006
os.ubuntu_16_04_aarch64.name.value = Ubuntu Xenial Xerus LTS+
os.ubuntu_16_04_aarch64.derivedFrom.value = other_linux_aarch64

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add some more/recent OS'es

select fn_db_update_config_value('ClusterEmulatedMachines','pc-q35-rhel8.1.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.1.0,s390-ccw-virtio-2.12','4.4');
select fn_db_update_config_value('ClusterEmulatedMachines','pc-q35-rhel8.3.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.3.0,s390-ccw-virtio-2.12','4.5');
-- aarch64 emulated machine types
select fn_db_update_config_value('ClusterEmulatedMachines','pc-q35-rhel8.6.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.4.0,s390-ccw-virtio-2.12,virt,virt-6.0,virt-6.1,virt-6.2','4.7');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What virt types does qemu-aarch64 had on RHEL9 and RHEL10?

select fn_db_update_config_value('IsMigrationSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true"}','4.2');
select fn_db_update_config_value('IsMemorySnapshotSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true"}','4.2');
select fn_db_update_config_value('IsSuspendSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true"}','4.2');
select fn_db_update_config_value('IsMigrationSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true", "aarch64" : "true"}','4.7'); +select fn_db_update_config_value('IsMemorySnapshotSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true", "aarch64" : "true"}','4.7');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid line

select fn_db_update_config_value('IsMemorySnapshotSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true"}','4.2');
select fn_db_update_config_value('IsSuspendSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true"}','4.2');
select fn_db_update_config_value('IsMigrationSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true", "aarch64" : "true"}','4.7'); +select fn_db_update_config_value('IsMemorySnapshotSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true", "aarch64" : "true"}','4.7');
select fn_db_update_config_value('IsSuspendSupported','{"undefined": "true", "x86": "true", "ppc" : "true", "s390x" : "true", "aarch64" : "true"}','4.7');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only want to support 4.7 ? (Now already 4.8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants