Skip to content

Conversation

@Pearl1594
Copy link
Contributor

@Pearl1594 Pearl1594 commented Sep 5, 2025

Description

This PR allows listing snapshot policies and backup schedules without tying them to volume ids and vm ids respectively, to get the entire list.

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

Screenshots (if appropriate):

Backup Schedule:

image

Creation of backup schedule from Backup schedule list view:
image

image

Snapshot Policy

image image image

Switch between volumes or instances for snapshot policy creation or backup schedule creation from the list view, results in refresh of the list of policies present of the resource in context.

Search filter for snapshot policies, lets you filter by volumes:
image

Search filter for backup schedules, lets you filter by instances:
image

How Has This Been Tested

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

@Pearl1594 Pearl1594 changed the title API: Add support to list all snapshot policies & backup schedules [WIP] API: Add support to list all snapshot policies & backup schedules Sep 5, 2025
@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 54.63415% with 93 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (f67b738) to head (016b608).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...org/apache/cloudstack/backup/BackupScheduleVO.java 0.00% 21 Missing ⚠️
.../main/java/com/cloud/storage/SnapshotPolicyVO.java 14.28% 18 Missing ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 34.61% 15 Missing and 2 partials ⚠️
...ava/com/cloud/upgrade/dao/Upgrade42100to42200.java 77.55% 11 Missing ⚠️
...rg/apache/cloudstack/backup/BackupManagerImpl.java 72.50% 5 Missing and 6 partials ⚠️
...om/cloud/storage/snapshot/SnapshotManagerImpl.java 76.47% 3 Missing and 5 partials ⚠️
...api/command/user/backup/ListBackupScheduleCmd.java 62.50% 3 Missing ⚠️
...loudstack/api/response/SnapshotPolicyResponse.java 0.00% 3 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11587      +/-   ##
============================================
+ Coverage     17.54%   17.56%   +0.01%     
- Complexity    15483    15498      +15     
============================================
  Files          5897     5898       +1     
  Lines        527484   527778     +294     
  Branches      64432    64473      +41     
============================================
+ Hits          92566    92703     +137     
- Misses       424508   424651     +143     
- Partials      10410    10424      +14     
Flag Coverage Δ
uitests 3.59% <ø> (-0.01%) ⬇️
unittests 18.62% <54.63%> (+0.02%) ⬆️

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.

@bernardodemarco bernardodemarco self-requested a review September 6, 2025 17:58
@Pearl1594 Pearl1594 closed this Sep 8, 2025
@Pearl1594 Pearl1594 reopened this Sep 8, 2025
@Pearl1594 Pearl1594 closed this Sep 9, 2025
@Pearl1594 Pearl1594 reopened this Sep 9, 2025
@Pearl1594 Pearl1594 changed the title [WIP] API: Add support to list all snapshot policies & backup schedules API: Add support to list all snapshot policies & backup schedules Sep 10, 2025
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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 14924

@harikrishna-patnala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@harikrishna-patnala 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14928

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

[SF] Trillian test result (tid-14497)
Environment: vmware-70u3 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59186 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14497-vmware-70u3.zip
Smoke tests completed. 144 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_deploy_more_vms_than_limit_allows Error 148.81 test_deploy_vms_in_parallel.py
test_01_deployVMInSharedNetwork Error 421.42 test_network.py
test_01_vpn_usage Error 1.12 test_usage.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-14496)
Environment: kvm-ubuntu22 (x2), zone: Advanced Networking with Mgmt server u22
Total time taken: 61462 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14496-kvm-ubuntu22.zip
Smoke tests completed. 146 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_hostha_enable_ha_when_host_disabled Error 3.08 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 306.20 test_hostha_kvm.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-14501)
Environment: vmware-70u3 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 60674 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14501-vmware-70u3.zip
Smoke tests completed. 145 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_deployVMInSharedNetwork Error 401.98 test_network.py
test_01_vpn_usage Error 1.11 test_usage.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-14502)
Environment: xcpng82 (x2), zone: Advanced Networking with Mgmt server ol9
Total time taken: 79044 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14502-xcpng82.zip
Smoke tests completed. 140 look OK, 7 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 217.65 test_events_resource.py
test_01_non_strict_host_anti_affinity Error 218.29 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 84.69 test_nonstrict_affinity_group.py
test_01_primary_storage_iscsi Error 0.86 test_primary_storage.py
test_02_list_cpvm_vm Failure 0.05 test_ssvm.py
test_04_cpvm_internals Failure 0.05 test_ssvm.py
test_01_vpn_usage Error 1.14 test_usage.py
test_11_destroy_vm_and_volumes Error 21.06 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 61.33 test_vm_strict_host_tags.py

Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing.

@rohityadavcloud
Copy link
Member

@Pearl1594 can you address the merge conflicts and rekick tests, thank you.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15318

@DaanHoogland
Copy link
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins matrix job (EL8 mgmt + EL8 KVM, Ubuntu22 mgmt + Ubuntu22 KVM, EL8 mgmt + VMware 7.0u3, EL9 mgmt + XCP-ng 8.2 ) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14566)

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14567)

@harikrishna-patnala
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@harikrishna-patnala 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-14565)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56533 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14565-kvm-ol8.zip
Smoke tests completed. 146 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_deployVMInSharedNetwork Failure 636.17 test_network.py
test_01_redundant_vpc_site2site_vpn Failure 431.17 test_vpc_vpn.py

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@blueorangutan
Copy link

[SF] Trillian test result (tid-14568)
Environment: xcpng82 (x2), zone: Advanced Networking with Mgmt server ol9
Total time taken: 84896 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11587-t14568-xcpng82.zip
Smoke tests completed. 135 look OK, 13 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 235.43 test_events_resource.py
test_02_enableHumanReadableLogs Error 0.19 test_human_readable_logs.py
test_03_deploy_and_scale_kubernetes_cluster Failure 66.02 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 208.47 test_kubernetes_clusters.py
test_12_test_deploy_cluster_different_offerings_per_node_type Failure 160.92 test_kubernetes_clusters.py
test_01_deployVMInSharedNetwork Error 421.68 test_network.py
test_01_non_strict_host_anti_affinity Failure 213.73 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 55.61 test_nonstrict_affinity_group.py
test_01_add_primary_storage_disabled_host Error 15.60 test_primary_storage.py
test_01_primary_storage_iscsi Error 0.80 test_primary_storage.py
test_01_primary_storage_nfs Error 0.26 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.48 test_primary_storage.py
test_01_scale_vm Error 425.23 test_scale_vm.py
test_04_scale_vm_with_user_account Error 411.91 test_scale_vm.py
test_05_scale_vm_dont_allow_disk_offering_change Error 402.17 test_scale_vm.py
test_01_sys_vm_start Failure 0.10 test_secondary_storage.py
test_02_list_snapshots_with_removed_data_store Error 10.85 test_snapshots.py
test_02_list_snapshots_with_removed_data_store Error 10.85 test_snapshots.py
test_01_volume_usage Failure 100.64 test_usage.py
test_01_deploy_vm_on_specific_host Error 0.12 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 0.14 test_vm_deployment_planner.py
test_08_migrate_vm Error 0.08 test_vm_life_cycle.py
test_11_destroy_vm_and_volumes Error 23.21 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 0.29 test_vm_strict_host_tags.py
test_02_migrate_vm_strict_tags_failure Error 0.27 test_vm_strict_host_tags.py
test_01_restore_vm_strict_tags_success Error 0.27 test_vm_strict_host_tags.py
test_02_restore_vm_strict_tags_failure Error 0.24 test_vm_strict_host_tags.py
test_01_scale_vm_strict_tags_success Error 0.29 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Error 0.37 test_vm_strict_host_tags.py
test_01_deploy_vm_on_specific_host_without_strict_tags Error 0.27 test_vm_strict_host_tags.py
test_02_deploy_vm_on_any_host_without_strict_tags Error 5.75 test_vm_strict_host_tags.py
test_03_deploy_vm_on_specific_host_with_strict_tags_success Error 0.26 test_vm_strict_host_tags.py
test_04_deploy_vm_on_any_host_with_strict_tags_success Error 5.87 test_vm_strict_host_tags.py
test_05_deploy_vm_on_specific_host_with_strict_tags_failure Failure 0.28 test_vm_strict_host_tags.py

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_08_arping_in_ssvm Failure 5.22 test_diagnostics.py
test_isolate_network_password_server Failure 19.86 test_password_server.py

@harikrishna-patnala harikrishna-patnala marked this pull request as ready for review October 9, 2025 10:53
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 9, 2025

@harikrishna-patnala harikrishna-patnala merged commit 973819d into main Oct 9, 2025
49 of 52 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 9, 2025
@harikrishna-patnala harikrishna-patnala deleted the support-list-policies branch October 9, 2025 11:52
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
…ache#11587)

* API: Add support to list all snapshot policies & backup schedules

* Add support for backup policy listing without tying it to the vmid

* add tests for snapshot policy listing

* update tests for listbackupschedules

* remove trailing spaces and fix lint failure

* Add upgrade test

* remove unused import

* add create policy - snap/backup in the list view with resource (volume/vm) selection

* add translations

* refresh parent list

* remove unnecessary alert info

* fix checks for UI backup schedule list view

* fix checks for UI backup schedule list view

* add back access checks

* add since param

* fix failing test

* update snapshot policy and backup schedule ownership when VM is moved

* fix issue with showing vm selection

* fix unit test failure

* Update list snappolicy & backup schedule logic to list only those that belong to a proj or for root admin those that belong to it, unless listall & projid is passed

* fix test

* support snap / backup policy search using keyword

* fix tests
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.

8 participants