Using the Hyper-V Best Practices Analyzer

Microsoft has created a few rules to help you improve your environments — these are referred to as best practices. However, it is not easy to know all of them and to make sure your Hyper-V servers are compliant with all of these practices.

To make this job easier, Windows Server comes with the BPA.

Which are a set of best practices and rules which it will compare against all the components of your server and it will then generate a report with all the problems that are found during the scan. The report will provide helpful details such as problems, impact, and resolutions for possible issues.

This article provides the steps needed to run the Hyper-V BPA to analyze your systems.

When BPA scans the servers, it shows the results for every scan, providing helpful details about what was scanned, the impact, and even how to resolve any problems it finds. It will also give you the option to apply the necessary changes for your server in compliance with the best practices.

Running BPA via Windows GUI

By following these steps, you will see how to run the best practices analyzer for Hyper-V and explore its results:

  1. Open the Server Manager from the Windows Taskbar.
  2. From the Server Manager window, click on Hyper-V on the pane on the left-hand side. Then use the scroll bar on the right-hand side to scroll down until the best practices analyzer option can be seen.
  3. Under Best Practices Analyzer, navigate to Tasks | Start BPA Scan, as shown in the following screenshot: Start BPA Scan
  4. In the Select Servers window, select the Hyper-V servers that you want to scan and click on Start Scan.
  5. The scan will start on all the selected servers. When the scan has finished, the BPA results will be shown in Server Manager, under Best Practices Analyzer.
  6. When completed, the scan results will be listed in three columns — Server Name, Severity, and Title. Use the filters above each column to organize the information based on your queries.
  7. Click on one of the results to see the information provided by BPA. The following screenshot shows an example of a warning scan result and its description: Best Practices Analyzer Results
  8. Open the results and analyze the problem, impact, and resolution for each server.
  9. Use the filter at the top to find only warnings and errors.
  10. After identifying the results, you can apply the resolutions provided by the Hyper-V BPA.

Running BPA via Command-Line

All of Windows Best Practices are available through PowerShell as well. You can scan, filter, get the results, and extract reports using the PowerShell commandlets.

To start a scan using the Hyper-V BPA, type the following command:

Invoke-BpaModel —BestPracticesModelId Microsoft/Windows/Hyper-V

After invoking the Hyper-V BPA, you can use the Get-BPAResult command to analyze the results. The following command shows the BPA scan results:

Get-BpaResult —BestPracticesModelId Microsoft/Windows/Hyper-V

The following screenshot is an example of how the Get-BPAResult output could look:

Powershell Get-BPAResult output

If you want to filter only the warnings and the errors by using PowerShell, you can also use the following command:

Get-BpaResult -BestPracticesModelId Microsoft/Windows/Hyper-V | Where-Object {$_.Severity —eq "Warning" —or $_.Severity —eq "Error"}