Fixes LP: #1811222 - Add conditional unique index to ensure that only 1 physical interface with the same mac address can exist in the database.
This prevents serialization issues where it was possible for 2 database connections to create the same physical interface with the same MAC address at the same time. Adds a data migration to remove any duplicates that would have been previously allowed into the database before the unique index is added.
add NumaNode model, and link it to nodes, and physical block devices and interfaces
The migration logic adds a default NUMA node 0 for each existing node, and links all resources to it.
Eventually we'll track all NUMA nodes in a node, and which resources are attached to them
Move DeferredAttribute loading prevention to a monkeypatch.
We currently prevent DeferredAttributes from being loaded from the
database in CleanSave.__getattribute__. However, that is very expensive,
since for each attribute get, we apply this check.
As an example, in a test that gets 30 nodes using the machine.list
websocket call, this patch took it down from 1.1 seconds to 0.6 seconds.