We have vCenter where many linux bases vm which are use by other lob, there is no proper naming standard , no ip based filter possible , no folders arranged properly
With all this, one thing which is in my control is add “custom attributes”
Is there any way we can filter using "custom attributes’
You can use custom attributes assigned to vms using inventory. Let us assume that a VM has attributes as “OS” = “Linux” and “Backup” = “Monday” then
your inventory configuration looks like -
Abhijit actually i came across that one & tried below … “per the documents” … which were confusing BTW … soon i will give link
filters:
“tag_category.OS is defined and ‘Ubuntu16.04’ in tag_category.OS”
I had difficult time to get this tested … as for “tags” you see some extra stuff install & that install though looks straighforward but took me for spin … so i am more into fixing the python issues … May be you can help… soon i will give all i tried & error i got …
ansible-inventory --list -i vmware.yml
[WARNING]: * Failed to parse /etc/ansible/playbooks/vmware.yml with ansible_collections.community.vmware.plugins.inventory.vmware_vm_inventory plugin: Unable to find ‘vSphere
Automation SDK’ Python library which is required. Please refer this URL for installation steps - https://code.vmware.com/web/sdk/7.0/vsphere-automation-python
[WARNING]: Unable to parse /etc/ansible/playbooks/vmware.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
“_meta”: {
“hostvars”: {}
},
“all”: {
“children”: [
“ungrouped”
]
}
}
That will be a good & handy feature request… as you can imagin for so many use cases & for ease … BTW with powercli it is possible to do this… so is technically possible as well