On Fri, Mar 25, 2022 at 3:54 PM <nicolas@devels.es> wrote:
Hi,

We have a Python-SDK script to find MAC dupes in our infrastructure.

Thanks for it, Nicolas.
But does it work if you have separate engines and in a scenario like mine?
Even if you have a mac pool, you could import a VM and have it retain its original mac, that could be out of the mac pools normally admitted in that environment.
It seems that your script has the variable below to adapt:
# Replace this with your active MAC address pools, WITHOUT the last octet
MACPOOLS = ['00:11:22:33:44', '00:55:66:77:88']

I will dig into your script, anyway.
In the meantime, querying the engine db I used something like this to find the last two characters when the first ones are of type aa:bb:cc:dd:ee (or in general to match what I need):

select substring(mac_addr from 16 for 2) as value from vm_interface where mac_addr like 'aa:bb:cc:dd:ee%' order by value;

and then if I find anything in common in env1 and env2 (such as ff for last two characters) and want to see which VMs are involved I can use

select vm_name from vm_interface,vm_static where vm_interface.vm_guid=vm_static.vm_guid and mac_addr='aa:bb:cc:dd:ee:ff'

Gianluca