< Back

Get-DrsVMHostRule

Sun Jan 19, 2020 6:50 pm

NAME 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>]





DESCRIPTION

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





PARAMETERS

-Cluster <Cluster[]>

Specifies the DRS clusters from which you want to retrieve rules.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-Name <String[]>

Specifies the names of the DRS rules you want to retrieve.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Server <VIServer[]>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Type <DrsVMHostRuleType[]>

Specifies the types of DRS rules you want to retrieve. This parameter accepts MustRunOn, ShouldRunOn,

MustNotRunOn, and ShouldNotRunOn values.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMGroup <DrsClusterVMGroup[]>

Filters rules by VM group.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-VMHostGroup <DrsClusterVMHostGroup[]>

Filters rules by VMHost group.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more DrsVMHostRule objects







NOTES









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



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... tRule.html

New-DrsVMHostRule

Remove-DrsVMHostRule

Set-DrsVMHostRule