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

Tags: VMware

Similar Questions

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

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

  • Guests report in DRS-rules

    Hello

    We are currently using DRS for the distribution of Windows VMs on specific hosts in our groups. These hosts are grouped into a "Windows Hosts licensed" DRS group in each cluster.

    For our license management, I need to declare the current number of hosts (and host) attributed to these groups of DRS each month.

    As the environment is more and more bigger I want to automate this task by using a regular report.

    How can I get a list of relevant hosts including physical processors per cluster and a total number of CPU?

    We use vSphere 5.1 and PowerCLI does not seem to offer much for DRS-groups out of the box.

    I just need to know how to get the list hosts, I can do anything around this (adding PSModule, connection to vVenter, report by mail, etc.) by myself

    Any help appreciated.

    Hi Daniel,.

    right, PowerCLI does not offer a large part of the box.

    But there is a module, you can import:

    http://www.lucd.info/2015/01/22/drsrule-DRS-rules-and-groups-module/

    Who should help ;-)

    Tim

  • Antiafinidad en DRS rules

    Buenas.

    BONE benefits a dudas conjunto sober rules of antiafinidad of DRS (config that allows separate the run of maquinas office on different hosts). Creo that son of interesting debate:

    • Message how're este sistema? ES decir, imaginad what configuramos so many rules of antiafinidad than what we do are separate todas las maquinas office. In caso of Quebec el DRS required mover alguna Máquina virtual por performance motivated, sucederá what? ¿movera maquinas office? Do not weary movera porque dicen than deben estar entraba rules?

    An example:

    Host 1

    VM1

    VM2

    Host 2

    VM3

    VM4

    Tenemos back antiafinidad of DRS rules that:

    (1) VM1 y VM3 deben estar in hosts separately.

    (2) VM2 y VM4 deben estar in hosts separately.

    Por servicio motivated the VM1 begins a CPU of mucha consuming, as el Host1 is absolutamente saturado tanta. El host 2 esta trabajando con VM3 y VM4 y tiene capacidad suficiente para Máquinas Office hold. Máquina ¿Drs movera alguna en este caso, las violando rules of antiafinidad?

    • How actuara ante HA? Me refiero, if case el example del 1 host anterior, ¿HA intentara arrancar in el sus las Host2 VM (VM1 y VM2)? Do not las arrancara porque exists the rule of antiafinidad? ¿Las arrancara violando rules?

    Gracias y a greeting.

    Buenas, segun VMware in el segundo caso if what VM, violando las las arrancarian rules of antiafinidad, there is prima el servicio in detrimento del cumplimiento rules.

    Esto modificarse mediante una opcion advanced del HA can, donde indicamos Québec haga caso a DRS rules.

    As has the cuestion of primera, correcto're tal y como is ha planteado.

    Saludos.

  • How to get a list of the DRS rules and their virtual machines.

    If I try the following, I get no output. (PowerShell 2, vCenter & ESXi 5.1, PowerCLI 5.1 Release 1)


    ()get-cluster ). ExtensionData.ConfigurationEx.group |? {$_.vm}

    or

    ()get-cluster ). ExtensionData.ConfigurationEx.group

    I know that I have a DRS rule because when I try the following I am able to see it in Object Explorer in PowerGUI and I created it just in the Web Client.

    $Clusters = Get-Cluster

    The problem is that you have DRS groups who do not have vms - possibly accommodate groups of DRS.  If you want only vms something like this should work and does not give the error:

    foreach ($cluster (get-cluster)) {}

    write-host "$($cluster.name)".

    foreach ($drsGroup in $cluster. ExtensionData.ConfigurationEx.group) {}

    write-host "$($drsGroup.name)".

    {foreach ($vm to $drsGroup.vm)}

    If {($vm)

    $vmname = (get-vm-id $vm) .name

    write-host "$vmname".

    }

    }

    }

    ECHO «»

    }

    If you want to get the VMhosts and the VirtualMachines then try this:

    foreach ($cluster (get-cluster)) {}

    write-host "$($cluster.name)".

    foreach ($drsGroup in $cluster. ExtensionData.ConfigurationEx.group) {}

    write-host "$($drsGroup.name)".

    write-host "VMHosts".

    {foreach ($vmhost to $drsGroup.host)}

    If {($vmhost)

    $esx = (get-vmhost-id $vmhost) .name

    write-host "$esx".

    }

    }

    ECHO «»

    write-host "Virtual Machines".

    {foreach ($vm to $drsGroup.vm)}

    If {($vm)

    $vmname = (get-vm-id $vm) .name

    write-host "$vmname".

    }

    }

    ECHO «»

    }

    ECHO «»

    }

  • DRS Rule - separate virtual machines

    I have a DRS rule to separate the 2 virtual machines, but when I vmotion two virtual machines on the same host, it allows him to do. Why is this?

    I need to separate VMs on separate hosts at all times

    OK, I had the level of automation to manual, so he won't move the virtual machine. Once I changed it to automatic, its moved the VM on the host.

  • DRS rules

    We have a cluster with 5 guests esxi 4.1. Our web team has a collection of 10 virtual machines they would like to have at most 2 of their virtual machines running on the same host at any given time. Is this possible using the DRS rules?

    I've set up two groups of hosts and virtual machines, a group of virtual machines 1-5 and another 6-10 guests then 1-2 and 3-4 (leaving a 5 hosts on groups, but I guess I could just add it to the second group to keep them together...) I then set up for VM 1-5 could only run 1-2 hosts and VMs 6-10 may only work on 3-4. This does not have the requirement to have only 2 virtual machines on a host at a time.

    Any suggestions?

    Thank you

    Assuming you entered controll activated with a threshold of 20% then none.

    As the DRS rules are 'should' rather than 'having '.  Which means that if the host ESXi01 fails, then WEB01 and WEB02 will work on any other host, when this host is repaired or get back online, DRS will migrate them back to her.

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

  • Error in creation of the DRS rules affinity

    Hello

    I have questions tests create DRS affinity / anti-affinities (VcClusterAffinityRuleSpec / VcClusterAntiAffinityRuleSpec) rules of vCO.  The error I get is "not initialized: vim." VirtualMachine vm [] (Workflow: Affinity Test / Create Rule (item2) #45)'to 'reconfigureComputeResource_Task'.  I searched all day and have not been able to find any resolution code or for example to get past this.  Here is my code snippet.

    Thank you, any help is appreciated!

    *****************************

    * att_vmArray - VirtualMachine array with 2 VM

    * att_CCR - ClusterComputeResource

    *****************************

    var affSpec = new VcClusterAffinityRuleSpec();
    affSpec.enabled = true;
    affSpec.name = "Test 01 rule."
    affSpec.userCreated = true;
    affSpec.vm = att_vmArray;

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

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

    att_CCR.reconfigureComputeResource_Task (spec, true)

    Unfortunately, this is a known bug that has been fixed, but it would be released in the next version coming out soon. In addition, a fix would be released in vCO4.1 update 2 coming in the begging of T4. In the meantime, we can work with you to find a solution to this issue.

    Thank you
    Igor.
  • Migration of affinity groupings through DRS rules?

    Hello

    We do a few migrations and I would copy the rules drs affinity from one cluster to another - is it possible? or more precisely is it possible easily?

    TIA

    It is not a standard feature in vCenter, but you can achieve with the VI toolkit. The excellent LucD wrote a script to export and import rules, take a look at the bottom of the following topic:

    http://communities.VMware.com/message/1200272

    Duncan

    VMware communities user moderator

    -

  • List the contents of a cluster VM group in a DRS Rule

    Hello

    I'm looking for a script that lists the contents of a cluster VM Group in a rule of DRS.

    Example: we have a single cluster vmware 'CL-TEST' DRS 2 'GP1 and GP2' groups that contain several virtual machines.

    We want to export the content of each group of DRS in an excel file.

    Any idea?

    Thank you

    Concerning

    Take a look to get a list of virtual machine is in a group of virtual machine DRS

  • Looking for a way to create an automated and large number of DRS rules.

    For example, I have a lot of machines named like this;

    Fs001a

    Fs001b

    I need to create AntiAffinity rules to keep the 'a' and 'b' machines on separate hosts.

    The created rule should be like "Fs001" and both machines.

    New-DrsRule-development of Cluster-name Fs001 - KeepTogether $false VM - Fs001a, Fs001b

    Any help/direction with powercli script that can do this would be greatly appreciated. I don't know how to handle the name match in powershell. It's something I want to run as a scheduled task to avoid human error in the rules missed or incorrect.

    Try like this

    Get-VM -Name *[ab] |Group-Object -Property {$_ -match "(?.*)[a|b]"; $Matches["name"]} | where {$_.Count -eq 2} | %{    New-DrsRule -Cluster Development -Name $_.Values[0][1] -KeepTogether $false -VM $_.Group}
    

    Only when the script detects 2 identical names (one ends with one and the other with b), he creates a rule of DRS

  • List storage DRS rules?

    The call LucD

    I would like the list rules SDR, or rather, to determine whether a specific exists for a machine virtual specific.  But for the life of me, I was unable to see in PowerCLI, I even tried Onyx to give me a hint.  It's 5.1 U1b vCenter.  I think they should be listed in:

    $DSCluster.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.PodConfig.Rule

    But the 'Rule' property is empty.  Any help?

    I think I know what is happening, you follow rules for VMDK affinity, while the property has the rules of inter-VM.

    Try this

    $dsc = Get-DatastoreCluster -Name DSC1$dsc.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.VmConfig |Select Enabled,IntraVmAffinity,IntraVmAntiAffinity,  @{N="VM";E={[string]::Join('/',(Get-View -Id $_.VM -Property Name | Select -ExpandProperty Name))}} 
    
  • Add VMS to DRS rule

    I'm working on a script and a cmdlet PowerCLI already seems to be written for her. The script adds an existing virtual machine to an existing Rule DRS.

    Here's the code for the cmdlet that I want to reproduce:

    $spec = New-Object VMware.Vim.ClusterConfigSpecEx
    $spec .groupSpec = New-Object VMware.Vim.ClusterGroupSpec[] (1)
    $spec .groupSpec [0] = New-Object VMware.Vim.ClusterGroupSpec
    $spec .operation .groupSpec [0] = "edit"
    $spec .groupSpec [0] .info = $DrsGroup
    $spec . info.vm .groupSpec [0] += $VM. ExtensionData.MoRef

    $Cluster . ExtensionData.ReconfigureComputeResource_Task ($spec $true( )


    To my knowledge, something along the following lines can be done to translate this in Perl:

    1. create a ClusterGroupSpec object with the correct information. I don't here and am not sure how to add "info.vm" in ClusterGroupSpec in Perl.

    My $cluster_group_spec = ClusterGroupSpec-> new (operation = > 'Edit', info = > $drs_rule_name)


    2. pass this as an object of ClusterConfigSpecEx in rulesSpec

    My $cluster_config_spec = ClusterConfigSpecEx-> new (rulesSpec = > [$cluster_group_spec]);


    3 reconfigure with spec as $cluster_config_spec.


    What I'm confused about is how to pass to info. VM of the PowerCLI. There is no member of the info or ClusterConfigInfo called "vm". How I would say the group specification which VM use?



    Updated the title to be more informative (it is no longer just a 'translation', the thread now contains the answer to the title).

    Adding/changing operations are for groups, but the contents of the group will be just changes to the low level table.

    Take a look at the example attached script, I tested it and its work.  Basically, the logic is the same, the difference is you change the group, but just add the moref vm virtual machine that you want to add to the group by simply sending an updated table of the vm morefs.

    Perl addVm2DrsGroup.pl - server = pass 172.16.254.50--username=administrator@vlab--mot = * - cluster = CLU01 - drsgroup = group1 - vm = recovery-03

Maybe you are looking for

  • Two problems with iTunes!

    1. How can you save playlists in iTunes when you want to synchronize your phone? I am constantly create playlists of favorite songs and then lose them all when I sync my phone. I guess that the error of the user? But it's so boring. I can not really

  • Firefox fails to submit form self-referential unless I wait 20-30 seconds.

    EDIT: (the solution ended up being, against all odds, that everything was actually perfectly fine. He has been the host - which was ruin it. Note to everyone who comes through this: GoDaddy is terrible for hosting. The same files, downloaded to real

  • Code error 800b0100 installing KB983590

    He has downloaded on the computer, but will not be installed. I did what they suggest that when this problem occurred, but it helps doesn´t. I have Windows 7 and Internet Explorer 8

  • Aspire e3-111-p605 F12 does not boot usb

    Hello, when accessing the menu boot via F12 only shows Hard boot disk and network. The "F2" - order of precedence of Boot (legacy watch on the Boot Mode) does not seem to recognize the usb. work around? A plan to get the usb backup Acer for $44, but

  • I can receive but can't send the email from Windows Live Mail 2011

    I recently changed Internet service providers (and don't know if that is related to my problem) but I can RECEIVE from emails on my Windows Live Mail 2011 but IMPOSSIBLE to SEND emails ... I get the following error message The connection to the serve