Test-Cluster Powershell cmdlet List vs Validate
The Powershell cmdlet Test-Cluster
queries a myriad of data and performs validation tests which it wraps into a pretty report. If you run Test-Cluster -List
you get a list of item's you can individually query with the cmdlet. There's a common naming scheme when you read the DisplayName
's. They all start with either "List" or "Validate".
Obviously "Validate" is going to actually test the failover by failing. But naming something "List" makes me think it's just a query for data as is at the time it was run. I've tested this with the following script:
$TestList = Test-Cluster -List | Where-Object {$_.DisplayName -like "List*"}
Test-Cluster -Include $TestList.DisplayName -ReportName "c:\cluster reports\report"
I don't see any logged cluster errors or notice any failover activity while this report is generated. Microsoft technet isn't exactly clear on this either, but they do infer that the behavior is inline with what I'm thinking it is. See this excerpt (emphasis mine):
Test results are captured in a file with the file name that you specify. By running the validation tests, you can confirm that your hardware and settings are compatible with Failover Clustering. There are multiple types of tests, including Cluster, Inventory, Network, Storage, System, and other types of tests. Storage tests will not test online disks or storage pools that are in use by a clustered role. To test such disks, first run Stop-ClusterGroup to stop the clustered role, and then run Test-Cluster. After the tests are done, start the clustered roles, also known as resource groups, again.
Test-Cluster TechNet Page
I'd like to call your attention to their use of the word "Validation". Additionally, when running that script, as part of the output it says:
Test Result:
ClusterSkippedTestsCompleted
If you include a validation test the result is:
Test Result:
ClusterConditionallyApproved
In my test environment the network tests generated some warnings which triggered the conditional approval. I've googled quite a bit to find documentation which describes the logic behind the "Validate" vs "List" split but I haven't turned up anything. This leads to the question...
Do list requests trigger a failover event?
Solution 1:
The split between Validation and List is intended to direct what result to expect. Validation tests are boolean and return pass/fail, yes/no, up/failed, etc. The List tests return statistical and operational data for review.
Microsoft built the tests with Zero Downtime in mind. And for the most part that's true. There are tests which will trigger a failover and cause downtime. They are:
- Validate Disk Arbitration
- Validate Disk Failover
- Validate Multiple Arbitration
- Validate SCSI-3 Persistent Reservation
- Validate Simultaneous Failover
It's important to note that if Test-Cluster
is run without usage of either the include or exclude parameters, it will run those tests. While the above listed tests will trigger a failover event, the following tests can impact performance. They are:
- Validate Disk Access Latency
- Validate File System
- Validate Microsoft MPIO-based disks
- Validate SCSI Device Vital Product Data
All of the tests listed above are part of the storage category. As such it's typically recommended that the storage tests be avoided on a server in production. To exclude these tests run the following command:
Test-Cluster -Ignore Storage
If you're using the Include
parameter to selectively choose your tests, there are two safe storage tests you can run. They are:
- List All Disks
- List Disks To Be Validated
Source 1 and Source 2
All available cluster tests are grouped into 5 test categories. They are Cluster Configuration
, Inventory
, Network
, Storage
, and System Configuration
. Only the Storage
category contains tests which will trigger a failover or impact performance (according to Microsoft that is). Additionally, most of these test categories are not intended to be executed after the cluster is certified and operational. Except for one that is...
For Existing Clusters
Microsoft designed Cluster Configuration
tests for use on an existing cluster. In fact, these tests only run on existing clusters. To execute this test category run the following command:
Test-Cluster -Include "Cluster Configuration"
Source 3