Skip to content

server: encrypt a volume created on a storage pool with an encrypted disk offering - #14667

Draft
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-encrypt-volume-on-pool
Draft

weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-encrypt-volume-on-pool

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Description

A volume created with a storageid is created on the pool right away, without the passphrase or the KMS key which an encrypted disk offering needs, so it was created without encryption. Set up its encryption before it is created.

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 or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Environment: Trillian test env pr147-n88 (Ubuntu 26.04, KVM, two management servers, two KVM hosts, Ceph RBD primary pools ceph-pri1 and ceph-pri2, plus an NFS primary pool). The management servers ran a 4.23 build with the same change, not this 4.22 branch. The KVM agents were not changed.

Steps: create an encrypted disk offering (encrypt=true), then create a volume from it with an explicit storageid on each pool. The volumes were not attached to a VM.

Pool Type passphrase_id in DB encrypt_format in DB On disk
nfs-n88 NetworkFilesystem set (363) luks qcow2 with LUKS: qemu-img info reports encrypted: yes
ceph-pri1 RBD set (364) luks2 image starts with a LUKS2 header
ceph-pri2 RBD set (365) luks2 image starts with a LUKS2 header

Not covered by these tests:

  • Attaching or detaching the encrypted volume to a running VM.
  • SharedMountPoint pools.
  • The pre-fix behaviour on the same environment. The passphrase was set on all three pools with the change applied, but the bug was not reproduced before the change.
  • A build or test run of this 4.22 branch.

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

Not yet tested beyond the cases above.

…disk offering

A volume created with a storageid is created on the pool right away, without the passphrase or the KMS key which an encrypted disk offering needs, so it was created without encryption. Set up its encryption before it is created.
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.31%. Comparing base (b56bbc2) to head (e5a3cd8).

Files with missing lines Patch % Lines
...stack/engine/orchestration/VolumeOrchestrator.java 0.00% 6 Missing ⚠️
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #14667      +/-   ##
============================================
- Coverage     18.32%   18.31%   -0.01%     
+ Complexity    16644    16642       -2     
============================================
  Files          5939     5939              
  Lines        537787   537794       +7     
  Branches      65932    65932              
============================================
- Hits          98544    98511      -33     
- Misses       428033   428079      +46     
+ Partials      11210    11204       -6     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.40% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

[KVM] Encrypted volume on SharedMountPoint pool is created without LUKS and attach fails with "No encryption in image header"

1 participant