[pve-devel] 4K-sector and SCSI pass-through storages

Dmitry Petuhov mityapetuhov at gmail.com
Tue Aug 16 09:23:10 CEST 2016


Hello.

Some nowadays storages are exporting 4K LUNs. There may be 3 options: 
512-byte physical sectors and 512-byte logical sectors, 4096 phys and 
512 log (512e), 4096 phys and 4096 log (native 4K). Latest is 
incompatible with two others. There will be more and more 4K-only 
devices over time. But PVE almost not handles this. Only SCSI-compatible 
devices explicitly set in VM config and iscsidirect devices, connected 
to VM via SCSI, derives these parameters from backing-store via scsi 
pass-through. In all other storage interfaces qemu by default shows 
legacy 512-byte sectors to guests.

So, if we place some data to native 4K device on one of these storages 
(say, on iscsi direct), and then migrate it to some other device, then 
partition table and/or FS there will be unusable. Even ZFS over iSCSI, 
used in PVE, can export luns with 4k blocks (not sure about only 
physical, or both). Opposite direction is same.

What if we add to PVE some more control over it:

 1. per-storage, or even per-volume control over sector sizes;
 2. ability to pass-through any scsi device, selected by any storage (if
    it selects devices in /dev), via scsi-block/scsi-generic device.

First option will provide control over compatibility, so user can select 
desired block size. In worst case, qemu layer will emulate it, if it not 
matches backend. Second option is just performance optimization. And 
they are not compatible to each other (we cannot control sector sizes on 
passed-through devices).

I wonder now what may be a per-storage and what per-volume option. I 
thinking to do pass-through per-storage, and forcing block sizes 
per-volume, overriding passing-through (on volume with forced block 
size, skip using scsi-[block|generic], even if we could).

Any thoughts?





More information about the pve-devel mailing list