You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FR] Tenant relation based on resource pool or parent folder tag in vCenter #463
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
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?
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.
Implemented in development (#589), in the image ghcr.io/bb-ricardo/netbox-sync:development. Two new relations: vm_tenant_resource_pool_relation maps the resource pool path (Parent/Child, the root pool left out) or the plain pool name to a tenant, vm_tenant_folder_relation does the same for the VM folder path relative to the datacenter (Dept-A/Prod) or the plain folder name. Both take the regex = tenant lists vm_tenant_relation uses; vm_tenant_relation is tried first, then pool, then folder. The tag-based variant you mentioned as option 2 is not in this round; if the folder and pool mapping does not cover your layout, say so and I will look at it.
Could you try it against your vCenter? Run with -n first, then a real run and a second one (the second should change nothing in NetBox), and say what came out, here or in the call for testing: #592. Nothing changes unless the option is set, so pulling the image is safe. It goes into 1.10.0, the next feature release.
Activity
bb-Ricardo commentedon Jun 16, 2025
Hi,
pretty sure this could be implemented. What would you suggest how the tenant name would be parsed from a tag?
Hidden-Network404 commentedon Jun 17, 2025
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
bb-Ricardo commentedon Jun 18, 2025
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:
netbox-sync/settings-example.ini
Line 309 in 2e4c0f3
This could work and the user could freely define the tag format
xonacs commentedon Nov 5, 2025
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?
bb-Ricardo commentedon Nov 17, 2025
Sorry, currently there is no work going on here as the project is kind of stale at the moment
semx commentedon Oct 10, 2026
Implemented in
development(#589), in the imageghcr.io/bb-ricardo/netbox-sync:development. Two new relations:vm_tenant_resource_pool_relationmaps the resource pool path (Parent/Child, the root pool left out) or the plain pool name to a tenant,vm_tenant_folder_relationdoes the same for the VM folder path relative to the datacenter (Dept-A/Prod) or the plain folder name. Both take theregex = tenantlistsvm_tenant_relationuses;vm_tenant_relationis tried first, then pool, then folder. The tag-based variant you mentioned as option 2 is not in this round; if the folder and pool mapping does not cover your layout, say so and I will look at it.Could you try it against your vCenter? Run with
-nfirst, then a real run and a second one (the second should change nothing in NetBox), and say what came out, here or in the call for testing: #592. Nothing changes unless the option is set, so pulling the image is safe. It goes into 1.10.0, the next feature release.