Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Storage DRS Anti-Affinity Rules by set Orchestrator workflow/action

$
0
0

Hi All,

 

Has anyone of you ever checked the vCenter SDK for how to create a  Storage DRS Anti-Affinity Rule for a specific VM?

 

Below is the code for how to add VM's to a VcCluster compute Anti Affinity Rule. But is there a lookalike code for a  Storage DRS Anti-Affinity Rule?

 

//Set rule spec attributes

affinitySpec = new VcClusterAntiAffinityRuleSpec();

affinitySpec.enabled = true;

affinitySpec.name = group_name;

affinitySpec.userCreated = true;

affinitySpec.vm = vms;

 

//Apply RuleSpec

var clusterRuleSpec = new Array(new VcClusterRuleSpec());

clusterRuleSpec[0] = new VcClusterRuleSpec()
clusterRuleSpec[0].operation = VcArrayUpdateOperation.add;
clusterRuleSpec[0].info = affinitySpec;

 

var clusterConfigSpec = new VcClusterConfigSpecEx();

clusterConfigSpec.rulesSpec = clusterRuleSpec;

 

task = cluster.reconfigureComputeResource_Task(clusterConfigSpec, true);

 

Thanks upfront for comments!


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>