Windows Server 2012 VM – default defrag behavior conflicts with best practices setup from NetApp – Solution

I found out that in Windows Server 2012 there was a major change in the way defrag is setup. In our server 2008r2 we disabled defragmentation in the past as the defragging happens at the underlying storage level and enabling this service could have a negative impact on performance. As this was a service, we just disabled this service

NetApp Storage Best Practices for VMware vSphere Pg. 6 : http://www.netapp.com/us/media/tr-3749.pdf

DISK DEFRAGMENTATION UTILITIES
VMs stored on NetApp storage arrays should not use disk defragmentation utilities because the WAFL file system is designed to optimally place and access data at a level below the guest operating system (GOS) file system.

In server 2012 there IS no service… they moved this feature to a scheduled task…

It’s a pity that there is no documentation or whitepaper on how to do this.

So I started searching and found the following solutions to disable defragmentation in windows server 2012
PowerShell: Get-ScheduledTask ScheduledDefrag | Disable-ScheduledTask
GPO: Create computer based GPO logon script and put in GPO :  schtasks /change /tn “microsoft\windows\defrag\ScheduledDefr

Here are the links that helped me
https://technet.microsoft.com/en-us/library/cc770904.aspx
or use the powershell command:
https://social.technet.microsoft.com/Forums/windows/en-US/bb635af5-3af3-4803-b4b2-8f0be50ae442/gpo-to-remove-ssd-from-scheduled-optimization?forum=w8itprogeneral

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*