# vmware inventory group by tags

**URL:** <https://forum.ansible.com/t/vmware-inventory-group-by-tags/29790>\
**Category:** AWX Project\
**Tags:** vmware, awx\
**Created:** [February 27, 2019, 4:06pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by-tags/29790 "2019-02-27T16:06:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cedlerouge](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@cedlerouge](https://forum.ansible.com/u/cedlerouge)\
**Post date:** [February 27, 2019, 4:06pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by-tags/29790/1 "2019-02-27T16:06:26Z")

</div>

Hi,

I use awx to manage vmware instances.  
I want to use vmware tags to group my instances.  
I’m able to generate an inventory with instances in tag groups with the following command :  
ansible-inventory -i ./tag\_vmware.yml --list

tag\_vmware.yml contains the following

---

<div class="post-metadata">

**Author:** ![AlanCoding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alancoding/32/301_2.png) [@AlanCoding](https://forum.ansible.com/u/AlanCoding)\
**Post date:** [February 27, 2019, 4:41pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by-tags/29790/2 "2019-02-27T16:41:29Z")

</div>

The vmware inventory source type supports groupby patterns in the API. The allowed grouping keys are not maintained, and because of that, the UI does not expose this IIRC.

In your case, you probably want to create a vmware inventory source. Then go to the API details page /api/v2/inventory\_sources/N/, for the thing you just created. Then do the most obvious thing - PATCH providing {“group\_by”: “tag”} or {“group\_by”: “tags”}. I’m not sure what the key in hostvars is, so I don’t want to tell you the wrong thing. This will set the “groupby\_patterns” option in the config file for the inventory script.

AWX will soon start using the plugin (more similar to how you’re doing it locally), and deprecate the script. But when that gets written, the group\_by functionality will be preserved, just writing these same options in a different format.

---

<div class="post-metadata">

**Author:** ![Loic\_Mousselet](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@Loic\_Mousselet](https://forum.ansible.com/u/Loic_Mousselet)\
**Post date:** [August 21, 2020, 1:05pm UTC](https://forum.ansible.com/t/vmware-inventory-group-by-tags/29790/3 "2020-08-21T13:05:26Z")

</div>

Hello, I have the exact same problem today. Did you find a solution? cordially
