[opensuse-autoinstall] Persistent enumeration of net devices
Hi My customer has run into what seems to be a general problem regarding the network interface names. They want to create an autoyast-based install of SLES11 on 100+ HP DL380 and DL360 machines, which are all equipped with an extra interface card. However Linux maps the logical interfaces depending on which of the internal or the extra card that answer first during the installation. This mapping can also differ from one OS installation to the next on the same box. We somehow need to ensure persistent mapping of device names to real physical ports. Trying to work around this they have developed as script that will be run after the SLESinstallation. The script will replace the /etc/udev/rules.d/70-persistent-net.rules file with new rules that * Splits the name space of eth into "drivername" with individual enumeration, for each driver. * Uses busid instead of MAC to facilitate easy swap of broken cards. Also pci bus-id naming seems to follow the physical port assignment on the ports, which MAC address does not. However there must (hopefully) be an easier way of achieving this.. Despite searching high and low we have had no success in finding out how to switch to bus-id instead of MAC and to adapt the naming in /lib/udev/write_net_rules. How to do using yast2 is well described, but autoyast or adapting the generator scripts is very unclear. Most information talks about changing the rule-file itself, but not the scripts that generate it. Any information on how to do this would be most helpful. Thank you. Best regards Andreas Taschner Designated Support Engineer Novell Making IT work as one www.novell.com -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Friday 24 September 2010 Andreas Taschner wrote:
Trying to work around this they have developed as script that will be run after the SLESinstallation. The script will replace the /etc/udev/rules.d/70-persistent-net.rules file with new rules that * Splits the name space of eth into "drivername" with individual enumeration, for each driver. * Uses busid instead of MAC to facilitate easy swap of broken cards. Also pci bus-id naming seems to follow the physical port assignment on the ports, which MAC address does not.
Michal Zugec wrote in his blog about that a while ago. The example is for MAC addresses but I hope you can change it to your customers needs: http://mzugec.blogspot.com/2008/07/autoyast-network-device-names.html -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On 9/24/2010 at 16:24, Uwe Gansert <ug@suse.de> wrote: on Friday 24 September 2010 Andreas Taschner wrote:
Trying to work around this they have developed as script that will be run after the SLESinstallation. The script will replace the /etc/udev/rules.d/70-persistent-net.rules file with new rules that * Splits the name space of eth into "drivername" with individual enumeration, for each driver. * Uses busid instead of MAC to facilitate easy swap of broken cards. Also pci bus-id naming seems to follow the physical port assignment on the ports, which MAC address does not.
Michal Zugec wrote in his blog about that a while ago. The example is for MAC addresses but I hope you can change it to your customers needs: http://mzugec.blogspot.com/2008/07/autoyast-network-device-names.html
Thank you for that hint, Uwe. I have created and tested a udev rule like this : SUBSYSTEM=="net", ACTION=="add", BUS=="pci", ID=="0000:04:04.0", KERNEL=="eth*", NAME="eth3" Applying that to an autoyast profile (which is using probably buggy syntax - I do not really understand the <rule> elements : ... <net-udev config:type="list"> <rule> <name>eth0</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:04.0</value> </rule> <rule> <name>eth1</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:01.0</value>0000:04:04.0 </rule> </net-udev> ... Although it works for eth0 (which is really great), the rest does not get picked up correctly and udev ends up setting its default rules for the remaining interfaces, resulting in this /etc/udev/rules.d/70-persistent-net.rules file : SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:04:04.0", NAME="eth0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", =="", NAME="" <<<<?????? # PCI device 0x8086:0x107c (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0e:0c:d7:f7:79", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x8086:0x107c (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:2e:70:a4", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2" Any tips ? Sorry if I am missing really, really basic knowledge in this area ... Thanks. //Andreas -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Monday 27 September 2010 Andreas Taschner wrote:
Thank you for that hint, Uwe. I have created and tested a udev rule like this : SUBSYSTEM=="net", ACTION=="add", BUS=="pci", ID=="0000:04:04.0", KERNEL=="eth*", NAME="eth3" Applying that to an autoyast profile (which is using probably buggy syntax - I do not really understand the <rule> elements : ... <net-udev config:type="list"> <rule> <name>eth0</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:04.0</value> </rule>
this can not work. You can not have the same key twice there (rule and value). The second one will overwrite the first one. You can only have keys twice in a config:type="list" like in the <net-udev...> Unfortunately you can not simply write a config:type="list" anywhere you want. In the <rule>, you can't have keys twice.
<rule> <name>eth1</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:01.0</value>0000:04:04.0 </rule> </net-udev> ...
Although it works for eth0 (which is really great), the rest does not get picked up correctly and udev ends up setting its default rules for the remaining interfaces, resulting in this /etc/udev/rules.d/70-persistent-net.rules file :
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:04:04.0", NAME="eth0"
as you can see, only the second keys made it into the config.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", =="", NAME="" <<<<??????
this is a little bit weird though. I would have expected to see the name set and the ID too. Hmm. If you can reproduce that, I have to look at it or I have to ask Michal. -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On 9/28/2010 at 09:48, Uwe Gansert <ug@suse.de> wrote: on Monday 27 September 2010 Andreas Taschner wrote:
Thank you for that hint, Uwe. ... <net-udev config:type="list"> <rule> <name>eth0</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:04.0</value> </rule>
this can not work. You can not have the same key twice there (rule and value). The second one will overwrite the first one.
It appears to work fine as the ID is sufficient in the udev rule. ...
You can only have keys twice in a config:type="list" like in the <net-udev...> Unfortunately you can not simply write a config:type="list" anywhere you want. In the <rule>, you can't have keys twice.
<rule> <name>eth1</name> <rule>BUS</rule> <value>PCI</value> <rule>ID</rule> <value>0000:04:01.0</value>0000:04:04.0 <<<<<<<<
Please forgive me - it was a pasto. I had looked at it too many times and did not see the trailing 0000:04:04.0 behind the </value>. Now I have created three different rules that all work like a charm. Will create a TID on this very useful net-udev feature. Thanks for all the help and patience. //Andreas -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Fri, Sep 24, 2010 at 10:31 AM, Andreas Taschner <ataschner@novell.com> wrote:
My customer has run into what seems to be a general problem regarding the network interface names. They want to create an autoyast-based install of SLES11 on 100+ HP DL380 and DL360 machines, which are all equipped with an extra interface card. However Linux maps the logical interfaces depending on which of the internal or the extra card that answer first during the installation. This mapping can also differ from one OS installation to the next on the same box.
We somehow need to ensure persistent mapping of device names to real physical ports.
I have a similiar situation, solved by writing a script that: a) gets the current state of networking configuration at install time (IP, gateway, active interface w/ MAC) b) does a "sed" on the autoyast profile and substitute the proper networking parameters c) reload the profile -- -- Erico -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Andreas Taschner wrote
Hi
My customer has run into what seems to be a general problem regarding the network interface names. They want to create an autoyast-based install of SLES11 on 100+ HP DL380 and DL360 machines, which are all equipped with an extra interface card. However Linux maps the logical interfaces depending on which of the internal or the extra card that answer first during the installation. This mapping can also differ from one OS installation to the next on the same box.
In case that the onboard and addon interface use different modules you can easily set the order by using linuxrc parameters linuxrc.debug=-udev.mods insmod=first-module insmod=second-module The order of these modules will be transferred into INITRD_MODULES, too. Of course this won't help if all network interfaces use the same module cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (4)
-
Andreas Taschner
-
Erico Mendonça
-
Frank Steiner
-
Uwe Gansert