Automation

 View Only
  • 1.  Report hosts in DRS-Rules

    Posted Jan 11, 2016 02:04 PM

    Hi,

    we're currently using DRS for distribution of Windows-VMs on specific hosts within our clusters. These hosts are bundled in a DRS-Group "Windows licensed hosts" in each cluster.

    For our license-management I need to report the current number of hosts (and CPUs per host) assigned to these DRS-Groups each month.

    As the environment is growing bigger I want to automate this task by using a scheduled report.

    How can I get a list of relevant hosts incl. physical CPUs per cluster and a total CPU-count?

    We're using vSphere 5.1 and PowerCLI doesn't seem to offer a lot for DRS-Groups out of the box.

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

    Any help appreciated.



  • 2.  RE: Report hosts in DRS-Rules
    Best Answer

    Posted Jan 11, 2016 02:20 PM

    Hi Daniel,

    right, PowerCLI doesn't offer much out of the box.

    But there's a module you can import:

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

    That should help ;-)

    Tim



  • 3.  RE: Report hosts in DRS-Rules

    Posted Jan 11, 2016 03:29 PM

    That's looking good =)

    Just did my first steps using it...

    PowerCLI C:\> Get-Cluster CLUSTER | Get-DrsVMHostGroup -Name '*Windows*' | select VMHost

    VMHost

    ------

    {HOST1, HOST2}

    How can I iterate through this list of hosts now?

    Foreach doesn't work as it's no array.



  • 4.  RE: Report hosts in DRS-Rules

    Posted Jan 11, 2016 05:38 PM

    Try doing a Select -ExpandProperty VMHost



  • 5.  RE: Report hosts in DRS-Rules

    Posted Jan 13, 2016 10:26 AM

    Thanks a lot that worked.