Syntax
Get-DrsVMHostRule [[-Name] <String[]>] [[-Cluster] <Cluster[]>] [-Server <VIServer[]>] [-Type <DrsVMHostRuleType[]>] [-VMGroup <DrsClusterVMGroup[]>] [-VMHostGroup <DrsClusterVMHostGroup[]>] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet retrieves VM to VMHost DRS rules that match the specified filters.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String[] | Specifies the names of the DRS rules you want to retrieve. | false | False | |
Cluster | Cluster[] | Specifies the DRS clusters from which you want to retrieve rules. | false | True (ByValue) | |
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. | false | False | |
Type | DrsVMHostRuleType[] | Specifies the types of DRS rules you want to retrieve. This parameter accepts MustRunOn, ShouldRunOn, MustNotRunOn, and ShouldNotRunOn values. | false | False | |
VMGroup | DrsClusterVMGroup[] | Filters rules by VM group. | false | True (ByValue) | |
VMHostGroup | DrsClusterVMHostGroup[] | Filters rules by VMHost group. | false | True (ByValue) |
Return Type
Zero or more DrsVMHostRule objectsNotes
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.