Skip to content

Support of snapshot copy to primary storage in different zones. #9478

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 14 commits into
base: main
Choose a base branch
from

Conversation

slavkap
Copy link
Contributor

@slavkap slavkap commented Aug 1, 2024

Description

This PR allows copying a snapshot from a primary storage pool in one zone to a primary storage pool in different zones without involving secondary storage.
This feature is currently implemented only in the StorPool storage plugin. Other storage plugins can add this feature if the storage pools support direct copies of snapshots from one pool to another.

Added additional API param usestoragereplication and one more for Admin users storageids in CloudStack API calls:

createSnapshot
copySnapshot
createSnapshotPolicy

The option snapshot.backup.to.secondary does not apply to the copy functionality. The snapshots will be copied only to the required primary storage in a different zone.
The user can create volumes/templates from the copied snapshots. The user can make copies only to a primary or to a secondary storage - at the moment, there is no option to do the copy on both.

The destination zone is a mandatory parameter if the users want to copy a snapshot, and the usestoragereplication if the copy has to be on the primary storage

For Admin users:
Those users can define the primary destination storage for the copy or to enable the setting use.storage.replication in the Primary storage settings.
image
image
image

For regular Users:
The Admin should enable the configuration setting use.storage.replication in the Primary storage settings.
image
image
image

For other storage plugins that want to adopt this functionality:

  • The Primary storage driver should have the capability CAN_COPY_SNAPSHOT_BETWEEN_ZONES
  • the respective plugin needs to implement the copySnapshot method in their SnapshotStrategy and that the driver can handle the COPY operation

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

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

Manual and smoke tests with StorPool primary storage on multiple zones

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

❌ Patch coverage is 6.54971% with 799 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.15%. Comparing base (8429223) to head (4c91d28).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/storage/snapshot/SnapshotManagerImpl.java 8.08% 174 Missing and 8 partials ⚠️
...ack/storage/snapshot/StorPoolSnapshotStrategy.java 0.00% 154 Missing ⚠️
...age/collector/StorPoolAbandonObjectsCollector.java 0.00% 69 Missing ⚠️
...tastore/driver/StorPoolPrimaryDataStoreDriver.java 0.00% 56 Missing ⚠️
...org/apache/cloudstack/snapshot/SnapshotHelper.java 16.94% 43 Missing and 6 partials ⚠️
...loudstack/storage/datastore/util/StorPoolUtil.java 0.00% 37 Missing ⚠️
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 20.51% 29 Missing and 2 partials ⚠️
...oudstack/storage/snapshot/SnapshotServiceImpl.java 0.00% 27 Missing ⚠️
...e/wrapper/StorPoolModifyStorageCommandWrapper.java 0.00% 21 Missing ⚠️
...udstack/storage/datastore/util/StorPoolHelper.java 0.00% 21 Missing ⚠️
... and 25 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9478       +/-   ##
===========================================
+ Coverage        0   17.15%   +17.15%     
- Complexity      0    14998    +14998     
===========================================
  Files           0     5869     +5869     
  Lines           0   522449   +522449     
  Branches        0    63624    +63624     
===========================================
+ Hits            0    89618    +89618     
- Misses          0   422752   +422752     
- Partials        0    10079    +10079     
Flag Coverage Δ
uitests 3.75% <ø> (?)
unittests 18.13% <6.54%> (?)

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.

@slavkap slavkap force-pushed the support-snapshot-copy-on-primary branch from 8cc7b49 to 0df6764 Compare August 14, 2024 09:14
@slavkap slavkap marked this pull request as ready for review August 14, 2024 09:51
@slavkap slavkap changed the title [WIP] Support of snapshot copy to StorPool primary storage in different zones Support of snapshot copy to StorPool primary storage in different zones Aug 14, 2024
Copy link

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

@slavkap slavkap force-pushed the support-snapshot-copy-on-primary branch from 0df6764 to e0f4283 Compare August 22, 2024 12:49
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland 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-11155)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51322 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9478-t11155-kvm-ol8.zip
Smoke tests completed. 137 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_snapshot_usage Failure 38.32 test_usage.py
test_01_vpc_site2site_vpn Failure 308.08 test_vpc_vpn.py

Copy link

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

@slavkap slavkap force-pushed the support-snapshot-copy-on-primary branch from e0f4283 to 6f209d8 Compare August 30, 2024 09:08
Copy link

github-actions bot commented Sep 4, 2024

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

Copy link

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

slavkap added 14 commits July 29, 2025 18:11
…n zones

Added support to copy a snapshot to another StorPool primary storage in
different zones.
Added drop down to choose the primary storage pools to copy a snapshot
Small fixes
hide the primary storage from the users in the UI
refactor smoke test
fix copy when reccuring snapshot
fix UI after rebasing
Pool type to volumes that are created from snapshots
Added StorPool tags to snapshots that are copied from remote
@slavkap slavkap force-pushed the support-snapshot-copy-on-primary branch from edf4397 to 4c91d28 Compare July 29, 2025 15:12
@blueorangutan
Copy link

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

@slavkap
Copy link
Contributor Author

slavkap commented Jul 29, 2025

@blueorangutan package

@blueorangutan
Copy link

@slavkap 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 14447

@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 30, 2025
@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.

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy