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, either, but maybe you should try to find a solution for this plugin. It would be more future-proof.