cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

engine-storage: Set SecretConsumerDetail for VM live migration with storage on shared NFS

Open abh1sar opened this issue 1 year ago • 34 comments
trafficstars

Description

Fixes https://github.com/apache/cloudstack/issues/8255

This PR Fixes the issue where live migration of a VM with encrypted volume on shared NFS due to wrongly setup secret key on the destination. Before fix uuid of the secret key was corresponding to the source volume, while actually it should be of the destination volume.

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] 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
  • [x] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Reproduced the original issue by

  1. Create a VM with encrypted data volume
  2. Open the Live VM migrate UI wizard
  3. Select Migrate with Storage option and made sure that the data volume is moved to a different pool.
  4. Start live migrate.

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

abh1sar avatar Jun 11 '24 14:06 abh1sar

Codecov Report

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

Project coverage is 15.08%. Comparing base (3f5a77e) to head (487b788). Report is 42 commits behind head on 4.19.

Files with missing lines Patch % Lines
...torage/motion/StorageSystemDataMotionStrategy.java 0.00% 1 Missing and 2 partials :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9222      +/-   ##
============================================
- Coverage     15.08%   15.08%   -0.01%     
+ Complexity    11190    11188       -2     
============================================
  Files          5406     5406              
  Lines        473210   473211       +1     
  Branches      61188    59224    -1964     
============================================
  Hits          71376    71376              
- Misses       393887   393888       +1     
  Partials       7947     7947              
Flag Coverage Δ
uitests 4.30% <ø> (ø)
unittests 15.80% <0.00%> (-0.01%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 11 '24 14:06 codecov[bot]

@abh1sar just a suggestion, you can create a new branch (instread of 4.19)

weizhouapache avatar Jun 11 '24 14:06 weizhouapache

Removed a condition which was not allowing live migrate for powerflex as @harikrishna-patnala suggested on issue https://github.com/apache/cloudstack/issues/8255

abh1sar avatar Jun 12 '24 06:06 abh1sar

@blueorangutan package

abh1sar avatar Jun 12 '24 07:06 abh1sar

@abh1sar 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 avatar Jun 12 '24 07:06 blueorangutan

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

blueorangutan avatar Jun 12 '24 08:06 blueorangutan

@blueorangutan test

abh1sar avatar Jun 12 '24 22:06 abh1sar

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

blueorangutan avatar Jun 12 '24 22:06 blueorangutan

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

Test Result Time (s) Test File

blueorangutan avatar Jun 13 '24 10:06 blueorangutan

@blueorangutan package

abh1sar avatar Jun 26 '24 05:06 abh1sar

@abh1sar 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 avatar Jun 26 '24 05:06 blueorangutan

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

blueorangutan avatar Jun 26 '24 06:06 blueorangutan

@blueorangutan test

abh1sar avatar Jun 26 '24 06:06 abh1sar

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

blueorangutan avatar Jun 26 '24 06:06 blueorangutan

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

Test Result Time (s) Test File

blueorangutan avatar Jun 26 '24 20:06 blueorangutan

[SF] Trillian Build Failed (tid-10656)

blueorangutan avatar Jun 27 '24 10:06 blueorangutan

@blueorangutan package

borisstoyanov avatar Jun 28 '24 09:06 borisstoyanov

@borisstoyanov 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 avatar Jun 28 '24 09:06 blueorangutan

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

blueorangutan avatar Jun 28 '24 10:06 blueorangutan

@blueorangutan package

borisstoyanov avatar Jun 28 '24 11:06 borisstoyanov

@borisstoyanov 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 avatar Jun 28 '24 12:06 blueorangutan

@abh1sar I'm facing a strange issue with my env (rebuild it so it was not an accident). when I try to deploy I get the following error

2024-06-28 11:52:07,147 ERROR [o.a.c.e.o.VolumeOrchestrator] (Work-Job-Executor-11:ctx-d8307cc4 job-49/job-50 ctx-0e92140e) (logid:1b4ac1f6) Unable to create volume [{"name":"ROOT-9","uuid":"bbbd5b79-9e55-48ca-b2a2-ee933f07e624"}] due to [No remote endpoint to send command, check if host or ssvm is down?].
2024-06-28 11:52:07,147 WARN  [c.c.v.VirtualMachineManagerImpl] (Work-Job-Executor-11:ctx-d8307cc4 job-49/job-50 ctx-0e92140e) (logid:1b4ac1f6) Unable to contact resource.
com.cloud.exception.StorageUnavailableException: Resource [StoragePool:1] is unreachable: Unable to create volume [{"name":"ROOT-9","uuid":"bbbd5b79-9e55-48ca-b2a2-ee933f07e624"}] due to [No remote endpoint to send command, check if host or ssvm is down?].
	at org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.recreateVolume(VolumeOrchestrator.java:1817)
	at org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.prepare(VolumeOrchestrator.java:1930)

but both host and ssvm are up and running, any idea?

Don't see how this change can affect creation of root volumes. @borisstoyanov

abh1sar avatar Jun 28 '24 12:06 abh1sar

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

blueorangutan avatar Jun 28 '24 13:06 blueorangutan

@borisstoyanov I have merged with the latest changes and built packages. Can you please try once more.

abh1sar avatar Jun 28 '24 13:06 abh1sar

@blueorangutan package

abh1sar avatar Aug 21 '24 10:08 abh1sar

@abh1sar 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 avatar Aug 21 '24 10:08 blueorangutan

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

blueorangutan avatar Aug 21 '24 11:08 blueorangutan

@borisstoyanov @sureshanaparti are your concerns met?

DaanHoogland avatar Aug 22 '24 19:08 DaanHoogland

@blueorangutan test

abh1sar avatar Aug 23 '24 00:08 abh1sar

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

blueorangutan avatar Aug 23 '24 00:08 blueorangutan