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!

Tags: VMware

Similar Questions

  • Affinity DRS rules?

    Hello! I use Affinity DRS rules at present with DRS groups etc. My question is if it is possible for a little more advanced with the DRS group management? Is it possible to group together (for example tag)-based VM rather than manually? So ideally, I could go to a stage where I can score a large number of virtual machines in a certain way (tag/etc. naming convention) and make them part of a group of DRS.

    The goal is to link a large number of virtual machines to hosts for licensing reasons, so I don't know that this has been done before. Obviously a separate group would work but not the most effective use of resources. I am looking for a type of soft partitioning almost (with software!)

    Any ideas or suggestions would be greatly appreciated as always!

    Thanks and greetings

    Steve

    A way to do would be to put the virtual machines selected on specific storage and storage only serve to a specific host within the cluster - in this way you would not need to affinity of all rules, and the VMs system would remain "limited" for guests who 'see' storage...

  • 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.

  • Manual VMotion circumvents the rules of the DRS anti-Affinity

    Hello

    just a really Basic... I know DRS rests on the idea that he leans on the cluster and then resources place virtual machines... BUT, if you configure a rule anti-xxx to say VM1 cannot be kept the same host that VM2 - can I still manually vMotion VM1 to the same host only a VM02 on?

    OK... Let me rephrase that. After having just... I asked myself why I cannot vmotion 2 virtual machines to be on the same host, even if there is an anti-home rule?

    My hypothesis is one of the following:

    1. I have not configured the anti-home rule correctly, or

    2 DRS is a retrospective resource, monitoring tool. so he will ignore my action, but when it checks the environment, it will then search the vm 2 is on the same host and then applies the rule of the anti-xxx.

    Let me know that if you can...

    Thank you

    Aaron

    Welcome to the community - Yes, you can manually vmotion a virtual machine that would violate the rule of the affinity of the DRS but if you DRS in partially or entirely automatice mode it will vmotion virtual machine don't not to violate the anti-home rule.

  • 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. »
  • Rule of DRS anti-affinite storage

    Hello

    We have vSphere 5.0 U3

    I applied the rule anti-affinite the couple to Exchange and Citrix servers.

    I want to know if this anti-affinite rules apply to all the configuration files for vmdk also. As I have my 2 Exchange VMDK servers on the same data store.

    Please help me understand. Also let me know how to configure the anti-affinite DTS rule.

    Thank you

    Mihir

    WG response.

  • 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.

  • New-DrsRule - anti-affinite rule Max 2 VM

    Hi all

    I use vSphere PowerCli 4.1 for import and export of objects of vSphere and I was wondering if someone could give me the truth about the rules of the anti-Affinity DRS.

    Specifically, if the number of VM limit is always capped at two.

    The reason why I ask this is that when I try to create a rule anti-XXX for three VM from the command line with the following command:

    New-DrsRule-Cluster (Cluster-Get-name $DRSR.cluster)-name DRSR. Name - Enabled $True - KeepTogether $False - VM (VM - Get $DRSR.vms)

    I get the following error:

    New-DrsRule: 26/07/2011-15:30:24 New-DrsRule you must specify 2 or more VMs if KeepTogether option is set and only 2 virtual machines if KeepTogether option is not set.
    Online: 1 character: 12
    + New-DrsRule < < < <-Cluster (Cluster-Get-name $DRSR.cluster)-name DRSR. Name - Enabled $True - KeepTogether $False - VM (VM - Get $DRSR.vms)
    + CategoryInfo: InvalidArgument: (:)) [new DrsRule], VimException)
    + FullyQualifiedErrorId: Client20_ComputeResourceServiceImpl_TryValidateDrsRuleVMCount_InvalidVmCount, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewDrsRule

    However, I am able to create the rule through vCenter.

    What I'm missing here? Is the rule that I create in vCenter not actually applied?

    Did he able to put me in stright?

    Thank you!

    Thank you.

    You are right, the New-DrsRule cmdlet when it is used for an anti-affinite rule limits the number of guests to 2.

    I suspect that this is for historical reasons.

    In environments of pre-version 4.1, I think it was indeed a limitation, even in the vSphere client.

    So yes, I'm afraid that you have to adapt the script to create anti-affinity rules 2 by 2.

    Fortunately, you can use a simple loop nested to create rules.

    Something like this for example

    $vms = "vm1","vm2","vm3","vm4","vm5","vm6"
    
    $j = 1 1..($vms.Count-1) | %{
        $i = $_    ($i - 1)..0 | %{
            New-DrsRule -Cluster (Get-Cluster -Name MyCluster) `        -Name ("Rule" + $j) `        -KeepTogether $false -VM (Get-VM -Name $vms[$i],$vms[$_])
            $j++    }
    }
    
  • 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.

  • Affinity reserve esxi hosts and host rules

    I'm trying to reserve a few for some special VM ESXi hosts, I used affinity DRS rules to make the virtual machine to run on special guests, but other virtual machines are also coming on ESXi hosts reserved because of the DRS.

    I have about 300 virtual machines running on 10 ESXi hosts running VMware 5.0 Update 2

    Currently using Vcenter 5 Update 2

    I have just installed 3 new hosts ESXi running the same VMware 5.0 Update 2

    The new ESXi 3 hosts must be temporarily reserved for a project with 30 new VM only, but always be part of the main cluster because they will be used with the 300 existing virtual computer when the project is completed.

    I have a rule configuration of affinity for the new virtual machine only works on the new ESX hosts

    But the problem is that some of the other 300 vm get Vmotioned with DRS on the new hosts as they have a lot of free resources.

    There are new virtual machine being added to the VM s 300 all the time by other people that I can't control.

    I'm happy to manually add my special project of the virtual computer to the rule of the DRS of affinity for the reserved ESX hosts can not have "other persons" manually add the new virtual machine to another rule, should it be automatic for them.

    I would like to set up a global rule to tell if you are not a virtual machine in my special project group DRS that you are not allowed to run on the 3 new ESX host.

    Dose anyone know if this is possible?

    Why not move the hosts in a cluster instead?

    Linjo

  • 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.

  • Help determine the best anti-affinity configuration

    I'm starting to soak in the VM and host rules of affinity for the first time.  One of our clients is looking to have 30-40 MV spun up use for distributed processing.  They want to ensure that in the event of a host failure, they will also have few virtual machines down at any time.  It seems that we should be able to use rules anti-affinity vm to achieve this goal to force them to be distributed evenly across all hosts in the cluster.

    I've not had much luck tracking examples of scenarios, so I had a few questions about how it would work.  I thought create a single rule anti-affinity VM and put all the VMS of 30-40 in there.  I guess, from what I've read, that he would do his best to satisfy the rule balancing on all hosts, although this can mean 2 virtual machines exist on the same host.  Would this work?  This would cause alerts or errors, if we had several virtual machines as the hosts?  Or I have to configure several rules to allow it works without error.

    Affinity VM rules would make the most sense here, or affinity host rules would be relevant here, and we would be preferred over the other?

    Thank you.

    It's one of the paramets when creatung rule will solve this dilemma - you need to set the value specification 

    Not run on hosts in a group that will keep separate virtual machines but allowing them to run on the same host if necessary-

  • HA and affinity rules &amp; book by Duncan &amp; 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 rules and Resource Pools

    Is it possible to assign the DRS rules to Resource Pools instead of creating groups of DRS and adding to the DRS group VMs and then creating a rule
    I ask this question because of a problem that I currently have
    I am far from being an expert as you'll see soon and back to the use of support groups
    If it I'll give you my scenario
    I have 4 ESX host in my test group
    2 hosts are connected to zFCP
    And all 4 are connected to independent contractors
    I have a resorce pool call FC and another called ISCSI
    We constantly evolve around VM between these 2 pools
    The highest availability VM remains on the rest on ISCSI FC
    I would like to create a rule that States if a virtual machine is in the RP FC then he must reside on host A and B, and if it resides on ISCSI it can reside on any host
    I realize that there is still other issues involved here as data themselves warehouses
    but it is another matter that he owns the rights
    We migrate VMs and the data store when we leave the virtual machine to another RP 1
    If the rule would be always true
    I would like to hear from you
    on this topic
    for now I just use rules and groups of DRS
    Thank you

    I don't think this is possible from the point of view of rule affinity DRS, as he has no relationship with resources or VM disk pools. This seems to be a single-use resource pools.

    You could probably do with a set of scripts PowerCLI who would check two resource pools and ensure that the virtual machines to the breast have their records on the correct data store and if not do a svMotion.

  • Script to automate the affinity of the crib of DRS-groups

    Hello

    I am trying to automate the rules of affinity for the drs Group Manager. The idea is to let some virtual machines running on

    assigned to the esx host (type 'Run VMs on Hosts' / 'Should run on hosts in the group').

    Background: we have esx hosts in two data centers interconnected 10 giga with a metrocluster netapp on each site hosting the nfs exports. I created two groups of type "Host DRS Groups" (in datacenter esx host a go into one, hosts datacenter b go the other) and two groups of type 'Machine virtual DRS Groups' (virtual machines hosted on export nfs one go into one, while the virtual machines hosted on nfs export b go the other). In this way, we can prevent nfs/iscsi traffic across data centers.

    Create the rules manually in a small cluster works. However with dozens of virtual machines in the other groups, there must be a way to automate the task and that it is regualary. I let powercli generate a list of VMS according to nfs export (hard location is either the field a or site b) then import the given in the Virtual Machine DRS group concerned.

    Using get-drsrule-Cluster 'cluster ' | Export-CliXml does not display a details for groups of DRS HOST or Virtual Machine DRS. Is it possible to do it at all? I recon using set-drsrule let me import rules.

    Any help / ideas is appreceated.

    Concerning

    Sascha

    The current DrsRule cmdlets do not, all I know, allows you to work with groups of DRS.

    As an alternative, you can use the ReconfigureComputeResource method that is available.

    The script should look like this

    $clusterName = "MyCluster"
    $cluster = Get-Cluster -Name $clusterName
    
     $spec = New-Object VMware.Vim.ClusterConfigSpecEx
    $groupVM = New-Object VMware.Vim.ClusterGroupSpec $groupVM.operation = "add" $groupVM.Info = New-Object VMware.Vim.ClusterVmGroup $groupVM.Info.Name = "Grouped VM" 
    
    Get-VM -Name MyVM1* | %{
        $groupVM.Info.VM += $_.Extensiondata.MoRef
    }
    $spec.GroupSpec += $groupVM
    $groupESX = New-Object VMware.Vim.ClusterGroupSpec $groupESX.operation = "add"$groupESX.Info = New-Object VMware.Vim.ClusterHostGroup$groupESX.Info.Name = "Grouped Host"
    
    Get-VMHost -Name MyHost1* | %{
        $groupESX.Info.Host += $_.Extensiondata.MoRef
    }
    $spec.GroupSpec += $groupESX
    $rule = New-Object VMware.Vim.ClusterRuleSpec$rule.operation = "add"$rule.info = New-Object VMware.Vim.ClusterVmHostRuleInfo$rule.info.enabled = $true$rule.info.name = "Test DRS group rule"$rule.info.mandatory = $true$rule.info.vmGroupName = "Grouped VM"$rule.info.affineHostGroupName = "Group Host"$spec.RulesSpec += $rule
    $cluster.ExtensionData.ReconfigureComputeResource($spec,$true)
    
    The script first creates 2 DRS groups. One with the VMs and one with the ESX(i) servers.
    

    In the example, there all customers whose name starts with "MyVM1" for a group and all hosts whose name begins with "MyHost1" to the other group.

    These 2 selections will of course be changed for your configuration. Let me know what selection rules you want to implement for virtual machines and hosts and I can update the script.

    The script then creates a rule. Note that the rule specifies $true for the "required" property

    This means that a virtual machine will not be powered on if the placement host does not match the rule.

    The 2nd parameter to the ReconfigureComputeResource method allows you to specify if the changes defined in the $spec to add or not.

    If it's not $true all your cluster settings, except for the groups and the rule will be deleted. So, attention!

Maybe you are looking for