Skip to content

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

Merged
Pearl1594 merged 1 commit intoapache:4.19from
LINBIT:gh/fix-linstor-tmpl-download-path
Jul 25, 2025
Merged

linstor: Use template's uuid if pool's downloadPath is null as resour…#11053
Pearl1594 merged 1 commit intoapache:4.19from
LINBIT:gh/fix-linstor-tmpl-download-path

Conversation

@ghernadi
Copy link
Copy Markdown
Contributor

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?

@boring-cyborg
Copy link
Copy Markdown

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:

@codecov
Copy link
Copy Markdown

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 (2e1de6f).
Report is 694 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    13969    +2604     
============================================
  Files          5416     5743     +327     
  Lines        475890   510499   +34609     
  Branches      58093    62076    +3983     
============================================
+ Hits          72254    84623   +12369     
- Misses       395550   416413   +20863     
- Partials       8086     9463    +1377     
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
Copy Markdown
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.

@ghernadi
Copy link
Copy Markdown
Contributor Author

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

To my understanding the old version (i.e. the version before my PR) was working as expected with versions 4.19.1.3 and 4.20.0.0, but 4.19.2.0 or 4.19.3.0 already require my PR to work again.

What branch do you suggest to rebase this PR?

@DaanHoogland
Copy link
Copy Markdown
Contributor

in that case 4.19 @ghernadi

@rp- rp- self-assigned this Jun 30, 2025
@rp-
Copy link
Copy Markdown
Contributor

rp- commented Jun 30, 2025

I'm back and will also update this PR and add the scenario to the integration tests

@rp- rp- force-pushed the gh/fix-linstor-tmpl-download-path branch from 935ed8a to f1f6cc4 Compare July 1, 2025 10:39
@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels Jul 1, 2025
@rp- rp- force-pushed the gh/fix-linstor-tmpl-download-path branch from f1f6cc4 to 2e1de6f Compare July 1, 2025 11:23
@rp- rp- requested review from DaanHoogland, Pearl1594 and rp- July 15, 2025 03:53
@rp-
Copy link
Copy Markdown
Contributor

rp- commented Jul 15, 2025

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rp- 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
Copy Markdown

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

Copy link
Copy Markdown
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

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rp- @ghernadi you guys want this on main only?

@rp-
Copy link
Copy Markdown
Contributor

rp- commented Jul 15, 2025

@rp- @ghernadi you guys want this on main only?

This should be in 4.19, 4.20 and 4.21/main. As it is basically a regression bug fix.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rp- @ghernadi you guys want this on main only?

This should be in 4.19, 4.20 and 4.21/main. As it is basically a regression bug fix.

ok, can you rebase?

…ce-name

Also added an integration test for templates from snapshots
@rp- rp- force-pushed the gh/fix-linstor-tmpl-download-path branch from 2e1de6f to 310c46d Compare July 15, 2025 11:36
@github-actions
Copy link
Copy Markdown

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

@rp- rp- changed the base branch from main to 4.19 July 15, 2025 11:36
@rp-
Copy link
Copy Markdown
Contributor

rp- commented Jul 15, 2025

@rp- @ghernadi you guys want this on main only?

This should be in 4.19, 4.20 and 4.21/main. As it is basically a regression bug fix.

ok, can you rebase?

Oh sorry, I thought this was already on 4.19

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland 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
Copy Markdown

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

@rp-
Copy link
Copy Markdown
Contributor

rp- commented Jul 25, 2025

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rp- 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
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

code LGTM

@Pearl1594 Pearl1594 merged commit a4263da into apache:4.19 Jul 25, 2025
1 check passed
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Jul 25, 2025

Awesome work, congrats on your first merged pull request!

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
…ce-name (apache#11053)

Also added an integration test for templates from snapshots
@rp- rp- deleted the gh/fix-linstor-tmpl-download-path branch November 11, 2025 15:15
rp- pushed a commit to LINBIT/cloudstack that referenced this pull request Feb 24, 2026
…ce-name (apache#11053)

Also added an integration test for templates from snapshots
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.

5 participants