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 :

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
or use the powershell command:


Be the first to comment

Leave a Reply

Your email address will not be published.