<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get DRS rule conflicts in cluster using web services api in vSphere Management SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Management-SDK/get-DRS-rule-conflicts-in-cluster-using-web-services-api/m-p/2980714#M14794</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;When we create Anti-Affinity and then Affinity Rule for the same VMs. The Affinity rule should become invalid(enabled = false)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e. Anti-Affinity conflicting with Affinity Rule.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;API to get the status:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ClusterComputeResource -&amp;gt; ClusterConfigInfo -&amp;gt; ClusterRuleInfo -&amp;gt; &lt;STRONG&gt;isEnabled&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;eg:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;boolean status = ruleInfo[1].getInfo().isEnabled();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A title="Data Object - ClusterRuleInfo(vim.cluster.RuleInfo)" href="https://vdc-download.vmware.com/vmwb-repository/dcr-public/fa5d1ee7-fad5-4ebf-b150-bdcef1d38d35/a5e46da1-9b96-4f0c-a1d0-7b8f3ebfd4f5/doc/vim.cluster.RuleInfo.html" target="_self"&gt;Data Object - ClusterRuleInfo(vim.cluster.RuleInfo)&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;enabled (boolean)&lt;/STRONG&gt; ==&amp;gt; Flag to indicate whether or not the rule is enabled. Set this property when you configure the rule. The default value is false (disabled). If there is a rule conflict, the Server can override the setting to disable a rule.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 04 Aug 2023 06:05:39 GMT</pubDate>
    <dc:creator>doskiran</dc:creator>
    <dc:date>2023-08-04T06:05:39Z</dc:date>
    <item>
      <title>get DRS rule conflicts in cluster using web services api</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/get-DRS-rule-conflicts-in-cluster-using-web-services-api/m-p/2976219#M14792</link>
      <description>&lt;P&gt;Hi, I'm trying to find a way to retrieve the DRS rules that have conflicts using the web services api.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Humphry_0-1688736200855.png" style="width: 400px;"&gt;&lt;img src="https://communities.vmware.com/t5/image/serverpage/image-id/102497iB4CFDBA9D339B3DE/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Humphry_0-1688736200855.png" alt="Humphry_0-1688736200855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've been able to get the DRS rules config in the ClusterComputeResource-&amp;gt;configuration-&amp;gt;rule:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;rule = (vim.cluster.RuleInfo) [
   (vim.cluster.AntiAffinityRuleSpec) {
      dynamicType = &amp;lt;unset&amp;gt;,
      dynamicProperty = (vmodl.DynamicProperty) [],
      key = 4,
      status = &amp;lt;unset&amp;gt;,
      enabled = true,
      name = 'AFLSDKH',
      mandatory = &amp;lt;unset&amp;gt;,
      userCreated = true,
      inCompliance = &amp;lt;unset&amp;gt;,
      ruleUuid = '5224c444-3cd1-084b-54d5-2576b510d49a',
      vm = (vim.VirtualMachine) [
         'vim.VirtualMachine:vm-1040',
         'vim.VirtualMachine:vm-1044'
      ]
   },
   (vim.cluster.AffinityRuleSpec) {
      dynamicType = &amp;lt;unset&amp;gt;,
      dynamicProperty = (vmodl.DynamicProperty) [],
      key = 5,
      status = &amp;lt;unset&amp;gt;,
      enabled = false,
      name = 'asdfasg',
      mandatory = &amp;lt;unset&amp;gt;,
      userCreated = true,
      inCompliance = &amp;lt;unset&amp;gt;,
      ruleUuid = '523fee15-9eaf-0a51-3276-82046d4caaf0',
      vm = (vim.VirtualMachine) [
         'vim.VirtualMachine:vm-1044',
         'vim.VirtualMachine:vm-1040'
      ]
   }
]&lt;/LI-CODE&gt;&lt;P&gt;But I cannot find anywhere the info about the conflicts of each rule and the vms in conflict.&lt;/P&gt;&lt;P&gt;Does anybody know how to retrieve this info?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 13:30:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/get-DRS-rule-conflicts-in-cluster-using-web-services-api/m-p/2976219#M14792</guid>
      <dc:creator>Humphry</dc:creator>
      <dc:date>2023-07-07T13:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: get DRS rule conflicts in cluster using web services api</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/get-DRS-rule-conflicts-in-cluster-using-web-services-api/m-p/2980714#M14794</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;When we create Anti-Affinity and then Affinity Rule for the same VMs. The Affinity rule should become invalid(enabled = false)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e. Anti-Affinity conflicting with Affinity Rule.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;API to get the status:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ClusterComputeResource -&amp;gt; ClusterConfigInfo -&amp;gt; ClusterRuleInfo -&amp;gt; &lt;STRONG&gt;isEnabled&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;eg:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;boolean status = ruleInfo[1].getInfo().isEnabled();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A title="Data Object - ClusterRuleInfo(vim.cluster.RuleInfo)" href="https://vdc-download.vmware.com/vmwb-repository/dcr-public/fa5d1ee7-fad5-4ebf-b150-bdcef1d38d35/a5e46da1-9b96-4f0c-a1d0-7b8f3ebfd4f5/doc/vim.cluster.RuleInfo.html" target="_self"&gt;Data Object - ClusterRuleInfo(vim.cluster.RuleInfo)&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;enabled (boolean)&lt;/STRONG&gt; ==&amp;gt; Flag to indicate whether or not the rule is enabled. Set this property when you configure the rule. The default value is false (disabled). If there is a rule conflict, the Server can override the setting to disable a rule.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 04 Aug 2023 06:05:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/get-DRS-rule-conflicts-in-cluster-using-web-services-api/m-p/2980714#M14794</guid>
      <dc:creator>doskiran</dc:creator>
      <dc:date>2023-08-04T06:05:39Z</dc:date>
    </item>
  </channel>
</rss>

