# benefit of Dynamic Inventory over static inventory

**URL:** <https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16922>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [November 30, 2014, 5:41pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16922 "2014-11-30T17:41:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Muriithi](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@William\_Muriithi](https://forum.ansible.com/u/William_Muriithi)\
**Post date:** [November 30, 2014, 5:41pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16922/1 "2014-11-30T17:41:12Z")

</div>

Brian

> I have written dynamic inventory scripts [https://dpaste.de/1mVa](https://dpaste.de/1mVa) . But I  
> dont get whats the benefit of using dynamic inventory. I still had to list  
> all the things which I used in static inventory. could you tell me in what  
> way I can get most out of dynamic inventory. In what ways It is better to  
> use, right now I dont think so  
> Brian Coca \<bcoca@ansible.com\>: Nov 28 10:38AM -0500
> 
> Well, dynamic inventories make sense when you have an external source  
> (cloud provider, vm system, db, inventory system, ldap, etc) not when  
> you are just listing the hosts manually. If that is the case just  
> stick with the ini format.

Thank you a lot. Petty good answer and it make sense now as I had the  
same problem.

Was wondering, have you been able to retrieve a list of hosts' IPs  
given a list of vmware IPs? I have struggled with this a lot and the  
fact that dynamic inventory is designed for such case mean there is a  
way, just haven't found it

Would be great to share

William

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 30, 2014, 6:10pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16922/2 "2014-11-30T18:10:51Z")

</div>

there is actually an existing inventory script for vmware/vcenter, in  
the repo at plugins/inventory/vmware.py, check your ansible  
installation for the file and set it up as your inventory. You can  
also copy the vmware.ini in the same directory as an example for  
setting it up.

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [December 1, 2014, 1:57pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16922/3 "2014-12-01T13:57:13Z")

</div>

I've made some VMware inventory updates that will become a PR once I get  
tags working. It includes a change to define ansible\_ssh\_host for running  
VMs.

You can give it a try from my branch in the meantime:

[https://github.com/cchurch/ansible/blob/vmware\_inventory\_improvements/plugins/inventory/vmware.py](https://github.com/cchurch/ansible/blob/vmware_inventory_improvements/plugins/inventory/vmware.py)
