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

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.

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

  • Members on the lines, can they be passed to running guest in a business rule?

    Can I ask you how can members on the lines past their value at the prompt of the execution in a business rule? I checked a post above saying that this can be done but it was 2010 any chance that there is a way now to do?

    Thank you in advance,

    Members on the lines, can they be passed to running guest in a business rule?

    You can do this if you use a Menu to launch rules in planning, any POV associated with the clicked cell is passed in the SPTR

    in the screen shot here you can see, I accessed the menu of the cell in red, I had selected a cell in the grid, period and year also would have been settled.

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

  • Reports of the rule properties

    We are looking for a way to generate a report that securities specific rules, the evidence of these rules and the source of these rules in a table.

    Ideally, we are looking for a way to generate a report for every rule that has the following comlumns:
    [Rule ID], [rule name,] [rule Source], [the rule definition], [Custom Property1], [Custom Property2], [rule as shown in rule browser]

    I know that a custom property report can display custom properties added to rules, but the properties of the rule of the rule's properties editor and the actual evidence of the rules do not appear in the report.

    OPM has a function to generate such a report?

    Thank you
    Isamu Minami

    There is nothing out-of-the-box in OPM is going to do.

  • 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

  • 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

  • OMBPlus report definition syntax "rule action" on a data_rule in a map

    Hello

    I'm trying to make sure that all the rules given in the tables of my maps are set to 'REPORT' and want to use OMBPlus for this but I can't find the proper syntax to do this. This is what seems logical to me at this time to retrieve the current value:

    OMBRETRIEVE MAPPING '$mapName' DATA_RULE '$ruleName' OPERATOR '$tbl' GET PROPERTIES (RULE_ACTION)

    It makes me:

    OMB02933: Error getting child object of the type DATA_RULE with 1855 name: MMM1034: DATA_RULE property does not exist.

    I also tried the reverse:

    OMBRETRIEVE MAPPING '$mapName' OPERATOR '$tbl' DATA_RULE '$ruleName' GET PROPERTIES (RULE_ACTION)


    also gives an error.


    Does anyone know the correct syntax?


    Thank you

    Eric.

    To answer my own question and anyone else looking for the correct syntax, this is what I came with:

    # some variables for name mapping ($mapName) settings and scoreboard operator target ($tgttbl) in the mapping took place before these lines

    define the rules [OMBRETRIEVE '$mapName' OPERATOR '$tgttbl' DATA_RULES GET from MAPPING]

    foreach rule $rules {}

    OMBRETRIEVE MAPPING '$mapName' OPERATOR '$tgttbl' DATA_RULES '$rule' GET PROPERTIES (RULE_ACTION)

    MAPPING of the OMBALTER '$mapName' CHANGE the VALUES of PROPERTIES (RULE_ACTION) DATA_RULES '$rule' OPERATOR '$tgttbl"("REPORT")

    }

    REPORT can be replaced by IGNORE or BR_MOVE_TO_ERROR, according to the necessary RULE_ACTION.

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

Maybe you are looking for

  • Latest firmware DGN2200B

    Hello can someone tell me, witch was the latest firmeware for my DGN2200B and where can I donload it. Or can we say, me, version witch I have. THX for your help. BR Haitaimk

  • Sign to detach

    Hello, I just bought a new laptop of Lenovo Y560. So far, the laptop is just amazing! One thing I regret is that the letter 'L' of Lenovo arrived off of the back of the screen. Its 50% discount and I have to keep pushing, and then the letter would st

  • Start stop while loop with tab control

    I want to be able to start and stop a while loop by entering and leaving a tab.  I use a structure of the event to do so, but it seems not elegant or the right way to do it.  The only way I could get to the kind of work is by unchecking the lock fron

  • Can I use my Iphone 4 to print on a hp printer: hp photosmart B209a-m? Printer is wireless

    Please clarify for me if it is possible to use my IPhone 4 to print on my hp Photosmart Plus B209a-m. The printer is set up on a wireless connection, but doesn't have the impression of Air.

  • Image map does not

    HelloDW is working with the current version of the cloud, I tried to create hot spots in an image, but the image maps do not work. I can see the hotspot tool in the Properties window, but no one works.The answers I've found say to use the mode of cre