VMware 上取消映射时出现非法请求错误

VMware 上取消映射时出现非法请求错误

我已在 vSAN 上启用取消映射功能,然后关闭/打开所有虚拟机以启用取消映射,如下面的 KB 中所述。

https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.virtualsan.doc/GUID-C75E80AE-2DA8-4314-98E5-B7F8CE98E1BF.html

完成这些程序后我成功完成了取消映射在所有虚拟机上弗斯特里姆并启用fstrim.定时器安排每周运行一次。

到目前为止一切正常。

几周后,我注意到一些虚拟机有以下日志,但正如我上面提到的,fstrim 之前已经成功运行过。

Ubuntu 操作系统版本、内核版本或 fstrim 版本没有变化。

这个问题与操作系统或 vSAN 有关吗?或者我应该使用其他工具来取消映射,有什么建议吗?

fstrim 输出:

> 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 输出:

> 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 输出:

> 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 

答案1

当您使用 unmap 来回收空间时,此任务应在 LUN 上完成(本例中是在 VSAN 上)。我在您的图像上看到 Linux 服务器正在尝试运行 fstrim,但这不是必需的。在 vmware 上,您可以配置空间回收,选择您的 LUN,配置常规并设置空间回收自动。另一个问题是,为什么您要使用 vsan 展示 ISCI LUN?用例是什么?

相关内容