the interface default of eth0 has become more wrong since we've
got a generation of Linux distros that don't use eth* as their
interface naming. Instead of that do a slightly more clever, but
probably still wrong thing, of picking an interface that exists
and is a physical interface.
This is still overridable, however won't cause really cryptic
failures in nova-compute because it's trying to use an interface
that doesn't exist *really* late in the network creation.
Change-Id: I93016ff5a25678de76254418155c839a269486a0
| ... | ... |
@@ -75,8 +75,13 @@ QEMU_CONF=/etc/libvirt/qemu.conf |
| 75 | 75 |
|
| 76 | 76 |
# Set default defaults here as some hypervisor drivers override these |
| 77 | 77 |
PUBLIC_INTERFACE_DEFAULT=br100 |
| 78 |
-GUEST_INTERFACE_DEFAULT=eth0 |
|
| 79 | 78 |
FLAT_NETWORK_BRIDGE_DEFAULT=br100 |
| 79 |
+# set the GUEST_INTERFACE_DEFAULT to some interface on the box so that |
|
| 80 |
+# the default isn't completely crazy. This will match eth*, em*, or |
|
| 81 |
+# the new p* interfaces, then basically picks the first |
|
| 82 |
+# alphabetically. It's probably wrong, however it's less wrong than |
|
| 83 |
+# always using 'eth0' which doesn't exist on new Linux distros at all. |
|
| 84 |
+GUEST_INTERFACE_DEFAULT=$(route -n | awk '{print $8}' | grep ^[ep] | sort | head -1)
|
|
| 80 | 85 |
|
| 81 | 86 |
# Get hypervisor configuration |
| 82 | 87 |
# ---------------------------- |