linstor: enable discard for Linstor storage pools (#9770)

* linstor: enable discard for Linstor storage pools

All Linstor storage backends support discard, so it can be safely enabled.

* linstor: enable discard for Linstor storage pools CHANGELOG.md
This commit is contained in:
Rene Peinthor 2024-10-17 11:21:47 +02:00 committed by GitHub
parent 44597724f5
commit 7fbd0a9fb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -3128,6 +3128,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
else {
disk.defBlockBasedDisk(physicalDisk.getPath(), devId, diskBusType);
}
if (pool.getType() == StoragePoolType.Linstor) {
disk.setDiscard(DiscardType.UNMAP);
}
} else {
if (volume.getType() == Volume.Type.DATADISK && !(isWindowsTemplate && isUefiEnabled)) {
disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusTypeData, DiskDef.DiskFmtType.QCOW2);
@ -3474,6 +3477,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
diskdef.defFileBasedDisk(attachingDisk.getPath(), devId, busT, DiskDef.DiskFmtType.QCOW2);
} else if (attachingDisk.getFormat() == PhysicalDiskFormat.RAW) {
diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, busT);
if (attachingPool.getType() == StoragePoolType.Linstor) {
diskdef.setDiscard(DiscardType.UNMAP);
}
}
if (bytesReadRate != null && bytesReadRate > 0) {
diskdef.setBytesReadRate(bytesReadRate);

View File

@ -1444,6 +1444,9 @@ public class KVMStorageProcessor implements StorageProcessor {
diskdef.defFileBasedDisk(attachingDisk.getPath(), devId, busT, DiskDef.DiskFmtType.QCOW2);
} else if (attachingDisk.getFormat() == PhysicalDiskFormat.RAW) {
diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, busT);
if (attachingPool.getType() == StoragePoolType.Linstor) {
diskdef.setDiscard(DiscardType.UNMAP);
}
}
if (encryptDetails != null) {

View File

@ -5,6 +5,12 @@ All notable changes to Linstor CloudStack plugin will be documented in this file
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2024-10-04]
### Added
- Enable qemu discard="unmap" for Linstor block disks
## [2024-08-27]
### Changed