ONTAP and Windows SCSI unmap and space reclamation
Applies to
- ONTAP 9
- Windows Server 2012, 2012 Core, 2012 Hyper-V Guests
- Windows Server 2012 R2, 2012 R2 Core, 2012 R2 Hyper-V Guests
- Windows Server 2016
- SnapDrive for Windows (SDW)
- SnapCenter Plug-in for Windows (SCW)
Answer
- What is SCSI UNMAP?
-
UNMAP
command is an advisory SCSI command standardized within T10 SCSI command set, which is used to reclaim space from blocks that have been deleted by the host OS, an application, or a virtual machine. T10 Thin provisioning technology, broadly adopted in the current computer industry, usesUNMAP
command to achieve improved storage utilization, flexible capacity planning, and non-stop storage provisioning service.SCSI UNMAP
command is used as an in-band operation by Windows 2012 and later.- Windows 2008 and earlier have no native in-band UNMAP support. However, vendor specific out-of-band space reclamation is available for Windows through such applications as SnapDrive for Windows and the Data ONTAP PowerShell Toolkit. The SnapDrive Space Reclaimer feature uses a vendor-specific hole-punching command for deleting space.
- As UNMAP is an advisory command, the SCSI specification allows the target the option of responding to the command with a success response without reclaiming all of the blocks in the specified range. Typically, this is performed by storage arrays due to load on the system, and as such it is possible to not always reclaim all of the expected blocks during an UNMAP operation.
- What versions of Windows and ONTAP work well with in-band SCSI UNMAP
-
- Data ONTAP utilizes SCSI in-band UNMAP in following versions:
- Data ONTAP in 7-Mode 8.1.3 and later
- Clustered Data ONTAP 8.2 and later
- ONTAP 9
- Windows operating systems utilize in-band UNMAP in following versions:
- Windows Server 2012
- Windows Server 2012 Core
- Windows Server 2012 Hyper-V Guests
- Windows Server 2012 R2
- Windows Server 2012 R2 Core
- Windows Server 2012 R2 Hyper-V Guests
- Windows Server 2016
- Data ONTAP utilizes SCSI in-band UNMAP in following versions:
- How to enable/disable the feature in Data ONTAP
-
- For Data ONTAP 7-Mode in the 8.1 release family, no configuration change was required to enable SCSI UNMAP. Starting in Data ONTAP 8.2 7-Mode, a change was implemented that required
space_alloc
option be enabled on a LUN for it to advertise support for, and accept SCSI UNMAP commands. Earlier than Data ONTAP 8.2, SCSI UNMAP was fully functional withoutspace_alloc
being enabled, even though not all of the supported T10 Thin Provisioning features were turned on, unless the option was set. - For clustered Data ONTAP, support for SCSI UNMAP begins in the 8.2 release family. For a LUN to advertise support for and accept SCSI UNMAP commands, enable the
space-allocation
option on LUNs, which you expect to use this feature with. - Note: If you change the
space_alloc
orspace-allocation
setting after provisioning a LUN to a Windows host, reboot the Windows host for it to discover the changed setting.
- For Data ONTAP 7-Mode in the 8.1 release family, no configuration change was required to enable SCSI UNMAP. Starting in Data ONTAP 8.2 7-Mode, a change was implemented that required
- How to enable/disable the feature on Windows hosts
-
- Data ONTAP DSM 4.0 and later checks Data ONTAP versions, and will adaptively set in-band UNMAP accordingly. From Windows MMC, locate the storage section Data ONTAP DSM Management, right-click and select Refresh.
- For server Core editions, this is performed by running the
PowerShell cmdlet 'get-sandisk'
command. - When using Windows native DSM (MSDSM), use the corresponding Windows Host Utilities (WHU) version from the following:
- Data ONTAP 8.0.x-->WHU 6.0.1
- Clustered Data ONTAP 8.1.x-->WHU 6.0.1
- Data ONTAP 8.1.0 - 8.1.2 in 7-Mode-->WHU 6.0.1
- Data ONTAP 8.1.3 in 7-Mode-->WHU 6.0.2
- Data ONTAP 8.2.x – in 7-Mode and clustered Data ONTAP--> WUHU 7.1
- See the Interoperability Matrix Tool for recommendations specific to your configuration.
-
*** 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
- How to verify whether SCSI UNMAP is enabled or disabled on a Windows host
-
- Run the command to verify setting from command prompt:
> fsutil behavior query disabledeletenotify
- The returned value (
DisableDeleteNotify = 1
) means in-band UNMAP is disabled for the host. DisableDeleteNotify = 0
means in-band UNMAP is enabled for the host.
- Run the command to verify setting from command prompt:
- How to verify and statistics collection
-
- When connected to multiple Data ONTAP controllers with different SCSI UNMAP settings, it is recommended to disable in-band UNMAP.
You can verify that clustered Data ONTAP is receiving UNMAP commands by running the statistics command from the cluster shell CLI, and searching for theunmap_reqs
counter. - Example:
clustername::*> statistics start -object lun -instance /vol/lun1/win2012-lun -vserver svm_name
- Statistics collection is being started for Sample-id:
sample_60
- Generate test SCSI UNMAP commands from the Windows host at this point:
clustername::*> statistics stop -sample-id sample_60
- Statistics collection is being stopped for 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
- For the storage to know that the blocks have been freed up, it needs to get the UNMAP requests from the client.
- If the lun is huge where the data is being deleted , but storage is not getting those many unmap requests, then we might see space reclamation not happening as expected.
- If storage has large data to reclaim, then NetApp is supposed to be receiving huge unmap requests.
- We need host vendor engagement in such cases to understand why host is sending less UNMAP requests.
- When connected to multiple Data ONTAP controllers with different SCSI UNMAP settings, it is recommended to disable in-band UNMAP.
Additional Information
- This feature allows the File System of the operating system to keep known virtual disks from using too many blocks in the virtual disk sparse file, freeing space on the ONTAP volume.
- This used to be implemented on Windows through SnapDrive for Windows Space Reclaimer or the space reclamation in the SnapCenter PLug-in for Windows, which would still be necessary on Windows 2008R2 and earlier due to compatibility of SCSI UNMAP.
- For further analysis, collect and provide system node autosupport invoke-performance-archive
WARNING: When considering Resilient File System (ReFS), features such as thin provisioning, TRIM/UNMAP, or Offloaded Data Transfer (ODX) are required, NTFS must be used. |