SCOM: Hyper-V MP: Not enough free disk space

Hyper-V MP can generate a “not enough free disk space” alert even if there is no free space issue.

Hyper-V MP Low free space alert

The monitor is configured to generate an alert if free disk space is less than 2 GB. However, the script used in this monitor’s datasource does not errors and rather reports free disk space as 0 when it is unable to calculate the actual free disk space on the drive that is hosting the VHD, or ISO image attached to VMs’ DVD drive. You can confirm this by looking at the monitor’s state change context in Health explorer. All three, total, free and used space will be 0.

Monitor Context

One such case is when the agent action account (AAA) or privileged monitoring account does not have access to the network share from where the ISO is mounted. It is possible that the user who mounted the ISO had access to the share, but the AAA does not have the same access. If you are using Local System account as AAA, make sure Hyper-V host’s computer account can access the root of the share. For example, if the ISO is mounted from \\fileserver\software\MS products\windows2012.iso, AAC should be able to access \\fileserver\software.

Below is the script used by this monitor’s datasource (external link). I have modified it a bit to output debug info to test it on an actual host under Local System account. You can refer this post (external link) to run PowerShell under LSA. Also, I found that the original script has a bug. It actually fails to calculate the used space and always reports 0. So you will actually never get an alert when the issue is real. Reported here (external link).

Once you have given access to AAA on that share, run the script again to verify it can get all three values as shown below.

Script output when AAA doesn’t have access:


Script output when AAA does have Access:


About Dinesh Sharma

Experienced system architect, programmer, and trainer. This blog is a way of giving back and helping the community. So feel free to ask a question or to leave a comment.