canonical / prometheus-juju-exporter

GNU General Public License v3.0
2 stars 8 forks source link

Metals with any interface (e.g. virbr0) with MAC prefix 52:54:00 are incorrectly recognized as kvm type #31

Closed przemeklal closed 1 year ago

przemeklal commented 1 year ago

I have a metal machine with the following MAC addresses:

$ juju show-machine 0
...
    network-interfaces:
      bond0:
        ip-addresses:
        - 10.56.150.113
        mac-address: ac:1f:6b:32:12:dc
        gateway: 10.56.150.1
        space: oam-space
        is-up: true
      br-bond0:
        ip-addresses:
        - 10.56.150.113
        mac-address: ac:1f:6b:32:12:dc
        gateway: 10.56.150.1
        space: oam-space
        is-up: true
      virbr0:
        ip-addresses:
        - 192.168.122.1
        mac-address: 52:54:00:31:a0:dd
        space: undefined
        is-up: true

Because there's a virbr0 bridge with 52:54:00 MAC address prefix it gets incorrectly recognized as a KVM. There's no option to override this as we can currently do with KVMs incorrectly recognized as metals. This mainly affects MAAS nodes that often host KVMs and hence the virbr0 bridge exists on them, but there were occurrences of regular OpenStack compute nodes incorrectly recognized as KVMs due to the same issue (virbr0 with KVM-specific MAC address).

aieri commented 1 year ago

I think we should introduce a per-hostname override. It's fine that we use mac addresses for our heuristic, and it's fine that we can affect the algorithm via mac address overrides. However, at the end of the day every host can have multiple mac addresses so it'd seem cleaner to me that if we want to truly sidestep the autodetection we'd do so at the host level