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[]>] [-Type <DrsVMHostRuleType[]>] [-VMGroup <DrsClusterVMGroup[]>] [-VMHostGroup <DrsClusterVMHostGroup[]>] [-Server <VIServer[]>] [<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.