New Base OS MP 6.0.6667.0 adds file fragmentation monitor to all Logical Disks


I recently blogged about the new Base OS MP that was recently released:  HERE

 

One of the things you will notice RIGHT off the bat… is that a huge percentage of your logical disks will go into a warning state, if you don’t already have some sort of scheduled defragmentation set up.  This will be true for virtual machines and physical machines…. anything over 10 percent file fragmentation (or the OS recommended setting) will get hit:

 

image

 

image

 

You will also get many warning alerts on this monitor…. the first time the condition is detected and the state changes for this monitor.  This monitor checks status every Saturday, at 3:00AM by default, for all logical disks discovered.

 

image

 

 

If you don’t care about this monitoring in SCOM – disable this monitor using overrides.

If you do care about seeing the state change – but don’t want the alerts – turn the “Generates Alert” property to False, using overrides.

 

You can adjust the threshold from 10% to some other number…. but make sure you take note – this monitor will ignore the “File Percent Fragmentation” property by default, and always use the OS recommended setting.  If you want to control this – you also need to set “Use OS Recommendation” to FALSE.

 

Here is an example of hard coding the frag percentage to 20% from the OS default:

image

 

“Use OS Recommendation” property description:

image

 

 

Lastly – one thing of interest….  If you want SCOM to “fix” the fragmentation issue…. it can.  There is a recovery on this very monitor that can run a VBScript that will run a defrag job against your logical disks.  It is disabled by default. 

 

image

 

Keep in mind – if you turn on this defrag…. on your physical boxes – it wont be a big deal… it will simply fix the fragmentation issue.  However – this will also run on ALL yours VM’s.  If this was triggered all at the same time – Saturday at 3:00AM by default – this can kill the disk I/O on the disk subsystem hosting your VM/VHD files.  Keep this in mind if you decide to enable this….   This recovery will only run when the state change is detected… as a recovery to the condition, so any disks that are already in a warning state will not run this recovery should you enable it.  This defrag has a timeout of 1 hour…. so it should kill the defrag if it cannot complete within an hour.

 

Another cool thing to do – is to use the recovery action as a single run-time task. You can do this right from health explorer, to fix the disks on your own schedule:

 

image

 

Just click the link, and run the task:

image

 

Minimize this…. and just let it run – you can come back in 1 hour – and see if it completed, or timed out.

 

You can also monitor for task status in the Task Status list in the console:

 

image

 

 

On the agent – you will see the following events logged in the OpsMgr event log:

 

Log Name:      Operations Manager
Source:        Health Service Script
Date:          9/28/2009 10:50:04 AM
Event ID:      4002
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      OMDW.opsmgr.net
Description:
Microsoft.Windows.Server.LogicalDisk.Defrag.vbs : Perform Defragmentation (disk: C:; computer: OMDW.opsmgr.net).

And when completed:

 

Log Name:      Operations Manager
Source:        Health Service Script
Date:          9/28/2009 11:03:44 AM
Event ID:      4002
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      OMDW.opsmgr.net
Description:
Microsoft.Windows.Server.LogicalDisk.Defrag.vbs : Defragmentation completed (disk: C:; computer: OMDW.opsmgr.net): FilePercentFragmentation = 0.

Comments (21)

  1. Anonymous says:

    Andy, did you ever find a solution to your problem?  I also would like to enable the auto recovery option, but its grayed out.

  2. Kevin Holman says:

    You enable recoveries via overrides.  On the monitor – go to the overrides tab – there you can enable the recovery if you so choose.

  3. Murad Akram says:

    Kevin,

    My 2nd question – I do have the 'fragmentation monitor Recovery Task" enabled as I like SCOM to just auto run this every this monitor changes state. Now my question is, where can I go and see if this task for kicked-in and on how many servers it ran the recovery? Is there a view/report/dashboad out of the box or is there a way I can create something report/view/dashboard to check up on this recovery task?

    Thanks

    MA

  4. Murad Akram says:

    Kevin,

    Here is another thing I found about this server where my defrag task is erroring-out  – Under "C:Program FilesSystem Center Operations Manager 2007Health Service StateMonitoring Host Temporary Files 16" when I search for the "Microsoft.Windows.Server.LogicalDisk.Defrag.vbs " script it's not there. I do see bunch of other .vbs scripts including the (Microsoft.Windows.Server.LogicalDisk.DefragAnalysis.vbs) but not the "Defrag.vbs" does that give of any indications why my defrag task isn't doing it's job?

    Thanks

    MA

  5. Kevin Holman says:

    Guys – you cannot edit a recovery – you override the recovery.

  6. Kevin Holman says:

    pretty sure this is only a 2 state monitor – only one threshold.

  7. Murad Akram says:

    Hello Kevin, First of all nice job on creating this art.

    Here is my situation:

    When I run the single "Logical Disk Defragmentation Task" from within the SCOM console, the task status shows "Successfully completed" but when I logon to the server where the task was suppose to run, I am seeing the following error message under the OpsMgr Event log (see below). (I underestand the task status within SCOM only means that SCOM was able to execute the "Microsoft.Windows.Server.LogicalDisk.Defrag.vbs" command and doesn't mean that it actually defragmented the drive). Any idea why the script is failing??

    Event Type: Error

    Event Source: Health Service Script

    Event Category: None

    Event ID: 4001

    Date: 9/22/2010

    Time: 1:49:22 PM

    User: N/A

    Computer: WINDOWS_2003_SERVER

    Description:

    Microsoft.Windows.Server.LogicalDisk.Defrag.vbs : Defrag failed (disk: C:; computer: Windowsserver.domain.com). Return code: 8..

    For more information, see Help and Support Center at go.microsoft.com/…/events.asp.

  8. curtiss says:

    is there any documentation on the output? my tasks are "succeeding" but the output text for all my sql servers and a few others is

    Defrag failed (disk: D:; computer: agent.domain.com). Return code: 2..

    or sometimes the return code is 8.

    also sometimes when it does succeed fragmentation is still pretty high:

    Defragmentation completed (disk: C:; computer: otheragent.domain.com): FilePercentFragmentation = 36

  9. I find it useful to change the day to the evening overnight of install. As a consultant it is good to this checked then rather than over a weekend when I might not be back onsite for a few weeks.

    http://technet.microsoft.com/en-us/library/dd391818.aspx

    The DaysOfWeekMask element represents one or more days of the week that the window should run. A single day or multiple days can be specified according to the following values:

    Day Value

    Sunday

    1

    Monday

    2

    Tuesday

    4

    Wednesday

    8

    Thursday

    16

    Friday

    32

    Saturday

    64

    To specify a single day, enter the enumerator value for that day into the DaysOfWeekMask configuration element.

    To specify multiple days, add the values for the days together. For example, for Monday, Wednesday and Friday you would specify 42 (2+8+32).

    Multiple windows can be specified as shown in the following example, which has two windows, one from 9:00 to 10:00, Monday to Friday and the other 17:00 to 18:00, Monday and Friday:

  10. Also, note that there is no monitor for windows 2000 logical disk (either server or client) or any other client monitoring (including no monitoring of business critical desktops).

    Cheers

    Graham

  11. Dominique says:

    Hello,

    Where could I find the OS Recommended value running by default?

    This article is excellent but the management wants to know the default values before approving the changes…

    As it could be different foe each OS, hardware a sample would be fine

    Thanks,

    Dom

  12. Dan_IT says:

    How do you enable the recovery to fix the state?  I cant figure out that opiton, the run auto box is grayed out.

  13. nick says:

    Hi Kevin

    further to this mgt pack and the logical disk drive fragmentation monitor – is it possible to set 2 levels for the alerts eg a warning at 60% fragmentation which clocks over to a Critical at 85%? If so how do we do it? I see the Health tab shows the two standard levels but doesn’t look like you can edit to add a 3rd and associated thresholds for each?

    thanks in advance!

    Nick

  14. IcI says:

    Hi.

    My Exchange and SQL servers report 99% fragmentation on drive that hold the DB.

    Where can I read up on SQL / Exchange and file system fragmentation? Especially as they are iSCSI drives.

  15. ck says:

    On Win2008 R2 CSV… it give crash on cluster.

    disble the monitor to all Logical Disks

  16. Wei says:

    Hello, is there a way I can pull the context info (eg. Time, Operational State)per state change of a monitor from Command Shell ?

    Cheers,

    Wei

  17. Andy says:

    Hi.

    I am new to SCOM and wish to enable the Auro Recovery option.

    Whne I go to the monitor I find the auto recovery is gred out how can I change this.

    Andy

  18. Andy says:

    Hi.

    I am new to SCOM and wish to enable the Auto Recovery option.

    Whne I go to the monitor I find the auto recovery is gred out how can I change this.

    Andy

  19. Fahim, GTA says:

    Kevin,

    Thanks for another wonderful article….although going through monitor's properties kind of shows all the information but its good to have in an article if I need to make "someone" agree to do this 😉 . However, i wonder how a 2003 cluster reacts to this…does the monitor & recovery task for 2003 OS cause crash like someone else mentioned about 2008 r2 CSV? I wonder. Please let us know.

    Thanks again for your all contributions.

    fahim

  20. Bashar says:

    Kevin, what could the impacts on servers in live (Production) Environment on VM's as well as all our servers virtualize.

    thanks in Advance for you help.

    Bashar

  21. Anonymous says:

    New Base OS MP 6.0.6667.0 adds file fragmentation monitor to all Logical Disks – Kevin Holman’s System Center Blog – Site Home – TechNet Blogs