Affinity rules

What are the "rules of affinity".

Thank you

Prashant

Affinity rules you can define a rule for example that a specific virtual machine only works on a single host (you choose). Or the other way around: one or more virtual machines are not allowed to run on host A & B for example.

This is often used in combination with license policies.

Kind regards

Mario

Tags: VMware

Similar Questions

  • Evacuation and binding affinity rules

    I have a 5.5 ESXi host called ESXi1 in a group of DRS host called "host of ESXi1 group.  No other ESXi host is in this group, but there are 4 other ESXi hosts in the cluster.  I have a VM called 'VM1' in a virtual machine DRS group called "group virtual machine VM1.  No other VMS are in this group of DRS.

    VM1-> "VM1-machine group.

    ESXi1-> "host of ESXi1 group.

    There is a mandatory rule of DRS that says MV in the 'machine VM1 group' working only with ESXi hosts in the 'host ESXi1 group'.  What happens when I try to put ESXi1 host in maintenance mode?  He will be able to evacuate VM1 since there is no other host in the Group VM1 to work?

    Yes. Answer is 100% correct. If configured VM host affinity/anti-affinity rule is ESSENTIAL, it cannot be violated. Same vSphere HA respects the rules of the VM-host must. Even you can not manually migrate this VM1 to another host. Maintenance mode also cannot assess the host. Even if there is imbalance CPU/Memory, DRS will always obey this rule.

    If you want this rule to be flexible, you can configure the same thing as "soft / should" rule. In this case, rule is violated every time that it is absolutely necessary (like MM, HA does not respect this rule, you can manually migrate VM to others, the DRS in a balanced cpu/memory can violet this rule) but notes that in the immediate following invocation of the DRS, DRS will try its best to resolve the violation of the rules.

    To know what are the rules can be honored by vSphere HA:of vSphere HA abreast of the DRS rules of affinity? | vThinkBeyondVM

    Let us know if you need any other clarity.

  • SQL 2012 still on the use of affinity rules

    Hey guys,.

    I use SQL 2012 alwaya time on in a virtual, but so far, it is not configured as best practices and environment I wanted to change that.

    At the moment I have no DRS rules in place so it can happen that two virtual machines running on the same host and it's something I want to avoid.

    However, my big problem is that I only got a SQL license for two hypervisors and best practices talked about four hosts who are needed to achieve my goal.

    Here is what I intend to implement:

    -Affinity rule machine virtual-VM to separate two virtual machines

    -Affinity VM host rule which VM1 MUST run on ESX1

    -Affinity VM host rule that VM2 MUST run on ESX2

    This configuration is a good idea or could / should I do something different?

    What I found that all the features how for example the evacuation and HA should still work?

    There are many more ESX servers in this group and they will be used in the case of an outtage, right?

    Also there is a dev environment that looks the same. I could include the hosts in the same VM-Host affinity rules or should I create new ones?

    BTW. I am using vCenter and ESX 5.5.0.

    Thank you very much!

    See you soon

    Nicolai

    Affinity rules those you intend to sense. These rules will not be those virtual machines to be on the same host most of the time.

    Note:

    1 rule of VM host is configured as "SHOULD", in extreme cases, DRS can break these rules. However, in the next invocation of DRS, DRS will try to resolve the violations.

    2. Note that: when you keep either the host in maintenance (ESX1 or ESX2) mode, you must manually migrate the VM to another host due to the virtual-VM anti rule machine affinity. DRS even in full auto mode, VM will not be migrated automatically. This will apply only if there are only 2 host in the cluster.

    3. Yes, HA should well with that: however HA is not aware of the rules 'EXPECTED' and in the case of host failure it can not respect 'SHOULD' rule.

    4 rule anti-affinite VM - VM can be sensitized HA using the advanced option. Let me know if you want to help with that.

    5. Yes, failure of other hosts in the cluster will be used but please updated on impact due to rules & licenses.

    6. "There is also an environment-dev which looks the same." I did not follow what exactly you mean here:

    7 migration threshold settings DRS is also important.

    8 DRS gives priority to the prevention of violations of anti-affinity rules machine virtual-VM that violations of rules of affinity. (it's just for your info.)

    Nevertheless,.

    1. If ESX1 falls down or affinity rule VM host that VM1 MUST run on ESX1 gets violated: VM1 can be migrated to other hosts in the cluster. As you have no licenses (more than 2) SQL, how it would be dealt with (I'm not very updated on the SQL licenses)

    2 point above applies to the second rule of VM HOST as well.

  • HA and affinity rules & book by Duncan & Frank

    VMware vSphere reading 5 clusters of Duncan & Frank (Pocket v1.0) deepdive, I'm confused.

    On page 212, second paragraph, it says (roughly) VMware HA is not aware of the virtual-VM anti machine affinity rules, and after an HA event may begin on the same host. But on page 215, second paragraph, it says (roughly) HA will not violate the mandatory rules after HA failover.

    This seems to contradict itself.

    I can not type the full section due to copyright.

    Is anyone able to explain it?

    See you soon.

    Hello

    There are two types of rules:

    1. VM - VM affinity rules
    2. VM - host affinity rules

    HA is not aware of the first, machine virtual-VM, so any rule you create here will be ignored by HA.

    Now, for the second, it's a bit more complicated... There are two types of VM - affinity host rules:

    1. Bride aka mandatory
    2. Expected preferential aka

    HA will respect 'must' of the rules, but will be no respect for the rules 'should '.

    That's what means the book.

  • DRS anti-affinity rules

    Hello world

    I want to create anti-affinity rules machine virtual-VM for 4 virtual machines. We use vSphere 4.0 U2 on our environment.

    What would be the number of rules that are created on the DRS Cluster?

    It's 6 rules? What is different now.

    4 VMS = 6 rules (VM1/VM2 VM1/VM3 VM4/VM1, VM2/VM3, VM4/VM2, VM3/VM4)

    gedelar wrote:

    It's 6 rules? What is different now.

    If you upgrade to vSphere 4.1, that one rule would be necessary, but I guess on 4.0, you must create these six different rules.

    http://www.VMware.com/files/PDF/Techpaper/VMW-whats-new-vSphere41-HA.PDF

    "Finally, rules anti-affinity machine VM-virtual can now integrate more than two virtual machines." Here, VMware DRS try remove the virtual machines specified. Users could use this rule to ensure that some virtual machines are always on different physical hosts. »
  • Backup/restore DRS VM affinity/anti-affinity rules - can they be backed up and restored without re-entering manually after DRS disabled?

    DRS VM affinity/anti-affinity rules - these are lost when the DRS is off - they can be "listed" via perl or script Toolkit VI to return to manual if necessary.

    But can they be backed up / restored through automated methods for easy recovery in case required or accidental deactivation of the DRS? What happens if a user of vCenter turns off instead of the manual setting during operations?

    I have over 100 + VM DRS affinity/anti-affinity rules to maintain.

    There are indeed several DRS rules related cmdlets in the VITK 1.5.

    The following script will save all rules in a .txt file.

    $outfile = "C:\rules.txt"
    Remove-Item $outfile
    $clusterName = 
    $rules = get-cluster -Name $clusterName | Get-DrsRule
    
    foreach($rule in $rules){
      $line = (Get-View -Id $rule.ClusterId).Name
      $line += ("," + $rule.Name + "," + $rule.Enabled + "," + $rule.KeepTogether)
      foreach($vmId in $rule.VMIds){
        $line += ("," + (Get-View -Id $vmId).Name)
      }
      $line | Out-File -Append $outfile
    }
    

    The reason why we are writing the rules in a .txt file is because the type of 'Solidarity' with the rules can have 2 or more guests defined.

    This type of info (variable length table) is impossible to export to a. CSV file.

    The 2nd script reads this external file and sets the rules.

    $file = "C:\rules.txt"
    $rules = Get-Content $file
    
    foreach($rule in $rules){
      $ruleArr = $rule.Split(",")
      if($ruleArr[2] -eq "True"){$rEnabled = $true} else {$rEnabled = $false}
      if($ruleArr[3] -eq "True"){$rTogether = $true} else {$rTogether = $false}
      get-cluster $ruleArr[0] | `
        New-DrsRule -Name $ruleArr[1] -Enabled $rEnabled -KeepTogether $rTogether -VM (Get-VM -Name ($ruleArr[http://4..($ruleArr.Count - 1)|http://4..($ruleArr.Count - 1)]))
    }
    

    [The trick used for guests, it's that we select the part of a table with the \[a... scoring b\].

    Currently, you will need to run the first script for each cluster separately, but this could be easily adapted to run on all clusters in your VI.

  • There are advanced settings for VM - VM affinity rules?

    Hello world

    First time post, but I have found extremely useful forums in search engine results so thought I should get involved as much as I can.

    Anyway, I was asked a question about the rules of affinity, and I was not able to find the answer anywhere, so I was hoping someone might be able to point me in the right direction please.

    My client gave me a list of VMs that are 'pairs' - by that I mean that they both the same, but act is turned on and the other is used only if the virtual direct machine is not reachable. There is nothing intelligent power which, as grouping or well HA within the OS.

    We asked me to make sure the pair of VM could not be fed by the same ESXi host, thus following the documentation for VMware, I created a virtual-VM affinity DRS machine rule. I was asked to test it, and honestly, it works a treat. However, the result is not desired. Unfortunately, I can not give too much information because of policies, but I'll try my best to explain the whole upward and deliver.

    The rule stops two virtual machines are hosted on the same ESXi host at

    VM1 is the direct server, VM2 is the backup server

    Both of the above are in the relevant rule

    There are 8 hosts in the cluster

    HA and DRS are enabled on the cluster

    ESXi version 4.1

    If I manually start a vMotion VM2, send to the host who currently hosts VM1, it seems to happen: VM2 vMotion gets 78% > > DRS Rules are evaluated > > VM1 is vMotion had to a new host > > VM2 vMotion ends when VM1 is off the host

    However, I am told that the customer would have preferred that the VM2 vMotion fails, or the vMotion process automatically sends elsewhere, rather than invoke a VM1 vMotion.

    I'm not quite sure what is happening in the case of a real event of HA, I'm sure I read that HA not take account of the DRS Rules? The foregoing only happens because it is a manual vMotion? Or y at - it a better method that I forgot?

    Thank you

    Paul

    Unfortunately, as you use vSphere4.1, you're out of look about the DRS control over an HA event, it's a feature of 5.x

    If you do a manual vMotion then you are effectively denying your rules of affinity of DRS, until she physically check the rule during the migration.  It's as good as it gets.

  • Automate adding to DRS affinity rule

    Is it possible to add automatically as a new virtual machine created in a specific to his Rule DRs Cluster?

    Here we have 2 rules of affinity in the same cluster and all VMV that would be created it needs to adhere to a rule.

    To change the rule:

    game-drsrule-rule (get-drsrule-cluster (cluster-get "Mycluster") - name "MyRule")-VM $MyVM - Enabled $true

    Everything is possible with PowerCLI

    Seriously, you want to detect the virtual machines in a cluster that are not in a rule of DRS, correct?

    When you detect VMs DRS article they should be added?

  • Rules of affinity and maintenance mode

    I have a virtual machine with a virtual machine to host mandatory "must" affinity rule that it must run on a single server ESXi 5.5.

    I'm going to try to put this ESXi host in maintenance mode.

    If the virtual machine with the affinity to the broad rule, but leave that it registered to the same host ESXi 5.5 power I, I then be able to put the ESXi host in maintenance mode?

    Or do I actually move the engine off the virtual computer to another host and enter it here to the ESXi host be allowed to enter maintenance mode?

    Thank you!

    According to my understanding affinity rule anti affinities and rules run on virtual machines running. So either hospitality you can keep the virtual machine.

  • DRS Rule for Host affinity check names of datatore that they match to the hosts

    DRSRules - list of host affinity rules

    Host affinity rules

    Cluster

    Activated

    Name

    Solidarity

    VM

    Host of the rule

    Running

    Cluster-SA1

    TrueCluster2-SA1-VMsHostsFakeSMV - SA1SA1sa1_host3

    Cluster-SB2

    True

    CLUSTER1-SB2-VMsHosts

    Fake

    SMV - SB2

    SB2

    sb2_host2

    This module of vCheck will show me if one of my virtual machines are not running according to the rules, but I want to look deeper.

    DRS Rule for Host affinity check names of datatore that they match to the hosts

    Our guests all start with three characters make the difference between SiteA1 and SiteB1, that is sa1host1 sa1host2... sa1host9 and sb2host1, sb2host2, sb2host9, etc.

    Our warehouses are the names "sa1_exch01", "sa1_sql_01", sa1_data_01"for all data stores that are found on the Site1.  While the warehouses of data named 'sb2_exch01', 'sb2_sql_01', sb2_data_01' for all data stores that are found on the Site2.

    Can help you with a script that will check all virtual machines on the hosts on Site1 and report those who have warehouses of data does begin with 'sa1' and similarly all virtual machines on the hosts on the Site2 but give report of those who have warehouses of data that do not begin with "sb2.

    See you soon

    KC

    Try something like this

    $vms = Get-View -ViewType VirtualMachine -Property Name,Datastore,"Runtime.Host"
    
    foreach($vm in $vms){    $esx = Get-View $vm.Runtime.Host -Property Name    $ds = Get-View $vm.Datastore -Property Name    if($ds | where {$_.Name.Substring(0,3) -notmatch $esx.Name.Substring(0,3)}){        $vm | Select Name,            @{N="Site";E={if($esx.Name.Substring(0,3) -eq "sa1"){"SiteA1"}else{"SiteB1"}}},            @{N="Host";E={$esx.Name.Split('.')[0]}},            @{N="DS";E={[string]::Join(',',($ds | %{$_.Name}))}}    }}
    

    It should list all the virtual machines that do not follow the rule.

  • Rules anti-of affinity DRS VM - VM in vSphere 5.5

    Does anyone know what is the advanced option which allows the HA to comply with the anti-affinity rule machine virtual-VM in vSphere 5.5? It is mentioned as an improvement in this 5.5 vSphere document new features: http://www.vmware.com/files/pdf/vsphere/VMware-vSphere-Platform-Whats-New.pdf

    "To meet the need to maintain the placement of virtual machines on different hosts - without migration vMotion, vSphere - after a failure of the host, vSphere HA in vSphere 5.5 has been improved in order to comply with the rules antiaffinity machine virtual-virtual machine. Application availability is maintained by controlling the placement of virtual machines recovered by vSphere HA without migration. This feature is configured as an Advanced option in vSphere 5.5 "

    In previous versions, if you want to keep 2 VMS separated event HA, the recommendation was to create "" must run on hosts in the Group"rules of VM-host affinity with 2 virtual machines in different groups of DRS VM." "

    There was also the DRS ForceAffinePoweron advanced option, but it is not actually applied HA event.

    Thank you.

    I found the answer on the blog of Duncan Epping:

    http://www.yellow-bricks.com/2013/09/04/vSphere-5-5-nuggets-high-availability-enhancement/

    das.respectVmVmAntiAffinityRules - values: (default) ' false' and 'true '.

    Thanks Duncan!

  • rule of the VM host affinity Vcloud managed cluster.

    Hi all

    I have an automated DRS Cluster in which we want to create a vm host affinity rule. This cluster is added to Vcloud Director. Can we create a rule of VM host affinity on the cluster added to the Vcloud directory?

    Kind regards

    Vikram kumar.

    There is nothing you can do that.  But they only persist as long as this specific VM exists.  for example if you copy this catalogue, the resulting virtual machine will not have the same affinity rule.

    So yes it is possible, but it may be best to use some sort of automation to perform the task for 'remember' If you happen to have more than 1-2.

    I know that people have done that to save on license of operating system/Application fees.  The only downside to know is that pass by the maintenance mode could violate the rule of the DRS.

  • In the face of the question and try to set the affinity through VCO workflow rule

    In the face of the question then to attempt to set the affinity through VCO workflow rule I'm trying to write workflow VCO to set up the level of affinity of cluster, but it throws the error message cannot convert ClusterComputeResource 'mycluster' to com.vmware.vim.vi4.ClusterConfigSpec (Workflow: create vm-virtual machine affinity rule / Scriptable task (item1) #19) my script to workflow is var rule = new VcClusterAntiAffinityRuleSpec(); Rule.Key = - 30; Rule.enabled = true; Rule.Name = ruleName; rule.userCreated = true; Rule.VM = MV; var clusterSpecRules = new Array(); var clusterSpecRule = new VcClusterRuleSpec(); clusterSpecRule.operation = VcArrayUpdateOperation.add; clusterSpecRule.info = rule; clusterSpecRules.push (clusterSpecRule); var clusterSpec = new VcClusterConfigSpec(); clusterSpec.rulesSpec = clusterSpecRules; var m = computeCluster.vimHost //spec = task = computeCluster.reconfigureCluster_Task (computeCluster, spec, true); Note: In the above code, what are the entry parameter computeCluster entered type parameter VC:clusterComputeResource ruleName is a parameter of type String - APR

    Here is the code I use, give it a shot.

    var affinitySpec = new VcClusterAffinityRuleSpec();
    affinitySpec.enabled = true;
    affinitySpec.name = att_ruleName;
    affinitySpec.userCreated = true;
    affinitySpec.vm = att_vmArray;

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

    var clusterConfigSpec = new VcClusterConfigSpecEx();
    clusterConfigSpec.rulesSpec = clusterRuleSpec;

    att_task = att_clusterComputeResource.reconfigureComputeResource_Task (clusterConfigSpec, true);

  • 5.5 HP u2 - rules tab seems to be missing some options

    Hello.

    I remember that I used to be able to add host (Dungeon vms on the single host) affinity rules.

    I just went of for again (the last time maybe a year ago) and I'm not able to determine how do.

    I followed the instructions of vmware and the internet operating instructions and it seems that I am part missing

    Rules tab options.

    My rules tab is attached as an image.

    I compared with that which is at: http://www.gabesvirtualworld.com/wp-content/uploads/2011/02/2011-02-24_214520.jpg

    One of the many sets of instructions, I'm following is: KB VMware: affinity or a DRS anti-affinite rules are not applied during a virtual machine market

    I don't know if I'm following the instructions on the right or missing from my HP 5.5 U2 ESXi build something.

    Thank you

    As far as I know, there is nothing which changed by OEMs like HP basic functionality.

    What options you see when you open the menu drop-down?

    André

  • data affinity default cluster store

    Hello

    I would like to ask if there is possibility to disable the default rule "solidarity VMDK" affinity in the data store cluster permanently in vsphere 5.0u1, no virtual machine by virtual machine when virtual machines are being deployed. When I tried to uncheck the affinity by default rule, he re-apeared after I re-opened the store of new VMs cluster and all parameter data obtained "solidarity VMDK" affinity applied again during the creation.

    I checked the advanced settings of possible substitution, but there seems to be no option.

    Thank you

    BR/Peter

    Here you go:

    http://frankdenneman.nl/2012/02/impact-of-intra-VM-affinity-rules-on-storage-DRS/

Maybe you are looking for

  • Software disc drive Blu - Ray doesn't play new Blu - Ray!

    Rather disappointed with the Blu - Ray drive at this moment! My machine is a Qosmio X 870, running under Windows 7 64-bit. It comes with the Blu - Ray disc player, which so far I've used with my previous purchase - the next Star Trek generation seaso

  • System dual-boot programs wrong volume.

    My system: MacPro3, 1 - dual-booting with Snow Leopard and Yosemite. Having Photoshop installed on the two volumes, but work especially in the snow, Wacom has failed to make a control panel operation Intuos for my tablet that works in Yosemite. Not g

  • -Power adapter connected - installation failure

    Try to install Windows 7, power adapter plugged - fail has developed in the first window.  What does that mean?

  • Network card wireless upgrade dm4t-1100?

    HI -. I read a few threads asking if a specific card will work in this model, but I'm going to be less accurate. I have a computer dm4t-1100 HP laptop running Windows 7, it is the only Windows machine I have left and one of the reasons why I always u

  • Install new version adobie flash player.

    When I uninstall the flash player of adobie how do I install new version 10.3 and make sure it is the real thing and not a fake?