PowerCLI Reference

Get-DrsVMHostRule

Synopsis

This cmdlet retrieves VM to VMHost DRS rules that match the specified filters.

Syntax

Get-DrsVMHostRule [[-Name] <String[]>] [[-Cluster] <Cluster[]>] [-Server <VIServer[]>] [-Type <DrsVMHostRuleType[]>] [-VMGroup <DrsClusterVMGroup[]>] [-VMHostGroup <DrsClusterVMHostGroup[]>] [<CommonParameters>]

Related Commands

Online Version
New-DrsVMHostRule
Remove-DrsVMHostRule
Set-DrsVMHostRule

Detailed Description

This cmdlet retrieves VM to VMHost DRS rules that match the specified filters.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the names of the DRS rules you want to retrieve.falseFalse
ClusterCluster[]Specifies the DRS clusters from which you want to retrieve rules.falseTrue (ByValue)
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falseFalse
TypeDrsVMHostRuleType[]Specifies the types of DRS rules you want to retrieve. This parameter accepts MustRunOn, ShouldRunOn, MustNotRunOn, and ShouldNotRunOn values.falseFalse
VMGroupDrsClusterVMGroup[]Filters rules by VM group.falseTrue (ByValue)
VMHostGroupDrsClusterVMHostGroup[]Filters rules by VMHost group.falseTrue (ByValue)

Return Type

Zero or more DrsVMHostRule objects

Notes

Examples

-------------------------- Example 1 --------------------------

Get-DrsVMHostRule -Type "MustRunOn"

Retrieves all VM to VMHost DRS rules, which are of type "MustRunOn".

-------------------------- Example 2 --------------------------

$cluster = Get-Cluster "MyCluster"
Get-DrsVMHostRule -VMHostGroup "MyDrsVMHostGroup" -Cluster $cluster

Retrieves all available VM to VMHost DRS which include the "MyDrsVMHostGroup" DRS VMHost group in the "MyCluster" cluster.


Copyright © VMware, Inc. All rights reserved.