Commit a419b97
committed
SharedMountPoint storage improvements
SharedMountPoint pools were treated as a generic libvirt-managed pool
type instead of the plain directory-based pool they actually are
(same libvirt DIR backend as Filesystem/NetworkFilesystem), causing:
- Data disks (fresh empty volumes) created via createPhysicalDisk()
went through createPhysicalDiskByLibVirt() (libvirt's
virStorageVolCreateXML()), which defaults new qcow2 volumes to
compat=0.10 on libvirt < 10.2.0. ROOT disks cloned from a template
already ended up at compat=1.1 regardless of pool type, since
createDiskFromTemplate() always finishes with a direct qemu-img
call — so the same SharedMountPoint pool produced inconsistent
qcow2 versions depending on whether the disk came from a template
or was created empty.
- SharedMountPoint destinations were missing from
poolTypesThatEnableCreateDiskFromTemplateBacking, so migrating a
linked-clone volume onto a SharedMountPoint pool silently no-op'd
disk creation (no exception, no fallback), even though the
orchestration layer already assumes SharedMountPoint supports
linked clones.
- SharedMountPoint volumes never received the thin/sparse/fat
preallocation option that NFS/Filesystem volumes get.
- Volume encryption was silently broken: SharedMountPoint already
declares EncryptionSupport.Hypervisor and the allocator/API layers
already allow requesting an encrypted disk offering on it, but
createPhysicalDiskByLibVirt() has no passphrase parameter at all,
so the passphrase generated for the volume was silently dropped
and the disk was created unencrypted with no error. This was a
real, reachable data-at-rest security bug, not a dormant path.
Fix: extract NetworkFilesystem/Filesystem/SharedMountPoint into a
single QEMU_IMG_MANAGED_POOL_TYPES constant and route SharedMountPoint
through the same qemu-img-based creation path as NFS/Filesystem
everywhere that set is consulted, so it now creates qcow2 v3
(compat=1.1) volumes consistently, supports linked-clone migration,
honors provisioning-type preallocation, and correctly encrypts
volumes when requested (verified via qemu-img info showing
encrypted: yes / format: luks on a freshly created SharedMountPoint
disk).1 parent 21b2025 commit a419b97
1 file changed
Lines changed: 11 additions & 8 deletions
File tree
- plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
138 | | - | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
979 | 982 | | |
980 | 983 | | |
981 | 984 | | |
982 | | - | |
| 985 | + | |
983 | 986 | | |
984 | 987 | | |
985 | 988 | | |
| |||
1010 | 1013 | | |
1011 | 1014 | | |
1012 | 1015 | | |
1013 | | - | |
| 1016 | + | |
1014 | 1017 | | |
1015 | 1018 | | |
1016 | 1019 | | |
| |||
1080 | 1083 | | |
1081 | 1084 | | |
1082 | 1085 | | |
1083 | | - | |
| 1086 | + | |
1084 | 1087 | | |
1085 | 1088 | | |
1086 | 1089 | | |
| |||
0 commit comments