vSphere PowerCLI Reference

Get-DrsRule

Synopsis

Retrieves the list of DRS rules for the specified clusters.

Syntax

Get-DrsRule [[-Name] <String[]>] [-Cluster] <Cluster[]> [[-VM] <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-DrsRule
Remove-DrsRule
Set-DrsRule

Detailed 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

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specify the name of the DRS rule you want to retrieve.falsefalse
ClusterCluster[]Specify the clusters, for which you want to retrieve the DRS rules.truetrue (ByValue)
VMVirtualMachine[]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.falsetrue (ByValue)
ServerVIServer[]Prompts you for confirmation before running the command.falsefalse

Return Type

DrsVMAffinityRule

Notes

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".


Copyright © 1998 - 2011 VMware, Inc. All rights reserved.