-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Prioritize copying templates from other secondary storages instead of downloading them #10363
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
base: 4.20
Are you sure you want to change the base?
Prioritize copying templates from other secondary storages instead of downloading them #10363
Conversation
@blueorangutan package |
@winterhazel 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10363 +/- ##
============================================
+ Coverage 15.99% 16.16% +0.17%
- Complexity 13086 13281 +195
============================================
Files 5649 5666 +17
Lines 495714 498168 +2454
Branches 60017 60269 +252
============================================
+ Hits 79289 80534 +1245
- Misses 407572 408618 +1046
- Partials 8853 9016 +163
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes functional sense, but needs testing
@blueorangutan package |
@winterhazel 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. |
...hestration/src/main/java/org/apache/cloudstack/engine/orchestration/StorageOrchestrator.java
Outdated
Show resolved
Hide resolved
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
Show resolved
Hide resolved
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12548 |
@blueorangutan package |
@winterhazel 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. |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12562 |
@winterhazel I marked this for 4.21 as it is based off main, but would this be a good improvement for 4.20.1 as well? |
@winterhazel could you fix the compilation errors? |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12575 |
Yeah, it would be great to have it in 4.20.1. I'll rebase. |
… downloading them
9501c57
to
246c850
Compare
@blueorangutan package |
@winterhazel 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12585 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-12507)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea LGTM, didn't test it or thoroughly review the code
Description
After adding a new secondary storage, CloudStack will always try to download public templates/ISOs that have URLs from the source to the new secondary storage, even if it already exists on another one. Due to this behavior, if the URL does not exist anymore, the template will not become available at the new storage; and if the template has been updated at the source, it will not be installed because of checksum mismatch. This forces operators to manually copy/move templates to the new secondary storage.
To solve this issue, this PR creates the zone-scoped setting
copy.public.templates.from.other.storages
. When enabled, CloudStack will try to copy templates/ISOs from other secondary storages in the same zone before attempting to downloading them from the source. It is enabled by default.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
With the setting enabled
I deleted all existing secondary storages, and registered an empty one (SS 1). I verified that the SSVM started to download the templates that were registered.
I registered another template, and immediately also registered secondary storage 2. I verified that the templates available in SS 1 were copied to SS 2, and that the last registered template was being downloaded to both secondary storages.
Inside SS 1, I deleted the first half of templates; inside SS 2, I deleted the other half of templates. Then, I added SS 3. I verified that all the templates were copied to SS 3. SS 1 and SS 2 were not synchronized yet, so they still had only half of the templates each.
I restarted the SSVM's service. I verified that the first half of templates was copied from SS 1 to SS 2, and that the other half was copied from SS 2 to SS 1.
I deleted SS 1 and SS 2. Then, I deployed a VM using each one of the templates, and verified that they were deployed successfully.
With the setting disabled
I disabled the setting and added SS 4. I verified that the SSVM started to download the templates to SS 4 from the source instead of copying them.
Migration: I marked all templates as private so that they are not downloaded to new secondary storages. Then, I added SS 5 and called
migrateSecondaryStorageData
to migrate data from SS 4 to SS 5. I verified that the templates were migrated successfully.