跳转到主内容

ONTAP 和 Windows SCSI 取消映射和空间回收

Views:
609
Visibility:
Public
Votes:
2
Category:
flexpod-with-infrastructure-automation
Specialty:
san
Last Updated:

 

适用于

  • ONTAP 9
  • Windows Server 2012,2012 Core,2012 Hyper-V 客户机
  • Windows Server 2012 R2,2012 R2 Core,2012 R2 Hyper-V 客户机
  • Windows Server 2016
  • SnapDrive for Windows (SDW)
  • SnapCenter Plug-in for Windows (SCW)

回答

什么是 SCSI UNMAP?
  • UNMAP command 是在 T10 SCSI 命令集中标准化的咨询 SCSI 命令,用于从已被主机操作系统、应用程序或虚拟机删除的块中回收空间。T10 精简配置技术是当前计算机行业广泛采用的技术,它使用 UNMAP command 来实现提高存储利用率、灵活的容量规划和不间断的存储配置服务。
    • SCSI UNMAP 命令用作 Windows 2012 及更高版本的带内操作。
    • Windows 2008 及更早版本没有本机带内 UNMAP 支持。但是,特定于供应商的带外空间回收可通过 SnapDrive for Windows 和 Data ONTAP PowerShell Toolkit 等应用程序用于 Windows。SnapDrive 空间回收器功能使用供应商特定的打孔命令来删除空间。
  • 由于 UNMAP 是一个咨询命令,SCSI 规范允许目标选择使用成功响应来响应命令,而无需回收指定范围内的所有块。通常,这是由存储阵列因系统负载而执行的,因此在 UNMAP 操作期间可能不会总是回收所有预期的块。
哪些版本的 Windows 和 ONTAP 与带内 SCSI UNMAP 配合良好
  • Data ONTAP 在以下版本中利用 SCSI 带内 UNMAP:
    • 7-Mode 下的 Data ONTAP 8.1.3 及更高版本
    • 集群模式 Data ONTAP 8.2 及更高版本
    • ONTAP 9
  • Windows 操作系统在以下版本中利用带内 UNMAP:
    • Windows Server 2012
    • Windows Server 2012 Core
    • Windows Server 2012 Hyper-V 虚拟机
    • Windows Server 2012 R2
    • Windows Server 2012 R2 Core
    • Windows Server 2012 R2 Hyper-V 虚拟机
    • Windows Server 2016
如何在 Data ONTAP 中启用/禁用此功能
  • 对于 8.1 版本系列中的 Data ONTAP 7-Mode,无需进行任何配置更改即可启用 SCSI UNMAP。从 Data ONTAP 8.2 7-Mode 开始,实施了一项更改,要求在 LUN 上启用space_alloc 选项,才能声明支持并接受 SCSI UNMAP 命令。在 Data ONTAP 8.2 之前,即使没有启用 space_alloc ,SCSI UNMAP 也能完全正常工作,尽管并非所有受支持的 T10 Thin Provisioning 功能都已开启,除非设置了该选项。
  • 对于集群模式 Data ONTAP,对 SCSI UNMAP 的支持始于 8.2 版本系列。要使 LUN 声明支持并接受 SCSI UNMAP 命令,请在你希望使用此功能的 LUN 上启用 space-allocation 选项。
  • 注意: 如果你在 space_alloc 或 space-allocation 设置将 LUN 配置到 Windows 主机,请重启 Windows 主机以便其发现更改后的设置。
如何在 Windows 主机上启用/禁用该功能
  • Data ONTAP DSM 4.0 及更高版本检查 Data ONTAP 版本,并将相应地自适应设置带内 UNMAP。  在 Windows MMC 中,找到存储部分Data ONTAP DSM Management,右键单击并选择 Refresh
  • 对于服务器 Core 版本,这是通过运行 PowerShell cmdlet 'get-sandisk' 命令来执行的。
  • 使用 Windows 本机 DSM (MSDSM) 时,请使用以下相应的 Windows Host Utilities (WHU) 版本:
    • Data ONTAP 8.0.x-->WHU 6.0.1
    • 集群模式 Data ONTAP 8.1.x-->WHU 6.0.1
    • Data ONTAP 8.1.0 - 8.1.2(7-Mode)-->WHU 6.0.1
    • Data ONTAP 8.1.3(7-Mode)-->WHU 6.0.2
    • Data ONTAP 8.2.x – 7-Mode 和集群模式 Data ONTAP--> WUHU 7.1
  • 请参见 Interoperability Matrix Tool ,了解特定于您的配置的建议。
  • *** WHU 6.0.1 --> turns in-band UNMAP off

    fsutil behavior query disabledeletenotify
    DisableDeleteNotify = 1

    *** WHU 6.0.2 --> turns in-band UNMAP on

    fsutil behavior query disabledeletenotify
    DisableDeleteNotify = 0

如何验证 Windows 主机上是否启用或禁用了 SCSI UNMAP
  • 运行命令以从命令提示符验证设置:> fsutil behavior query disabledeletenotify
  • 返回的值(DisableDeleteNotify = 1)表示主机禁用了带内 UNMAP。
  • DisableDeleteNotify = 0 表示主机启用了带内 UNMAP。
如何验证和统计信息收集
  • 当连接到具有不同 SCSI UNMAP 设置的多个 Data ONTAP 控制器时,建议禁用带内 UNMAP。
    您可以通过从集群 shell CLI 运行 statistics 命令并搜索 unmap_reqs 计数器来验证集群模式 Data ONTAP 是否正在接收 UNMAP 命令。
  • 示例:clustername::*> statistics start -object lun -instance /vol/lun1/win2012-lun -vserver svm_name
  • 正在为 Sample-id 启动统计数据收集: sample_60
  • 此时从 Windows 主机生成测试 SCSI UNMAP 命令:
    • clustername::*> statistics stop -sample-id sample_60
  • 正在停止 Sample-id 的统计收集: sample_60
    • clustername::*> statistics show -sample-id sample_60

      Object: lun

      Instance: /vol/lun1/win2012-lun

      Start-time: 3/21/2016 14:23:18

      End-time: 3/21/2016 14:23:56

      Vserver: MySVM

      Number of Constituents: 2 (complete_aggregation)

         Counter                            Value

         -------------------------------- --------------------------------

      {SNIP}

         unmap_reqs                           100

 

  • 要让存储知道块已被释放,它需要从客户端获取 UNMAP 请求。
  • 如果删除数据的 lun 很大,但存储没有收到那么多 unmap 请求,那么我们可能会看到空间回收没有按预期进行。
  • 如果存储需要回收大量数据,那么 NetApp 应该接收大量的 unmap 请求。
  • 在这种情况下,我们需要主机供应商的参与,以了解为什么主机发送的 UNMAP 请求较少。

追加信息

  • 此功能允许操作系统的文件系统阻止已知虚拟磁盘使用虚拟磁盘稀疏文件中的太多块,从而释放 ONTAP 卷上的空间。
  • 这曾经是通过适用于 Windows 的 SnapDrive 空间回收器或适用于 Windows 的 SnapCenter 插件中的空间回收在 Windows 上实现的,由于 SCSI UNMAP 的兼容性,这在 Windows 2008R2 及更早版本上仍然是必需的。
  • 为进一步分析,收集并提供 system node autosupport invoke-performance-archive

警告:  在考虑 Resilient File System (ReFS) 时,如果需要精简配置、TRIM/UNMAP 或 Offloaded Data Transfer (ODX) 等功能,必须使用 NTFS。

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.