Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

PowerCLI script to disable vm affinity rules

$
0
0

I have a script to list VM affinity rules for all clusters in every datastore:

 

ForEach ($dc
inGet-Datacenter){$dc|Get-Cluster|Get-DrsRule–typeVMHostAffinity|
sortcluster
|selectName,Cluster,Enabled,
@{N=’DataCenter’;E={$dc}

}}

 

Is there a way to disable VM affinity rules for clusters by name? For example:

 

For all clusters in all datacenters in vCenter01

If -cluster.name = Cluster01,cluster02

then do nothing

else

affinityrules = remove

 

Above is just a rough draft of what im trying to accomplish and working on now. Any ideas?


Viewing all articles
Browse latest Browse all 175326

Trending Articles



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