[FR] Tenant relation based on resource pool or parent folder tag in vCenter
Hi!
Currently, to define VM tenants in settings.ini we can only use vm_tenant_relation which would mean that you'd need to have some kind of common naming convention for each tenant or typing all VMs there.
Would it be possible to extent that functionality to define VM tenant based on tag of the parent folder it's located in vCenter or based on the resource pool? Our use case is that we separated departments and allocated each resource pool and folder, and they don't always follow suggested naming conventions unfortunately
Hi,
pretty sure this could be implemented. What would you suggest how the tenant name would be parsed from a tag?
I was thinking about 2 options, but I'm not sure if folder relation is easy to implement. But with tag vSphere SDK should be able to pull tags from the parent folder in vCenter, and then parse tags and find those hardcoded tenant to tag relation?
Option 1: Direct folder-to-tenant mapping
vm_tenant_folder_relation = Department-A = Tenant-A, Department-B = Tenant-B
Option 2: Folder tag-based mapping
vm_tenant_folder_tag_relation = dept:finance = Finance-Tenant, dept:engineering = Engineering-Tenant
Hi,
tags are already extracted from vCenter and added to VMs and Devices if desired. The issue here is to find a format of mapping a certain tag to a Tenant.
but maybe we could do following:
- first add tags to a VM with the existing options: https://github.com/bb-Ricardo/netbox-sync/blob/2e4c0f316361c497d2c77bc5f6661df26acc77d3/settings-example.ini#L309
- then use another config option which defines a regex for the tag to extract the tenant name.
- try to find extracted tenant and if tenant is found, add it to the VM
This could work and the user could freely define the tag format
Hi was there any progress on this ?
we have multi-tenant vCenter setups that have each customer under their own resourcepool. Perhaps a resourcepool to tenant name relation?
Sorry, currently there is no work going on here as the project is kind of stale at the moment