Bug 259292 - vmware/pvscsi: UNMAP fails on VMWare 6.7 thinly provisioned disk running zpool trim: UNMAP failed, disabling BIO_DELETE
Summary: vmware/pvscsi: UNMAP fails on VMWare 6.7 thinly provisioned disk running zpoo...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-10-20 04:26 UTC by Michal Vanco
Modified: 2025-01-15 10:10 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback? (jpaetzel)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Vanco 2021-10-20 04:26:42 UTC
Hi,

VM on VMware 6.7 with pvscsi and thinly provisioned disk generates the following error:

(da0:pvscsi0:0:0:0): UNMAP failed, disabling BIO_DELETE
(da0:pvscsi0:0:0:0): UNMAP. CDB: 42 00 00 00 00 00 00 00 08 00 
(da0:pvscsi0:0:0:0): CAM status: SCSI Status Error
(da0:pvscsi0:0:0:0): SCSI status: Check Condition
(da0:pvscsi0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
(da0:pvscsi0:0:0:0): Command byte 7 is invalid
(da0:pvscsi0:0:0:0): Error 22, Unretryable error

This error occurs when I try to run zpool trim zroot. When I replace the VM's SCSI controller with SATA, trimming seems to be working ok.
Comment 1 Jesse Rehmer 2023-07-07 23:26:08 UTC
Confirmed same behavior with ESXi 8.0 and FreeBSD 13.2-p1.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2024-10-04 12:51:10 UTC
^Triage: clear unneeded flags.  Nothing has yet been committed to be merged.
Comment 3 JenniferJCaison 2024-11-15 06:56:17 UTC
MARKED AS SPAM
Comment 4 Zhenlei Huang freebsd_committer freebsd_triage 2025-01-15 10:00:14 UTC
It appears that VMware falsely reports that it supports UNMAP but actually not. Can you verify that the underlaying filesystem is VMFS6 or vSAN 6.7 Update 2 ?

1. https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.storage.doc/GUID-B40D1420-26FD-4318-8A72-FA29C9A395C2.html
2. https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vsan.doc/GUID-0D401315-366D-4E5C-AF9F-3D2FBCE020C2.html
Comment 5 Zhenlei Huang freebsd_committer freebsd_triage 2025-01-15 10:10:53 UTC
Tested with 13.1-RELEASE and latest stable/13 (FreeBSD 13.4-STABLE stable/13-n258978-519121f5ea03 GENERIC amd64) on ESXi 6.7.0, both pvscsi and emulated sata controller work as intended.


```
# root@:~ # zpool trim tank && zpool trim testpool && zpool status
  pool: tank
 state: ONLINE
config:

	NAME        STATE     READ WRITE CKSUM
	tank        ONLINE       0     0     0
	  da1       ONLINE       0     0     0  (trimming)

errors: No known data errors

  pool: testpool
 state: ONLINE
config:

	NAME        STATE     READ WRITE CKSUM
	testpool    ONLINE       0     0     0
	  ada0      ONLINE       0     0     0  (trimming)

errors: No known data errors
```