Snapshots age

QND.Hyperv2012R2.VMSnapshotAge.Status (UnitMonitor)

Knowledge Base article:

Summary

It is not recommended to snapshot production VMs. VM Snapshots also have negative impacts on VM and host performance. Instead of alerting on snapshots creation, this monitor checks the age of any snapshots and alert when the snapshot has existed for a period of time.

Configuration

This monitor generates a warning alert if a snapshot age has reached 8 hours and a critical alert if the age has reached 24 hours.

Resolutions

Review the snapshots and delete the if they are no longer required.

Element properties:

TargetQND.Hyperv.2012R2.VM
Parent MonitorSystem.Health.ConfigurationState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeQND.Hyperv2012R2.VMSnapshot.MT
RemotableTrue
AccessibilityPublic
Alert Message
Hyper-V - Old snapshot is present
Oldest snapshot age in hours is:{0}.
History:
{1}
RunAsDefault

Source Code:

<UnitMonitor ID="QND.Hyperv2012R2.VMSnapshotAge.Status" Accessibility="Public" Enabled="true" Target="QND.Hyperv.2012R2.VM" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="QND.Hyperv2012R2.VMSnapshot.MT" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="QND.Hyperv2012R2.VMSnapshotAge.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='OldestSnapshotAgeHours']$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='SnapshotHistory']$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>7200</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>120</TimeoutSeconds>
<TraceLevel>2</TraceLevel>
<VMId>$Target/Property[Type='QND.Hyperv.2012R2.VM']/VirtualMachineId$</VMId>
<SnapshotAgeHoursWarningThreshold>8</SnapshotAgeHoursWarningThreshold>
<SnapshotAgeHoursErrorThreshold>24</SnapshotAgeHoursErrorThreshold>
</Configuration>
</UnitMonitor>