[SOLVED] iSCSI + Discard + SSD emulation?

AngryAnt

Member
Mar 13, 2021
16
7
8
I am currently migrating some VM disks from internal drives to multipath iSCSI. I am new to iSCSI and so am wondering about best practices for PVE VM disks hosted on there.

By default I have all VMs set to Discard and SSD emulation, but I am now wondering if those settings make sense on iSCSI.

In particular I just started formatting an xfs file system in a VM on a disk hosted on iSCSI and it is just sitting there on "Discarding blocks...". Is this just par for the course or am I missing some obvious configuration consideration in this scenario?
 
Discard is nothing you enable and it works. Without proper backend storage support, it will not work or not as planned.

SSD emulation is just an optimizer setting for the disk scheduler and totally fine if you just set it to SSD emulation. It will not try to optimize writes with respect to the read/write head, because there is seldomly just one.
 
SSD emulation is just an optimizer setting for the disk scheduler and totally fine if you just set it to SSD emulation. It will not try to optimize writes with respect to the read/write head, because there is seldomly just one.
Excellent. Seems like keeping this on for iSCSI is quite relevant, given how comparatively well it handles random read/write.

Discard is nothing you enable and it works. Without proper backend storage support, it will not work or not as planned.
Not entirely following here.

The file system (btrfs) on the storage host (Synology box) supports discard.

So are you saying that is going to work as expected or that the PVE/Debian iSCSI implementation needs special configuration for it to work / does not support it at all?
 
The file system (btrfs) on the storage host (Synology box) supports discard.

So are you saying that is going to work as expected or that the PVE/Debian iSCSI implementation needs special configuration for it to work / does not support it at all?
Normally, if the backend storage device on the SAN is capable of discard, the iSCSI target will pick it up and will indicate to its clients, that it's capable of discard and you'll see it on the initiator side. AFAIK, there is nothing to configure on the storage side, you have to set discard on the VM in PVE as you did and you should be able to run fstrim or blkdiscard inside of the VMs. You can check easily by adding a disk to a test vm, write to it some random stuff and look at the storage utilization, then discard and look again.
 
  • Like
Reactions: AngryAnt

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!