Dynamic and differencing VHDs can be fragmented over time. This monitor checks the VHD fragmentation level. This monitor is disabled by deafult since it can be very noisy. VHD(x) fragmentation is related to the intenrla logical structure of the virtual disk, there are other two posssibile fragmenetations: at the hyper-v host file system level and at the guest file system level.
A warning alert is raised when the fragmentation level has reached the threshold of 30% and a critical alert is raised when it has reached 50%.
The easiest way to defrag the VHD is to perform a storage migration.
When a VHD(x) gets fragmentated the performance are affected. From first informal tests it appears that random reads are particularly affected with a penality of more than 50% in trhoughput for a 100% fragmented VHD.
Target | QND.HyperV.2012R2.VirtualDrive | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | QND.Hyperv2012R2.VHDFragmentation.MT | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="QND.Hyperv.2012R2.VHDFragmentation.Monitor" Accessibility="Public" Enabled="false" Target="QND.HyperV.2012R2.VirtualDrive" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="QND.Hyperv2012R2.VHDFragmentation.MT" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="QND.Hyperv.2012R2.VHDFragmentation.Monitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name="FragPerc"]$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="OverThreshold1" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>14200</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>600</TimeoutSeconds>
<TraceLevel>2</TraceLevel>
<VirtualDiskId>$Target/Property[Type='QND.HyperV.VMHardwareComponent']/DeviceId$</VirtualDiskId>
<FragmentationWarningThreshold>30</FragmentationWarningThreshold>
<FragmentationErrorThreshold>50</FragmentationErrorThreshold>
</Configuration>
</UnitMonitor>