Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jul 30, 2025

Description

This PR adds support to list templates in ready state (new API parameter 'isready', similar to list ISOs), and UI to display Templates/ISOs in ready state wherever applicable.

The latest UI in main uses templatefilter 'all' and oscategoryid to list the templates, which is listing not ready templates as well. Earlier UI listed the templates using the appropriate templatefilters (featured, executable, selfexecutable) which lists only ready templates.

Fixes #11339

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

  • List ISOs
ListISOs
  • List ISOs in Deploy Instance Form
DeployVM-ListISO
  • List Templates
ListTemplates
  • List Templates in Deploy Instance Form
DeployVM-ListTemplates DeployVM-ListTemplates-Debug

How Has This Been Tested?

Verified list templates / ISOs call while registering new template / ISO.

(localcloud) 🐱 > list isos isofilter=all bootable=true filter=id,name,status,isready,ostypename
{
  "count": 2,
  "iso": [
    {
      "id": "852ad01e-96cd-4488-94ca-878d2a473222",
      "isready": true,
      "name": "CentOS-7",
      "ostypename": "CentOS 7",
      "status": "Successfully Installed"
    },
    {
      "id": "862cc57a-ada0-45aa-9c60-8e55c59ef4c3",
      "isready": false,
      "name": "CentOS-7-NewISO",
      "ostypename": "CentOS 7",
      "status": "26% Downloaded"
    }
  ]
}

(localcloud) 🐱 > list isos isofilter=all bootable=true isready=true filter=id,name,status,isready,ostypename
{
  "count": 1,
  "iso": [
    {
      "id": "852ad01e-96cd-4488-94ca-878d2a473222",
      "isready": true,
      "name": "CentOS-7",
      "ostypename": "CentOS 7",
      "status": "Successfully Installed"
    }
  ]
}

(localcloud) 🐱 > list templates templatefilter=all filter=id,name,status,isready,ostypename
{
  "count": 4,
  "template": [
    {
      "id": "a4a63917-26e5-4840-b5b5-089464200f41",
      "isready": true,
      "name": "centos7",
      "ostypename": "CentOS 7",
      "status": "Download Complete"
    },
    {
      "id": "20f0bc6e-ca82-4421-9840-378bb0756064",
      "isready": false,
      "name": "CentOS-7-NewTmpl",
      "ostypename": "CentOS 7",
      "status": "19% Downloaded"
    },
    {
      "id": "b880c853-6d39-11f0-aba0-1e004200030e",
      "isready": true,
      "name": "SystemVM Template (KVM)",
      "ostypename": "Debian GNU/Linux 5.0 (64-bit)",
      "status": "Download Complete"
    },
    {
      "id": "b88233a8-6d39-11f0-aba0-1e004200030e",
      "isready": true,
      "name": "CentOS 5.5(64-bit) no GUI (KVM)",
      "ostypename": "CentOS 5.5 (64-bit)",
      "status": "Download Complete"
    }
  ]
}

(localcloud) 🐱 > list templates templatefilter=all isready=true filter=id,name,status,isready,ostypename
{
  "count": 3,
  "template": [
    {
      "id": "a4a63917-26e5-4840-b5b5-089464200f41",
      "isready": true,
      "name": "centos7",
      "ostypename": "CentOS 7",
      "status": "Download Complete"
    },
    {
      "id": "b880c853-6d39-11f0-aba0-1e004200030e",
      "isready": true,
      "name": "SystemVM Template (KVM)",
      "ostypename": "Debian GNU/Linux 5.0 (64-bit)",
      "status": "Download Complete"
    },
    {
      "id": "b88233a8-6d39-11f0-aba0-1e004200030e",
      "isready": true,
      "name": "CentOS 5.5(64-bit) no GUI (KVM)",
      "ostypename": "CentOS 5.5 (64-bit)",
      "status": "Download Complete"
    }
  ]
}

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.17%. Comparing base (86827f8) to head (9c6837a).
⚠️ Report is 127 commits behind head on main.

Files with missing lines Patch % Lines
...ck/api/command/user/template/ListTemplatesCmd.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               main   #11343    +/-   ##
==========================================
  Coverage     17.17%   17.17%            
- Complexity    14985    15007    +22     
==========================================
  Files          5869     5869            
  Lines        521590   521727   +137     
  Branches      63485    63511    +26     
==========================================
+ Hits          89562    89604    +42     
- Misses       421962   422066   +104     
+ Partials      10066    10057     -9     
Flag Coverage Δ
uitests 3.75% <ø> (+<0.01%) ⬆️
unittests 18.15% <0.00%> (+<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.

@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

…, similar to list ISOs), and UI to display Templates/ISOs in ready state wherever applicable
@sureshanaparti sureshanaparti force-pushed the list-templates-in-ready-state branch from 1085330 to 840c713 Compare July 30, 2025 13:46
@sureshanaparti sureshanaparti marked this pull request as ready for review July 30, 2025 13:56
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@sureshanaparti a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/11343 (QA-JID-706)

@blueorangutan
Copy link

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

Copy link
Contributor

@slavkap slavkap left a comment

Choose a reason for hiding this comment

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

Thanks, @sureshanaparti, for the fix!
Code LGTM

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, verified manually

Marked a template as Not Ready state in template_store_ref table

The template was not listed in deploy vm wizard

Screenshot 2025-07-31 at 9 57 43 AM Screenshot 2025-07-31 at 9 57 36 AM

@sureshanaparti sureshanaparti merged commit 1f1e38f into apache:main Jul 31, 2025
23 of 26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 31, 2025
@sureshanaparti sureshanaparti deleted the list-templates-in-ready-state branch July 31, 2025 04:38
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
…, similar to list ISOs) (apache#11343)

* Support to list templates in ready state (new API parameter 'isready', similar to list ISOs), and UI to display Templates/ISOs in ready state wherever applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

UI - Not downloaded templates are shown on deploy new instance

5 participants