Skip to content

linstor: Use template's uuid if pool's downloadPath is null as resour… #11053

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ghernadi
Copy link

Description

My colleague, @rp- is on vacation right now and we found a bug where the previously non-null VMTemplateStoragePoolVO#getLocalDownloadPath for some reason returns null in the recent versions of Cloudstack. This is my attempt to patch the issue, which worked in our test-setup.

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?

The following scenario no longer works without this patch:

  • Create a new VM (instance)
  • Stop VM and make a snapshot of it
  • Create a template from the just created snapshot
  • Create a new VM from the new template

The last step causes the cloud-plugin-storage-volume-linstor to try to clone from cs-null instead of cs-${template_uuid}. cs-null obviously does not exist within LINSTOR itself, which causes an error.

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

Copy link

boring-cyborg bot commented Jun 18, 2025

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@ghernadi ghernadi force-pushed the gh/fix-linstor-tmpl-download-path branch from 2037fe4 to 935ed8a Compare June 25, 2025 05:30
@@ -668,8 +671,15 @@ private String cloneResource(long csCloneId, VolumeInfo volumeInfo, StoragePoolV
storagePoolVO.getId(), csCloneId, null);

if (tmplPoolRef != null) {
final String templateRscName = LinstorUtil.RSC_PREFIX + tmplPoolRef.getLocalDownloadPath();
final String templateRscName;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the final?

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 16.57%. Comparing base (0d5a0ea) to head (935ed8a).
Report is 663 commits behind head on main.

Files with missing lines Patch % Lines
...tore/driver/LinstorPrimaryDataStoreDriverImpl.java 0.00% 6 Missing ⚠️
.../hypervisor/kvm/storage/LinstorStorageAdaptor.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11053      +/-   ##
============================================
+ Coverage     15.18%   16.57%   +1.39%     
- Complexity    11365    13968    +2603     
============================================
  Files          5416     5743     +327     
  Lines        475890   510499   +34609     
  Branches      58093    62076    +3983     
============================================
+ Hits          72254    84617   +12363     
- Misses       395550   416420   +20870     
- Partials       8086     9462    +1376     
Flag Coverage Δ
uitests 3.90% <ø> (-0.39%) ⬇️
unittests 17.47% <0.00%> (+1.56%) ⬆️

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

My colleague, @rp- is on vacation right now and we found a bug where the previously non-null VMTemplateStoragePoolVO#getLocalDownloadPath for some reason returns null in the recent versions of Cloudstack. This is my attempt to patch the issue, which worked in our test-setup.

“recent” menaing unreleased versions, or also 4.19.3 and/or 4.20.1, @ghernadi ?

in the later case you may want to base your fix off of an older release branch.

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.

2 participants