Simon Woolsgrove wrote:
I just noticed this with the new network snippet in 1.4.1.
If I add a system and only configure say eth5, cobbler adds eth0 I get say
interface : eth0
mac address :
bonding :
bonding_master :
bonding_opts :
is static? : False
ip address :
subnet :
static routes : []
dns name :
dhcp tag :
virt bridge :
interface : eth5
mac address : 00:xx:xx:xx:xx:xx
bonding :
bonding_master :
bonding_opts :
is static? : False
ip address :
subnet :
static routes : []
dns name :
dhcp tag :
virt bridge :
The network snippet renders this as
# --- Network ---
# Network information
# Using "old" style networking config. Make sure all MAC-addresses are in
cobbler to use the new-style config
network --bootproto=dhcp --hostname=fred --device=eth0 --onboot=on
network --bootproto=dhcp --device=eth1 --onboot=on
It goes into old style as no mac has been assigned to eth0 (unwanted interface).
Making the following change fixes this
diff --git a/snippets/network_config b/snippets/network_config
index 001aa50..a1ab5e4 100644
--- a/snippets/network_config
+++ b/snippets/network_config
@@ -61,7 +61,7 @@
#end if
## network details are populated from the cobbler system object
#if $is_vlan == "false"
-network $network_str --device=eth$i --onboot=on
+network $network_str --device=$iname --onboot=on
#end if
#end for
#end if
# --- Network ---
# Network information
# Using "old" style networking config. Make sure all MAC-addresses are in
cobbler to use the new-style config
# found interface eth5 processing ...
network --bootproto=dhcp --hostname=fred --device=eth5 --onboot=on
# found interface eth0 processing ...
network --bootproto=dhcp --device=eth0 --onboot=on
Patch looks good to me, we can't get networking perfect without knowing
the MAC-addresses, but this is probably better than we had. Thanks! I do
recommend keeping track of the MAC-addresses in Cobbler however. This
can cause unexpected behaviour. :)
Adding the mac address for eth0 fixes the issue as it jumps to the
pre_install_network_config snippet. I guess when eth0 is allowed to be removed would fix
this use case. But will still happen if old style is employed with non consecutive
interfaces.
The patch for this issue was merged yesterday, and will be included in
Cobbler 1.4.2 which iirc is scheduled for Friday, so you can remove eth0
if you like.
Jasper