Proxmox VEIX · Virtual MachinesStorage in VMs
VM disks: VirtIO SCSI, cache, discard, IO threads
What you'll learn
- Choose the right disk controller VirtIO SCSI vs IDE vs SATA
- Configure cache modes safely
- Enable discard/TRIM for SSDs
- Use IO threads for parallel disk I/O
Prerequisites
Verified against Proxmox VE 9.2.4 · Proxmox Backup Server 4.2.5 · Ceph Squid / Tentacle · Debian 13 (Trixie) · Linux kernel 7.0 (PVE 9.2 default) · 2026-08-07
Why this matters in production
A VM disk’s performance is dominated by the combination of disk controller, cache mode, and underlying storage. Misconfiguring any of these produces either data loss or slow I/O.
Disk controllers
| Controller | Use | Modern? |
|---|---|---|
| IDE | Legacy | No |
| SATA | Legacy, single queue | No |
| VirtIO Block | Single queue paravirt | Older paravirt |
| VirtIO SCSI Single | Modern paravirt, single controller | Yes (recommended default) |
| VirtIO SCSI | Multiple controllers, multi-queue | Yes (for high-IOPS) |
qm set 100 --scsihw virtio-scsi-single
Cache modes
| Mode | Behaviour | When to use |
|---|---|---|
default | No cache, writeback is host’s choice | Most workloads |
none | Bypass host cache; direct to storage | High-IOPS databases with battery-backed storage |
writethrough | Writes go to storage before ack | Stronger durability, slower |
writeback | Host cache, ack before flush | Fastest; data loss on host crash |
directsync | Bypass cache, sync to storage | Safest, slowest |
qm set 100 --scsi0 local-zfs:vm-100-disk-0,cache=writethrough
Discard / TRIM
Enabling discard=on allows the guest to issue TRIM commands, which the host forwards
to the underlying storage. Critical for SSD performance and thin-provisioned storage.
qm set 100 --scsi0 local-zfs:vm-100-disk-0,discard=on
In the guest, ensure TRIM is enabled:
systemctl enable --now fstrim.timer
IO threads
For multi-queue performance, use IO threads:
qm set 100 --iothread 1
Each disk can be assigned to a specific thread for parallel I/O.
SSD emulation
For older OSes that don’t have VirtIO drivers, you can emulate an SSD:
qm set 100 --scsi0 local-zfs:vm-100-disk-0,ssd=1
This signals the guest that the disk is an SSD, enabling the guest’s SSD-optimised I/O scheduler.
Production considerations
Common mistakes
- Using
cache=writebackwithout guest agent or without frequent backups. - Disabling discard “to save CPU.” The SSD performance cost is worse.
- Using IDE for new VMs.
Key takeaways
- VirtIO SCSI single is the modern default.
- Cache mode balances performance vs durability; document the choice.
- TRIM is mandatory for SSD performance.
Knowledge check
Knowledge check · 3 questions
Q1. Which disk controller is the Proxmox 9 default for new VMs?
Q2. With cache=writeback, a host crash can lose writes the guest was already told had completed.
Q3. Which option enables TRIM passthrough to the host?
Passing score: 75%. Answers are checked in this browser.