Closed AshleyYakeley closed 9 months ago
Hashing could work though note all kvm MAC addresses must start with 52:54:00:
. Unfortunately I cant find any official documentation why just random notes and I get an error when changing that prefix.
OK, the size of each network is small, so even with only 24 bits, collisions are unlikely (and in any case, this is no worse than what libvirt does).
Is this just a QEMU/KVM thing, or are there restrictions for other connection types?
Second MAC digit probably needs to be 2 for unicast / locally administered / administratively assigned.
Yeah still should be plenty of room and from what I can see it's a QEMU/KVM thing - I'm not aware of any restrictions for other connection types.
Done.
Given a domain definition with an interface with no MAC address specified, libvirt will assign a MAC address, apparently non-reproducibly. This makes Nix module activation non-idempotent, causing domain restarts.
Possible solution: if a MAC address is missing, invent one by hashing the domain UUID together with the index (since there may be more than one interface).