Skip to content

Conversation

@rp-
Copy link
Contributor

@rp- rp- commented Oct 10, 2023

Description

This PR adds an config option for the Linstor primary storage driver, that allows you to automatically backup
volume snapshots to the secondary storage.
Additionally it will not mangle the need java-linstor dependency into the client.jar, but instead just copy
the java-linstor.jar into lib.

Config option is called: lin.backup.snapshots and is default false

The scope of this change should be limited, as it only touches the Linstor driver and a part of copyAsync
was implemented with 2 new Linstor specific commands.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

Tested on 2 different Linstor clusters, one running LVM the other ZFS.
Additionally send this PR to a PoC tester, who requested this feature.

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

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #8067 (ec5ab15) into main (e9b24b6) will decrease coverage by 0.14%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #8067      +/-   ##
============================================
- Coverage     28.33%   28.20%   -0.14%     
+ Complexity    29966    29614     -352     
============================================
  Files          5181     5186       +5     
  Lines        365434   365752     +318     
  Branches      53449    53491      +42     
============================================
- Hits         103550   103143     -407     
- Misses       247552   248420     +868     
+ Partials      14332    14189     -143     
Flag Coverage Δ
simulator-marvin-tests 23.86% <0.00%> (-0.17%) ⬇️
uitests 4.50% <ø> (ø)
unit-tests 14.77% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../provider/LinstorPrimaryDatastoreProviderImpl.java 0.00% <0.00%> (ø)
...loud/api/storage/LinstorBackupSnapshotCommand.java 0.00% <0.00%> (ø)
...pi/storage/LinstorRevertBackupSnapshotCommand.java 0.00% <0.00%> (ø)
.../hypervisor/kvm/storage/LinstorStorageAdaptor.java 0.00% <0.00%> (ø)
...ge/datastore/util/LinstorConfigurationManager.java 0.00% <0.00%> (ø)
...per/LinstorRevertBackupSnapshotCommandWrapper.java 0.00% <0.00%> (ø)
...cloudstack/storage/datastore/util/LinstorUtil.java 0.00% <0.00%> (ø)
...e/wrapper/LinstorBackupSnapshotCommandWrapper.java 0.00% <0.00%> (ø)
...tore/driver/LinstorPrimaryDataStoreDriverImpl.java 0.00% <0.00%> (ø)

... and 412 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

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

looks mostly good. licenses are needed!.

@yadvr yadvr added this to the 4.19.0.0 milestone Oct 10, 2023
@rp- rp- force-pushed the linstor-backup-snaphots branch from 8c28e64 to a99293d Compare October 12, 2023 07:13
@rp- rp- requested a review from DaanHoogland October 12, 2023 07:16
Copy link
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
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7339

@rp-
Copy link
Contributor Author

rp- commented Oct 13, 2023

@DaanHoogland I have another small feature, that depends on this merged.
Should I add that to this PR? or wait and create another PR?

@DaanHoogland
Copy link
Contributor

@DaanHoogland I have another small feature, that depends on this merged. Should I add that to this PR? or wait and create another PR?

your choice @rp- , if it is reasonably risk free, I'd add it. else you could wait.

@rp-
Copy link
Contributor Author

rp- commented Oct 13, 2023

I have added the commit, thanks

@rp- rp- requested a review from DaanHoogland October 13, 2023 10:15
@rp- rp- force-pushed the linstor-backup-snaphots branch from 3429caa to 2b809cb Compare October 13, 2023 13:38
@rp-
Copy link
Contributor Author

rp- commented Oct 13, 2023

@DaanHoogland done, thanks for the review

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SF] 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7355

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-7976)

@rp-
Copy link
Contributor Author

rp- commented Nov 4, 2023

usually I test on ubuntu.
But I would be happy for any packages, to check whats wrong.
because on my end it works of course...

@github-actions
Copy link

github-actions bot commented Nov 6, 2023

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

@rp-
Copy link
Contributor Author

rp- commented Nov 6, 2023

if you can't provide packages, could you check if java-linstor-0.3.0.jar is included in the cloudstack-agent/lib ?
or maybe it is possible to get more debug output, why it gets stuck on loading the LinstorStorageAdaptor?

@shwstppr
Copy link
Contributor

shwstppr commented Nov 7, 2023

if you can't provide packages, could you check if java-linstor-0.3.0.jar is included in the cloudstack-agent/lib ? or maybe it is possible to get more debug output, why it gets stuck on loading the LinstorStorageAdaptor?

@rp- sorry I could get time to upload packages publicly.
I checked in the env and lib was missing in cloudstack-agent/lib. Is it because the dependency is removed from plugins/hypervisors/kvm/pom.xml? Would it be better to add the dependency in another module that is present in cloudstack-agent?

@rp-
Copy link
Contributor Author

rp- commented Nov 7, 2023

@shwstppr where are the dependencies for cloudstack-agent declared?
Seems not in agent/pom.xml
Sorry I'm not really familiar with Maven, we use gradle on our end.

agent should than probably have a dependency to the cloud-plugin-storage-volume-linstor because that is where the LinstorStorageAdapter is located, or maybe the kvm-hyporvisor-plugin should have a dep to it?

@shwstppr
Copy link
Contributor

shwstppr commented Nov 7, 2023

@rp- Adding dependency in cloud-plugin-storage-volume-linstor makes sense as it is present in cloudstack-agent. cc @DaanHoogland @rohityadavcloud

@DaanHoogland
Copy link
Contributor

@shwstppr where are the dependencies for cloudstack-agent declared? Seems not in agent/pom.xml Sorry I'm not really familiar with Maven, we use gradle on our end.

agent should than probably have a dependency to the cloud-plugin-storage-volume-linstor because that is where the LinstorStorageAdapter is located, or maybe the kvm-hyporvisor-plugin should have a dep to it?

@rp- , sounds like you need to add it in the cloud.spec files. but I already see a line

cp plugins/storage/volume/linstor/target/*.jar  ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib

there. Maybe something else is needed? for the non acs parts of linstore?

@yadvr
Copy link
Member

yadvr commented Nov 7, 2023

@rp- like Daan has advised, you could configure mvn/pom.xml rule to exclude the specific dependency you don't it to shade but ensure it copies the dependency in the lib directory (in the debian and rpm/spec build config file).

rp- added 3 commits November 7, 2023 11:06
This makes it easier to apply patches, if the linstor library needs to
be updated outside of cloudstack releases.
Create the template image resource before the host gets the copy command.
This allowes to tag(set property) in linstor to which template this
resource belongs to and we can maybe in future reduce the linstor
managing code in the storagepoolAdaptor class.
@rp- rp- force-pushed the linstor-backup-snaphots branch from 6f21ce7 to ec5ab15 Compare November 7, 2023 10:06
@rp-
Copy link
Contributor Author

rp- commented Nov 7, 2023

@shwstppr I think I got it right now

@shwstppr
Copy link
Contributor

shwstppr commented Nov 7, 2023

@blueorangutan package

@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor

shwstppr commented Nov 8, 2023

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7672

@shwstppr
Copy link
Contributor

shwstppr commented Nov 8, 2023

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-8271)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48291 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8067-t8271-kvm-centos7.zip
Smoke tests completed. 116 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_migrate_vm Error 44.85 test_vm_life_cycle.py

@shwstppr
Copy link
Contributor

shwstppr commented Nov 9, 2023

Tests look good now. One failure is unrelated. GH failures are codecov related. Thanks @rp- for fixing. Merging this.

@shwstppr shwstppr merged commit 68e504a into apache:main Nov 9, 2023
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Nov 16, 2023
This PR adds an config option for the Linstor primary storage driver, that allows you to automatically backup
volume snapshots to the secondary storage.
Additionally it will not mangle the need java-linstor dependency into the client.jar, but instead just copy
the java-linstor.jar into lib.

Config option is called: lin.backup.snapshots and is default false

The scope of this change should be limited, as it only touches the Linstor driver and a part of copyAsync
was implemented with 2 new Linstor specific commands.
@rp- rp- deleted the linstor-backup-snaphots branch February 5, 2024 08:39
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