I have enabled unmap feature on vSAN and then I powered off / powered on all VMs to enable unmap as described in the KB below.
After these procedures I successfully completed unmap on all VMs with fstrim and also enabled fstrim.timer to schedule to run this once a week.
So far everything is normal.
After a few weeks I noticed that some VMs have the following logs but as I mentioned above fstrim has worked successfully before.
There is no change in Ubuntu OS version, kernel version or fstrim version.
Is this issue OS related or vSAN related or should I use an alternative tool to unmap, any suggestions?
fstrim output:
> journalctl -u fstrim
systemd[1]: Starting Discard unused blocks...
fstrim[15063]: /mnt/abc: 8.5 GiB (9084649472 bytes) trimmed
fstrim[15063]: /: 1.8 GiB (1896648704 bytes) trimmed
systemd[1]: Started Discard unused blocks.
systemd[1]: Starting Discard unused blocks...
fstrim[9262]: /mnt/abc: 0 B (0 bytes) trimmed
fstrim[9262]: /: 829.2 MiB (869523456 bytes) trimmed
systemd[1]: Started Discard unused blocks.
systemd[1]: Starting Discard unused blocks...
fstrim[2672]: /mnt/abc: 0 B (0 bytes) trimmed
fstrim[2672]: /: 913.5 MiB (957837312 bytes) trimmed
systemd[1]: Started Discard unused blocks.
systemd[1]: Starting Discard unused blocks...
fstrim[1792]: /mnt/abc: 0 B (0 bytes) trimmed
fstrim[1792]: /: 395.1 MiB (414277632 bytes) trimmed
systemd[1]: Started Discard unused blocks.
systemd[1]: Starting Discard unused blocks...
systemd[1]: fstrim.service: Main process exited, code=exited, status=32/n/a
fstrim[3591]: fstrim: /mnt/abc: FITRIM ioctl failed: Remote I/O error
fstrim[3591]: fstrim: /: FITRIM ioctl failed: Remote I/O error
systemd[1]: fstrim.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Discard unused blocks.
systemd[1]: Starting Discard unused blocks...
fstrim[1750]: fstrim: /mnt/abc: FITRIM ioctl failed: Remote I/O error
fstrim[1750]: fstrim: /: FITRIM ioctl failed: Remote I/O error
systemd[1]: fstrim.service: Main process exited, code=exited, status=32/n/a
systemd[1]: fstrim.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Discard unused blocks.
dmesg output:
> dmesg
sd 32:0:1:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 32:0:1:0: [sdb] tag#0 Sense Key : Illegal Request [current]
sd 32:0:1:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
sd 32:0:1:0: [sdb] tag#0 CDB: Unmap/Read sub-channel 42 00 00 00 00 00 00 00 18 00
print_req_error: critical target error, dev sdb, sector 184820928
sd 32:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 32:0:0:0: [sda] tag#0 Sense Key : Illegal Request [current]
sd 32:0:0:0: [sda] tag#0 Add. Sense: Invalid field in cdb
sd 32:0:0:0: [sda] tag#0 CDB: Unmap/Read sub-channel 42 00 00 00 00 00 00 00 18 00
print_req_error: critical target error, dev sda, sector 82568
sg utils output:
> sg_vpd /dev/sdb -p lbpv
Logical block provisioning VPD page (SBC):
Unmap command supported (LBPU): 1
Write same (16) with unmap bit supported (LBWS): 0
Write same (10) with unmap bit supported (LBWS10): 0
Logical block provisioning read zeros (LBPRZ): 0
Anchored LBAs supported (ANC_SUP): 0
Threshold exponent: 1
Descriptor present (DP): 0
Minimum percentage: 0
Provisioning type: 2
Threshold percentage: 0
> sg_vpd /dev/sda -p lbpv
Logical block provisioning VPD page (SBC):
Unmap command supported (LBPU): 1
Write same (16) with unmap bit supported (LBWS): 0
Write same (10) with unmap bit supported (LBWS10): 0
Logical block provisioning read zeros (LBPRZ): 0
Anchored LBAs supported (ANC_SUP): 0
Threshold exponent: 1
Descriptor present (DP): 0
Minimum percentage: 0
Provisioning type: 2
Threshold percentage: 0
> sg_inq /dev/sdb -d
standard INQUIRY:
PQual=0 Device_type=0 RMB=0 LU_CONG=0 version=0x06 [SPC-4]
[AERC=0] [TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2
SCCS=0 ACC=0 TPGS=0 3PC=0 Protect=0 [BQue=0]
EncServ=0 MultiP=0 [MChngr=0] [ACKREQQ=0] Addr16=0
[RelAdr=0] WBus16=1 Sync=1 [Linked=0] [TranDis=0] CmdQue=1
length=36 (0x24) Peripheral device type: disk
Vendor identification: VMware
Product identification: Virtual disk
Product revision level: 2.0
> sg_inq /dev/sda -d
standard INQUIRY:
PQual=0 Device_type=0 RMB=0 LU_CONG=0 version=0x06 [SPC-4]
[AERC=0] [TrmTsk=0] NormACA=0 HiSUP=0 Resp_data_format=2
SCCS=0 ACC=0 TPGS=0 3PC=0 Protect=0 [BQue=0]
EncServ=0 MultiP=0 [MChngr=0] [ACKREQQ=0] Addr16=0
[RelAdr=0] WBus16=1 Sync=1 [Linked=0] [TranDis=0] CmdQue=1
length=36 (0x24) Peripheral device type: disk
Vendor identification: VMware
Product identification: Virtual disk
Product revision level: 2.0