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
thanks for the tool, which has worked great so far.
We have created the VMs in a other VMware cluster according to the following scheme: <hostname> (<description>).
However, the VMs should only be created in Netbox with <hostname> as name and <description> as description.
The latter is not absolutely necessary.
Can this be implemented relatively easily, possibly with a "small" adjustment in the script?
I was thinking of a similar option with regex to the existing relations that can be set in the config file.
Implemented in development (#590), in the image ghcr.io/bb-ricardo/netbox-sync:development. vm_name_regex is applied to the vCenter name before anything else; the named group name becomes the NetBox name and an optional group description fills the description, so your example ^(?P<name>[^ (]+)(?: \((?P<description>.*)\))?$ turns web01 (production) into web01 with the description production. Names the regex does not match are used as they are. One thing to expect on an existing NetBox: VMs whose name changes are found again by MAC, IP or serial and renamed in place, so the first run with the option is a one-off rename.
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
[-]VM name mapping/relation with regex[/-][+][FR] VM name mapping/relation with regex[/+]marvinwankersteen commentedon Jun 23, 2025
I think I found a workaround.
The option
strip_vm_domain_name = Truecan be used with the following change in https://github.com/bb-Ricardo/netbox-sync/blob/main/module/sources/vmware/connection.py:The dry-run looks good.
bb-Ricardo commentedon Jun 23, 2025
Great that you found a workaround. Currently there is no native implementation to do this.
vmware: derive the NetBox VM name and description with vm_name_regex
semx commentedon Oct 10, 2026
Implemented in
development(#590), in the imageghcr.io/bb-ricardo/netbox-sync:development.vm_name_regexis applied to the vCenter name before anything else; the named groupnamebecomes the NetBox name and an optional groupdescriptionfills the description, so your example^(?P<name>[^ (]+)(?: \((?P<description>.*)\))?$turnsweb01 (production)intoweb01with the descriptionproduction. Names the regex does not match are used as they are. One thing to expect on an existing NetBox: VMs whose name changes are found again by MAC, IP or serial and renamed in place, so the first run with the option is a one-off rename.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.