Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api,ui: multi arch improvements #10289

Draft
wants to merge 30 commits into
base: 4.20
Choose a base branch
from

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Jan 28, 2025

Description

This PR adds the following changes concerning multi-arch support:

  • Allow downloading and seeing of aarch64 systemVM template for KVM
  • Improvements in deployments of system VMs including VRs to allow trying deployment with different architecture templates. Operator can now have their routing template with same name for different architectures and CloudStack will attempt deployment with all of them based on the below config. Similarly, now CloudStack will attempt to deploy SSVM and CPVM with different architecture templates available.
  • Configuring preferred system VM architecture for a zone using config - system.vm.preferred.architecture
  • UI changes to display, select and filter architecture fields for resources.
  • API and UI changes to allow filtering resources using arch

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 5.52923% with 598 lines in your changes missing coverage. Please review.

Project coverage is 16.00%. Comparing base (c80b886) to head (c1750c8).
Report is 45 commits behind head on 4.20.

Files with missing lines Patch % Lines
...om/cloud/upgrade/SystemVmTemplateRegistration.java 0.00% 190 Missing ⚠️
.../java/com/cloud/storage/dao/VMTemplateDaoImpl.java 1.53% 64 Missing ⚠️
.../network/lb/InternalLoadBalancerVMManagerImpl.java 0.00% 62 Missing ⚠️
...om/cloud/consoleproxy/ConsoleProxyManagerImpl.java 0.00% 56 Missing ⚠️
...va/com/cloud/network/router/NetworkHelperImpl.java 0.00% 49 Missing ⚠️
utils/src/main/java/com/cloud/utils/HttpUtils.java 0.00% 36 Missing ⚠️
.../secondarystorage/SecondaryStorageManagerImpl.java 0.00% 35 Missing ⚠️
.../src/main/java/com/cloud/host/dao/HostDaoImpl.java 0.00% 14 Missing ⚠️
...ain/java/com/cloud/storage/StorageManagerImpl.java 0.00% 14 Missing ⚠️
...src/main/java/com/cloud/dc/dao/ClusterDaoImpl.java 0.00% 11 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##               4.20   #10289    +/-   ##
==========================================
  Coverage     15.99%   16.00%            
- Complexity    13081    13105    +24     
==========================================
  Files          5649     5651     +2     
  Lines        495648   496179   +531     
  Branches      60006    60088    +82     
==========================================
+ Hits          79265    79399   +134     
- Misses       407537   407915   +378     
- Partials       8846     8865    +19     
Flag Coverage Δ
uitests 4.00% <ø> (-0.01%) ⬇️
unittests 16.84% <5.52%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr shwstppr changed the title ui: multi arch improvements api,ui: multi arch improvements Jan 29, 2025
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12726

New zone-scope config added system.vm.preferred.architecture to allow deployment using specific architecture for system VMs including VRs.
Refactor and added checks for deployements

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr requested review from nvazquez and Pearl1594 March 11, 2025 12:08
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12736

@shwstppr
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@shwstppr a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Comment on lines 64 to 70
ConfigKey<String> SystemVmPreferredArchitecture = new ConfigKey<>("Advanced"
, String.class
, "system.vm.preferred.architecture"
, ""
, "Preferred architecture for the system VMs including virtual routers"
, true
, ConfigKey.Scope.Zone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have the commas at the end of each line instead of at the begginning?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use this constructor to define the configKey with kind: Select and specify options which probably would be helpful in the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 1762 to 1783
public List<Pair<HypervisorType, CPU.CPUArch>> listDistinctHypervisorArchTypes(final Long zoneId) {
List<Pair<HypervisorType, CPU.CPUArch>> hypervisorArchList = new ArrayList<>();
String selectSql = "SELECT DISTINCT hypervisor_type, arch FROM cloud.host WHERE removed IS NULL";
if (zoneId != null) {
selectSql += " AND data_center_id=" + zoneId;
}
TransactionLegacy txn = TransactionLegacy.currentTxn();
try {
PreparedStatement stmt = txn.prepareAutoCloseStatement(selectSql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
HypervisorType hypervisorType = HypervisorType.valueOf(rs.getString("hypervisor_type"));
CPU.CPUArch arch = CPU.CPUArch.fromType(rs.getString("arch"));
hypervisorArchList.add(new Pair<>(hypervisorType, arch));
}
} catch (SQLException ex) {
logger.error("DB exception {}", ex.getMessage(), ex);
return Collections.emptyList();
}
return hypervisorArchList;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

If possible can we include this method on GenericDaoBase accepting a table as parameter so then it can be invoked on ClusterDaoImpl and here just passing the different table to query from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nvazquez moving a method with specific columns in GenericDaoBase doesn't sound right to me.
I've refactored the code use SearchBuilder and SearchCriteria instead.

return templateName;
}

protected DomainRouterVO createOrUpdateInternalLb(DomainRouterVO internalLbVm, final long id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this method is unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-12650)

Copy link
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

Largely lgtm, left a small comment.

Comment on lines 64 to 70
ConfigKey<String> SystemVmPreferredArchitecture = new ConfigKey<>("Advanced"
, String.class
, "system.vm.preferred.architecture"
, ""
, "Preferred architecture for the system VMs including virtual routers"
, true
, ConfigKey.Scope.Zone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use this constructor to define the configKey with kind: Select and specify options which probably would be helpful in the UI.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 12749

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
shwstppr added a commit to shapeblue/cloudstack that referenced this pull request Mar 12, 2025
Based on changes from apache#10289

s390x support was added paritally with apache#10038

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants