rp- opened a new pull request, #13486:
URL: https://github.com/apache/cloudstack/pull/13486

   ### Description
   
   This PR fixes a bug that was reported on the linstor-server github project: 
https://github.com/LINBIT/linstor-server/issues/495
   
   Encrypted Linstor volumes use a LUKS layer inside the DRBD stack, so the 
storage-layer snapshot device holds ciphertext while the DRBD device CloudStack 
restores to is the decrypted view. Backing up the raw snapshot and writing it 
back to the decrypted device corrupted the volume (different data, unbootable 
root).
   
   Back up encrypted snapshots from the decrypted DRBD device (forcing the 
temporary-resource path) and store them as a LUKS-encrypted qcow2 using the 
volume passphrase, so snapshots are not kept in clear text on secondary 
storage. On revert, decrypt the qcow2 and write plaintext to the DRBD device; 
the LUKS layer re-encrypts it. The qemu-img shrink is skipped for encrypted 
volumes (the DRBD device is already net-sized).
   
   Add an integration test (test_linstor_encrypted_snapshots.py): the 
encrypted-root snapshot revert round-trip, that
   create-volume-from-encrypted-snapshot is rejected by CloudStack core, and a 
best-effort check that the backed-up qcow2 is LUKS-encrypted at rest.
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### 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
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [x] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   Added/Run integration tests to restore encrypted volumes.
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to