Alan Pevec
2009-Feb-06 18:12 UTC
[Ovirt-devel] [PATCH node] persist current ethN-MAC mapping
--- scripts/ovirt-config-networking | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 5940d80..c122d01 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -22,6 +22,8 @@ function configure_interface { local NIC=$1 local AUTO=$2 + local MAC=$(cat /sys/class/net/$NIC/address) + if [[ "$AUTO" == "AUTO" && -n "$OVIRT_IP_ADDRESS" ]]; then IPADDR=$OVIRT_IP_ADDRESS @@ -38,6 +40,7 @@ function configure_interface local IF_ROOT="$CONFIG_FILE_ROOT-$NIC" local IF_CONFIG="rm $IF_ROOT\nset $IF_ROOT/DEVICE $NIC" + IF_CONFIG="$IF_CONFIG\nset $IF_ROOT/HWADDR $MAC" local BR_ROOT="$CONFIG_FILE_ROOT-$BRIDGE" local BR_CONFIG="rm $BR_ROOT\nset $BR_ROOT/DEVICE $BRIDGE" -- 1.6.0.6
Alan Pevec
2009-Feb-07 01:00 UTC
[Ovirt-devel] [PATCH node] persist current ethN-MAC mapping
ok, this doesn't work on Fedora, if NIC order changed, you get "Device eth0 has different MAC address than expected, ignoring." because /etc/udev/rules.d/70-persistent-net.rules is not saved. Unfortunately bindmounting in rc.sysinit comes too late, drivers are already loaded at that time. We would need to remove and insert NIC driver kmods after bindmounting... Any better ideas? Older initscripts (EL-5 vintage) would rename the ethN interfaces to match the MAC in ifcfg-eth*