Syntax
Get-DrsRule [[-Name] <String[]>] [-Cluster] <Cluster[]> [[-VM] <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>]Related Commands
Online versionDetailed Description
Retrieves the list of DRS rules for the specified clusters. Each rule defines the virtual machines that can run on the same host (affinity rule) or must run on different hosts (anti-affinity).Parameters
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| Name | String[] | Specify the name of the DRS rule you want to retrieve. | false | false | |
| Cluster | Cluster[] | Specify the clusters, for which you want to retrieve the DRS rules. | true | true (ByValue) | |
| VM | VirtualMachine[] | Specify virtual machines to filter the DRS rules that reference them. Passing values to this parameter through a pipeline is deprecated and will be removed in a future release. | false | true (ByValue) | |
| Server | VIServer[] | Prompts you for confirmation before running the command. | false | false |
Return Type
DrsVMAffinityRuleNotes
Examples
-------------- Example 1 --------------
Get-DrsRule -Cluster $cluster -Name "*Rule1*"
Retrieves the DRS rules for the cluster stored in the $cluster variable, whose names contain 'Rule1".