Skip to content

ui,api,server: template categorization based on os #10773

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

Merged
merged 47 commits into from
Jun 10, 2025

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Apr 24, 2025

Description

Adds new interface for image selection (template/iso) for an instance in UI.
Old interface can still be used and it can be configured using UI configuration (config.json)

OS categories/Guest OS categories have been improved with ability to create new categories, delete an existing category, and marking a category as featured to allow it to show up in the UI in the image selection interface.

New APIs added:

  • addOsCategory
  • deleteOsCategory
  • updateOsCategory

APIs updated:

  • updateOsType
  • listTemplates
  • listOsCategories

Several improvements in UI especially related to forms - DeloyVM, ReinstallVM, CreateVnfAppliance, AddAutoscaleGroup.

DeployVM form can now be opened from template/ISO details view with query params.

Reorganized (removed and added some) OS categories to the following (in the same order):

1. Ubuntu
2. Debian
3. Fedora
4. CentOS
5. Rocky Linux
6. Alma Linux
7. Oracle
8. RedHat
9. SUSE
10. Windows
11. Other

Documentation PR: apache/cloudstack-documentation#500

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):

image

How Has This Been Tested?

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

@shwstppr shwstppr changed the title Deployvm improvements ui,api,server: template categorization based on os Apr 24, 2025
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 56.76275% with 195 lines in your changes missing coverage. Please review.

Project coverage is 16.61%. Comparing base (7632814) to head (c5c2f37).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...in/java/com/cloud/server/ManagementServerImpl.java 67.70% 27 Missing and 4 partials ⚠️
.../command/admin/guest/DeleteGuestOsCategoryCmd.java 0.00% 21 Missing ⚠️
.../command/admin/guest/UpdateGuestOsCategoryCmd.java 32.25% 21 Missing ⚠️
...m/cloud/resource/icon/dao/ResourceIconDaoImpl.java 0.00% 19 Missing ⚠️
...api/command/admin/guest/AddGuestOsCategoryCmd.java 31.81% 15 Missing ⚠️
...main/java/com/cloud/storage/GuestOSCategoryVO.java 45.00% 11 Missing ⚠️
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% 11 Missing ⚠️
...ain/java/com/cloud/storage/dao/GuestOSDaoImpl.java 0.00% 9 Missing ⚠️
...om/cloud/resourceicon/ResourceIconManagerImpl.java 0.00% 8 Missing ⚠️
...c/main/java/com/cloud/utils/db/GenericDaoBase.java 0.00% 7 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10773      +/-   ##
============================================
+ Coverage     16.57%   16.61%   +0.03%     
- Complexity    13868    13927      +59     
============================================
  Files          5719     5729      +10     
  Lines        507178   508070     +892     
  Branches      61571    61769     +198     
============================================
+ Hits          84085    84398     +313     
- Misses       413674   414236     +562     
- Partials       9419     9436      +17     
Flag Coverage Δ
uitests 3.93% <ø> (-0.04%) ⬇️
unittests 17.50% <56.76%> (+0.04%) ⬆️

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.

@DaanHoogland
Copy link
Contributor

looks nice. would be great for end-users.

Adds new interface for image selection (template/iso) for an instance in
UI.
Old interface can still be used and it can be configured using UI
configuration (config.json)

OS categories/Guest OS categories have been improved with ability to
create new categories, delete an existing category, and marking a
category as featured to allow it to show up in the UI in the image
selection interface.

New APIs added:
- addOsCategory
- deleteOsCategory
- updateOsCategory

APIs updated:
- updateOsType
- listTemplates
- listOsCategories

Several improvements in UI especially related to forms - DeloyVM,
ReinstallVM, CreateVnfAppliance, AddAutoscaleGroup.

DeployVM form can now be opened from template details view with query
params.

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr shwstppr force-pushed the deployvm-improvements branch from f9852f0 to 90294a6 Compare April 28, 2025 12:35
Signed-off-by: Abhishek Kumar <[email protected]>
@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 13202

show only required elements when query params are passed

Signed-off-by: Abhishek Kumar <[email protected]>
@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 13221

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr shwstppr requested a review from vishesh92 April 30, 2025 08:54
@vishesh92 vishesh92 requested a review from Copilot April 30, 2025 11:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an enhanced OS categorization interface for both the UI and API by adding new endpoints and updating existing ones to support operations such as adding, updating, and deleting OS categories. Key changes include:

  • New API commands for managing OS categories (add, update, delete).
  • Enhancements in the DAO and VO layers to support the new category properties such as featured and sortKey.
  • Updates to tests and response objects to incorporate the new fields.

Reviewed Changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
engine/schema/src/main/java/com/cloud/storage/dao/GuestOSDaoImpl.java Added a new method to list IDs by category.
engine/schema/src/main/java/com/cloud/storage/GuestOSCategoryDaoImpl.java Adjusted SQL count query for consistency.
engine/schema/src/main/java/com/cloud/storage/GuestOSCategoryVO.java Included new columns (featured, sortKey) with their getters/setters.
api/.../*.java Introduced and updated API commands and responses for managing OS categories.
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java Added new constant for ISO support.
api/src/main/java/com/cloud/server/ResourceTag.java Added a new resource tag for Guest OS category.
api/src/main/java/org/apache/cloudstack/api/ResponseGenerator.java Added response generation method for Guest OS categories.
api/src/main/java/org/apache/cloudstack/api/ManagementService.java Declared new methods for OS category operations.

@@ -71,7 +77,7 @@ public String getOsDisplayName() {
return osDisplayName;
}

public Map getDetails() {
public Map<String, String> getDetails() {
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

The getDetails() method initializes a new empty map and then checks if it is not empty, which will always return false, effectively ignoring the 'details' parameter intended to be processed. Also, remove the redundant semicolon in the map initialization ("new HashMap<>();;").

Copilot uses AI. Check for mistakes.

Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

shwstppr added 3 commits June 4, 2025 17:49
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr
Copy link
Contributor Author

shwstppr commented Jun 4, 2025

@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 13602

@shwstppr
Copy link
Contributor Author

shwstppr commented Jun 4, 2025

@blueorangutan test

@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

shwstppr commented Jun 4, 2025

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-13470)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54137 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10773-t13470-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-13471)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 63050 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10773-t13471-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Signed-off-by: Abhishek Kumar <[email protected]>
Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

Test Case Execution Result
Test the add guest os category api and UI Pass
Test the add guest os api and Ui Pass
Ui : Test the vm deployment form Pass
Test the ui improvements to the Templates/iso page Pass
Test the guest os mapping Pass

Screenshots

Screenshot 2025-06-10 at 3 06 37 PM
Screenshot 2025-06-10 at 3 06 22 PM
Screenshot 2025-06-10 at 3 05 52 PM

@rohityadavcloud rohityadavcloud marked this pull request as ready for review June 10, 2025 09:51
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

LGTM - great UX feature. I've always found the template/ISO selection confusing. Hope this will improve that significantly.

@rohityadavcloud rohityadavcloud merged commit bce17b6 into apache:main Jun 10, 2025
43 of 49 checks passed
@rohityadavcloud rohityadavcloud deleted the deployvm-improvements branch June 10, 2025 09:55
shwstppr added a commit that referenced this pull request Jun 12, 2025
Some statements to add new columns to cloud.guest_os_category have been
added twice by mistake as part of #10773. These statements are idempotent and won't affect
upgrade as such but better to cleanup

Signed-off-by: Abhishek Kumar <[email protected]>
shwstppr added a commit that referenced this pull request Jun 13, 2025
In PR #10773, 'AlmaLinux' was incorrectly written as 'Alma Linux' in the guest OS category name and OS classification. This PR corrects the naming to 'AlmaLinux'.

Signed-off-by: Abhishek Kumar <[email protected]>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Adds new interface for image selection (template/iso) for an instance in UI.
Old interface can still be used and it can be configured using UI configuration (config.json)

OS categories/Guest OS categories have been improved with ability to create new categories, delete an existing category, and marking a category as featured to allow it to show up in the UI in the image selection interface.

New APIs added:
- addOsCategory
- deleteOsCategory
- updateOsCategory

APIs updated:
- updateOsType
- listTemplates
- listOsCategories

Several improvements in UI especially related to forms - DeloyVM, ReinstallVM, CreateVnfAppliance, AddAutoscaleGroup.

DeployVM form can now be opened from template/ISO details view with query params.

Reorganized (removed and added some) OS categories to the following (in the same order):
```
1. Ubuntu
2. Debian
3. Fedora
4. CentOS
5. Rocky Linux
6. Alma Linux
7. Oracle
8. RedHat
9. SUSE
10. Windows
11. Other
```

Documentation PR: apache/cloudstack-documentation#500

Signed-off-by: Abhishek Kumar <[email protected]>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Some statements to add new columns to cloud.guest_os_category have been
added twice by mistake as part of apache#10773. These statements are idempotent and won't affect
upgrade as such but better to cleanup

Signed-off-by: Abhishek Kumar <[email protected]>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
In PR apache#10773, 'AlmaLinux' was incorrectly written as 'Alma Linux' in the guest OS category name and OS classification. This PR corrects the naming to 'AlmaLinux'.

Signed-off-by: Abhishek Kumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants