a quick and dirty hack to 'fix' the problem in a large scale -- RE: [CentOS] Nic order detection

Sat Jan 12 14:21:28 UTC 2008
Les Mikesell <lesmikesell at gmail.com>

Michael D. Kralka wrote:
> 
> Why resort to "tricks" when there is a perfectly good solution supported
> by the distribution? I've learned that it never pays to be clever. When
> resorting to neat little tricks to get things to work, they get
> forgotten, or worse when someone else must look into a problem, they
> spend most of the time trying to understand the clever way things are
> set up. When stability is a main concern, boring is always better.

The problem is that the disk images are made in one location and swapped 
into place in others, by someone who knows hardware, not linux, so for a 
new machine we won't know the hardware address ahead of time.  When I 
first realized that the NICs were detected in a different order I added 
a script that tried to bring them all up, look for link, assign an ip 
address and ping the associated router to figure out which 2 were in use 
and which address they should have.  However I did not realize (and I 
still don't see this documented anywhere...) that the device names would 
be non-deterministic or that they could be renamed after the kernel 
assigns a name.  I can probably tweak the script to pick up the mac 
address and include it in the ifcfg-ethX files to nail things down. 
But, I see something about adding udev rules for persistent names so 
this is probably going to change again.

-- 
   Les Mikesell
    lesmikesell at gmail.com