Skip to content

Conversation

@JoaoJandre
Copy link
Contributor

@JoaoJandre JoaoJandre commented Aug 15, 2025

Description

This PR updates the error message shown when no snapshot strategy is found.

Fixes #11453

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

How Has This Been Tested?

I created a disk-only VM snapshot using the KvmFileBasedStorageVmSnapshotStrategy and then tried to create a volume snapshot. I got the following error, as expected:

Failed to create snapshot due to unsupported operation: Unable to find a snapshot strategy to create snapshot [Snapshot {"id":541,"name":"t1_DATA-295_20250815133205","state":"Allocated","uuid":"7a7e0b5e-3aa0-4a50-84d3-d62446950938","version":"2.2","volumeId":317}] of volume [7663349b-c3f7-4e71-bef3-8a87352cae40]. Please check the logs.

@codecov
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.36%. Comparing base (0b381d4) to head (2486c18).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/storage/snapshot/SnapshotManagerImpl.java 0.00% 3 Missing ⚠️
...e/cloudstack/storage/volume/VolumeServiceImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11455      +/-   ##
============================================
- Coverage     17.36%   17.36%   -0.01%     
+ Complexity    15237    15236       -1     
============================================
  Files          5886     5886              
  Lines        525650   525653       +3     
  Branches      64157    64157              
============================================
  Hits          91260    91260              
- Misses       424094   424097       +3     
  Partials      10296    10296              
Flag Coverage Δ
uitests 3.63% <ø> (ø)
unittests 18.40% <16.66%> (-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.

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@sureshanaparti
Copy link
Contributor

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

_snapshotDao.remove(snapshotId);
logger.debug("No strategy found for creation of snapshot [{}], removing its record from the database.", snapshot);
throw new CloudRuntimeException(String.format("Can't find snapshot strategy to deal with snapshot:%s", snapshot.getSnapshotVO()));
throw new UnsupportedOperationException(String.format("Unable to find a snapshot strategy to create snapshot [%s] of volume [%s]. Please check the logs.",
Copy link
Member

Choose a reason for hiding this comment

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

@JoaoJandre
thanks for the PR

this is not user-friendly I think, only administrator can access the check the logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weizhouapache How would you change the message so that it is still generic (this is an error when no snapshot strategy is found; thus this message will be shown for other situations as well) and does not reveal the infrastructure information to the end user?

Copy link
Member

Choose a reason for hiding this comment

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

I think more details but does not reveal the critical information would be better

for example, when the management server log says
2025-08-15 05:58:04,557 WARN [o.a.c.s.s.DefaultSnapshotStrategy] (Work-Job-Executor-6:[ctx-bcc76f85, job-179/job-180, ctx-5bbd5fed]) (logid:2d361233) VM [b50bdd89-1b6b-4ef3-bf85-c97d8cfa01a2] already has KVM File-Based storage VM snapshots. These VM snapshots and volume snapshots are not supported together for KVM. As restoring volume snapshots will erase the VM snapshots and cause data loss.

end users could get an error when create a volume snapshot, like
Volume snapshot is unsupported as this VM has a disk-only VM snapshots

btw: would it be possible to check the condition in a ealier stage ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@JoaoJandre please raise separate PR if error message can be improved. thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weizhouapache We currently have 5 snapshot strategies. This error is thrown when no snapshot strategy supports the snapshot being taken. Thus, the message cannot be specific to a single strategy.

Depending on the storage/strategy being used, it might be possible to create volume snapshots and disk-only VM snapshots.

Copy link
Member

Choose a reason for hiding this comment

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

@JoaoJandre
ok, ignore it if it is difficult to improve

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

tested ok

image

@sureshanaparti sureshanaparti merged commit f2d6356 into apache:main Aug 18, 2025
24 of 25 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Aug 18, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Sep 4, 2025
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.

Failed to create snapshot due to an internal error (4.21.0.0-RC3)

4 participants