Storage spaces file share monitor based on virtual disk health
Storage Spaces File Share Virtual Disk Monitor generates an alert when the health of a virtual disk is unhealthy.
A virtual disk is spread out over several of the physical disks within a storage pool. If one or more of the physical disks associated with a virtual disk go unhealthy, attempts to rebuild data are made by reallocating data to other healthy disks. If that attempt fails due to a lack of free capacity or for any other reason, the virtual disk may become unhealthy.
In order to restore the health of your virtual disk, replace physical disks within the storage pool of this virtual disk which have failed, or add extra capacity to the storage pool. In order determine which physical disks in the storage pool are unhealthy, use the following PowerShell cmdlets, examples of which are shown below:
Remove disk from storage pool:
$storagePool = Get-VirtualDisk -FriendlyName "VirtualDiskName" | Get-StoragePool
Get unhealthy physical disks:
Get-PhysicalDisk –StoragePool $storagePool | Where-Object –FilterScript {$_.HealthStatus –ne “Healthy”}
Run below cmdlets for each unhealthy physical disk:
$PDToRemove = Get-PhysicalDisk –FriendlyName “PhysicalDiskName”
Remove-PhysicalDisk -PhysicalDisks $PDToRemove -StoragePool $storagePool
Add disk to storage pool:
$storagePool = Get-VirtualDisk -FriendlyName "VirtualDiskName" | Get-StoragePool
$PDToAdd = Get-PhysicalDisk -FriendlyName PhysicalDisk5
Add-PhysicalDisk -PhysicalDisks $PDToAdd –StoragePool $storagePool
Target | Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SystemCenter.StorageSpaces.EventWatcher.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SystemCenter.OperationsManager.Storage.StorageSpacesMonitor" Accessibility="Public" Enabled="true" Target="SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.StorageSpaces.EventWatcher.MonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.OperationsManager.Storage.StorageSpacesMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='VirtualDiskUniqueId']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="SpacesHealthy" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="SpacesUnhealthy" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="SpacesCritical" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ComputerName>.</ComputerName>
<LogName>Microsoft-Windows-StorageSpaces-Driver/Operational</LogName>
<FileShareId>$Target/Property[Type="SL!Microsoft.SystemCenter.VirtualMachineManager.Storage.FileShare.Base"]/SharePath$</FileShareId>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>