[KVM] Encrypted disk offering: volume created on a manually selected primary storage pool (NFS and SharedMountPoint) is not encrypted (no LUKS, no error) · Issue #14662 · apache/cloudstack · GitHub
[KVM] Encrypted disk offering: volume created on a manually selected primary storage pool (NFS and SharedMountPoint) is not encrypted (no LUKS, no error) #14662
When a volume is created from a disk offering with encrypt=true and the primary storage pool is passed explicitly (storageid), the volume is not encrypted. There is no error: the volume is created and attached normally, but it is a plain qcow2 image with no LUKS header and volumes.passphrase_id is NULL. The same disk offering used with allocation by storage tag produces a LUKS volume.
The silent behavior is the main concern: an operator who picks the pool manually believes the data is encrypted at rest and it is not.
The same happens on a SharedMountPoint (iSCSI-backed) pool: manual selection produces a plain image with no error, while allocation by tag on that pool fails at attach (see #14663).
Primary storage: NFS pool (NetworkFilesystem) and SharedMountPoint pool (iSCSI-backed)
The steps to reproduce the bug
Use a KVM host that supports volume encryption.
Create a disk offering with encryption enabled and a storage tag that matches an NFS pool.
Create a volume from that offering with allocation by tag. Result: LUKS volume (works as expected).
Create a second volume from the same kind of encrypted offering (no storage tag), passing the NFS pool explicitly:
createVolume diskofferingid=<encrypted offering> storageid=<nfs pool id> ...
Attach it to a VM. No error is returned.
Check the result: volumes.passphrase_id is NULL, and the agent log shows no encryption option in the create command and no <encryption> element in the disk XML (excerpts below).
Repeating steps 4 to 6 on a SharedMountPoint (iSCSI-backed) pool gives the same result: passphrase_id NULL, plain qcow2, no error. We ran the manual-selection test 11 times with two disk offerings on both pool types, with the same result every time. In one earlier unplanned run (outside our test protocol) a manual selection on the SharedMountPoint pool produced a volume with a passphrase and a visible attach failure; we could not reproduce it in 3 deliberate repeats.
Manual pool selection on the SharedMountPoint (iSCSI-backed) pool, agent DEBUG log: volume created through libvirt (no qemu-img create, no encryption option), attached without <encryption>, and the attach succeeds. The database shows passphrase_id NULL and encrypt_format NULL for the volume.
INFO [kvm.storage.LibvirtStorageAdaptor] Attempting to create volume f279db6b-d6fd-4339-943c-ad01455af989 (SharedMountPoint) in pool 0d3db4e4-0e9a-4421-a5a4-72e9770d27c1 with size (5.00 GB) 5368709120
DEBUG [kvm.storage.LibvirtStorageAdaptor] <volume>
<name>f279db6b-d6fd-4339-943c-ad01455af989</name>
<capacity>5368709120</capacity>
<target>
<format type='qcow2'/>
<permissions><mode>0744</mode></permissions></target>
</volume>
DEBUG [cloud.agent.Agent] Seq 1-1174595077813576597: [...] "org.apache.cloudstack.storage.command.CreateObjectAnswer": [...] "result":"true" [...]
DEBUG [kvm.storage.KVMStorageProcessor] Attaching physical disk /mnt/<iscsi-pool>/f279db6b-d6fd-4339-943c-ad01455af989 with format qcow2
DEBUG [kvm.storage.KVMStorageProcessor] Attaching device: <disk device='disk' type='file'>
<driver name='qemu' type='qcow2' cache='none' />
<source file='/mnt/<iscsi-pool>/f279db6b-d6fd-4339-943c-ad01455af989'/>
<target dev='vdc' bus='virtio'/>
<serial>f279db6bd6fd4339943c</serial>
</disk>
DEBUG [cloud.agent.Agent] Seq 1-1174595077813576599: [...] "org.apache.cloudstack.storage.command.AttachAnswer": [...] "poolType":"SharedMountPoint", [...] "result":"true" [...]
What to do about it?
The decision to encrypt should not depend on how the pool was chosen. Either apply LUKS (and store the passphrase) on the manual-pool path, or fail the request with a clear error.
Note: PR #13228 changes several getPassphraseId() != null checks to isEncrypted() (which also considers encryptFormat). We have not verified that it affects this scenario, so it may or may not be related.
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
When an encrypted disk offering is used with an explicit storageid, the volume is created as plain qcow2 with no LUKS header and passphrase_id NULL, and no error is returned. Allocation by storage tag produces a LUKS volume. The reporter ran the manual-selection test 11 times across NFS and SharedMountPoint pools with the same result. The request is that the encryption decision not depend on how the pool was chosen: either apply LUKS on this path, or fail the request.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Silent loss of the requested encryption
Component
component:kvm, component:primary-storage
Pool selection in the management server; disk creation on KVM
Severity
Severity:Major
Users believe data is encrypted when it is not; no error
Activity
boring-cyborg commented on Nov 10, 2026
Thanks for opening your first issue here! Be sure to follow the issue template!
github-actions commented on Nov 11, 2026
Warning
threat detection engine error
What happenedThe threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
The threat detection engine failed to produce results.
Review the workflow run logs for details.
🎯 Triage report
When an encrypted disk offering is used with an explicit storageid, the volume is created as plain qcow2 with no LUKS header and passphrase_id NULL, and no error is returned. Allocation by storage tag produces a LUKS volume. The reporter ran the manual-selection test 11 times across NFS and SharedMountPoint pools with the same result. The request is that the encryption decision not depend on how the pool was chosen: either apply LUKS on this path, or fail the request.
📊 Assessment
🔗 Similar issues
- [KVM] Encrypted volume on SharedMountPoint pool is created without LUKS and attach fails with "No encryption in image header" #14663 (related) — same encrypted offering on SharedMountPoint; fails at attach rather than silently
- Volume creation on an explicitly selected primary storage pool does not validate available capacity #14313 (related, closed) — volume creation on an explicitly selected pool does not validate capacity; same manual-pool path
💡 Notes and suggestions- A maintainer comment on [KVM] Encrypted volume on SharedMountPoint pool is created without LUKS and attach fails with "No encryption in image header" #14663 points to PR server: encrypt a volume created on a storage pool with an encrypted disk offering #14667 for this path; check that it covers manual pool selection.
- Reproduction: encrypted offering, createVolume storageid=<pool>, attach, then check volumes.passphrase_id and the agent's disk XML.
- Consider a regression test that compares allocation by tag with allocation by pool.
Add this agentic workflow to your repoTo install this agentic workflow, run
kiranchavala commented on Nov 12, 2026
Thanks, @famerico able to reproduce the issue