# Community\_vmware.yml - filtering by createDate

**URL:** <https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618>\
**Category:** Get Help\
**Tags:** vmware, awx, inventory\
**Created:** [April 1, 2026, 11:21am UTC](https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618 "2026-04-01T11:21:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsngztk](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hsngztk/32/10133_2.png) [@hsngztk](https://forum.ansible.com/u/hsngztk)\
**Post date:** [April 1, 2026, 11:21am UTC](https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618/1 "2026-04-01T11:21:18Z")

</div>

Hi!  
I need to create an inventory which consists vms that created past week. config.createDate format is ansible\_date\_time.iso8601

Do you have any suggestion to do that?

```auto
filters:
   - runtime.powerState == "poweredOn"
   - config.guestId is not match('windows*')
   - config.name is match('test*')
   - config.createDate >= "{{ '%Y-%m-%dT%H:%M:%SZ'|strftime( (ansible_date_time.epoch|int) - (60*60*24*7)) }}" #not works
  # - config.createDate <= "{{ ansible_date_time.iso8601 }}" #gathered all vms as expected
  # - config.createDate >= "2026-03-25T00:00:00Z" #works but need to dynamically update

```

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [April 1, 2026, 2:37pm UTC](https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618/2 "2026-04-01T14:37:16Z")

</div>

I don’t know how to do it. However, are we talking about `community.vmware.vmware_vm_inventory` here?

If so, please note that this has been deprecated in 5.4.0 and will be removed in 7.0.0 in half a year or so. I dont know how to do it with [vmware.vmware.vms](https://galaxy.ansible.com/ui/repo/published/vmware/vmware/content/inventory/vms/), either, but maybe you should try to find a solution for this plugin. It would be more future-proof.

---

<div class="post-metadata">

**Author:** ![hsngztk](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hsngztk/32/10133_2.png) [@hsngztk](https://forum.ansible.com/u/hsngztk)\
**Post date:** [April 10, 2026, 3:32pm UTC](https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618/3 "2026-04-10T15:32:50Z")

</div>

Thanks for advice.

I created a group with

```auto
groups:
  newly_created: config.createDate > "{{ lookup('pipe', 'date -d \"7 days ago\" +%Y-%m-%dT%H:%M:%S') }}"

```

Then I created a smart inventory for filtering by group name

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/a/af2932899252c28f0929dcbd63fb01c3e50b4f20.png)  
I thought I could handle it with filters in inventory yaml, it seems to have limited capabilities for arithmetic operations.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 10, 2026, 3:33pm UTC](https://forum.ansible.com/t/community-vmware-yml-filtering-by-createdate/45618/4 "2026-05-10T15:33:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
