I'm seeing a strange blow-up when trying to delete "Virtual Machines to Hosts" DRS rules using Remove-DrsRule. This only happens with VM host rules; affinity and anti-affinity rules can be removed without any issues.
Anything that I'm missing here?
PowerCLI C:\> get-drsrule -Cluster C1 -Name Test | fl
Name : Test
Enabled : True
ClusterId : ClusterComputeResource-domain-c61
Cluster : C1
ClusterUid : /VIServer=administrator@s34:443/Cluster=ClusterComputeResource-domain-c61/
KeepTogether : False
VMIds : {}
Uid : /VIServer=administrator@s34:443/Cluster=ClusterComputeResource-domain-c61/DrsVMAffinityRule=4/
ExtensionData : VMware.Vim.ClusterVmHostRuleInfo
PowerCLI C:\> get-drsrule -Cluster C1 -Name Test | Remove-DrsRule
Perform operation?
Perform operation 'Removing Drs rule.' on Drs rule 'Test'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
Remove-DrsRule : 2/7/2012 9:20:34 PM Remove-DrsRule
Required property vm is missing from data object of type ClusterAntiAffinityRuleSpec
while parsing serialized DataObject of type vim.cluster.AntiAffinityRuleSpec
at line 1, column 405
while parsing property "info" of static type ClusterRuleInfo
while parsing serialized DataObject of type vim.cluster.RuleSpec
at line 1, column 322
while parsing property "rulesSpec" of static type ArrayOfClusterRuleSpec
while parsing serialized DataObject of type vim.cluster.ConfigSpec
at line 1, column 316
while parsing call information for method ReconfigureCluster_Task
at line 1, column 218
while parsing SOAP body
at line 1, column 207
while parsing SOAP envelope
at line 1, column 38
while parsing HTTP request for method reconfigure
on object of type vim.ClusterComputeResource
at line 1, column 0
At line:1 char:52
+ get-drsrule -Cluster C1 -Name Test | Remove-DrsRule <<<<
+ CategoryInfo : NotSpecified: (:) [Remove-DrsRule], InvalidRequest
+ FullyQualifiedErrorId : Client20_ComputeResourceServiceImpl_RemoveDrsRule_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveDrsRule