Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-06 Diskussionsfäden Frédéric BOITEUX
Le dim 05 oct 2008 12:17:43 CEST, Jean Spirat <[EMAIL PROTECTED]> a
écrit :

> Jean Spirat a écrit :
> > Hello,
> >
> >  All my tests works well but i have a failure when i try to install a 
> > host with two ethernet cards. The dhcp and tftp runs on the eth1 
> > network and it works fine. But the issue is that the fai kernel when 
> > loaded bring not eth1 but eth0.
> >
> >  So it can never connect to the nfs server.i tried to add 
> > ether=0,0,eth1 to the pxe config but this does not work as it seems 
> > the tg3 modules is not in kernel but comes from the initramfs. I do 
> > not see how i can change anything in the fai kernel or initd to make 
> > this works. Anyone know how to deal with this problem or know if i do 
> > something wrong ?

  Hello,

  I've got the same problem with a Debian-Live system booted from PXE
network (follow this thread :
http://lists.debian.org/debian-live/2008/09/msg00248.html), and the solution 
was to use a small script (attached to this e-mail) to select the right 
interface (one connected) to do the DHCP, then NFS mount. The script has to be 
installed in the FAI's initrd : put it in the scripts/init-premount/ of the FAI 
Initramfs' config directory () and rebuild the initrd for your net boot.

Fred.


select_eth_device
Description: Binary data


Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-05 Diskussionsfäden Thomas Neumann

Cristian Ionescu-Idbohrn schrieb:

udev and/or ifrename may help.  That implies you provide some sort of
configuration file(s).
  
How do I supply a configuration file, if it is the nfsroot that is not 
being mounted? Maybe if one would try to put the udev-config into the 
initrd. Hm. Didn't think of this before. Need some glue beforehand though.


- boot initrd
- initrd starts a script which detects mac-addresses, tries to figure 
out the correct one and

  writes an udev/ifrename rule
 (which is kinda easy - we assign these macs manually - last three 
bytes correspond to the

  last three octets from the ip address)
- udev starts and hopefully assigns the correct interface
- fetch nfsroot

Big question: Is udev started from the initrd or from the nfsroot? 
Haven't looked to close into the initrd yet, maybe someone can tell 
without looking. I guess the later's the case. Then I'd have to rebuild 
the initrd. .oO(Is it worth the trouble?)


Wouldn't help the OP though. Since he's using physical nics, guessing 
the correct interface is a lot harder. Maybe by keeping a list of 
"valid" macs. But this means rebuilding the initrd each time a new 
machine is added. *yuck*



tschüß
thomas


Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-05 Diskussionsfäden Cristian Ionescu-Idbohrn
On Sun, 5 Oct 2008, Thomas Neumann wrote:

> Jean Spirat schrieb:
> > > All my tests works well but i have a failure when i try to install
> > > a host with two ethernet cards. The dhcp and tftp runs on the eth1
> > > network and it works fine. But the issue is that the fai kernel when
> > > loaded bring not eth1 but eth0.
> > >
> > > [...]
> > to add a little more explanation:
> >
> > - host boot ok
> > - pxe boot get the ip from the dhcp
> > - tftp load the kernel ok
> > - kernel fail to get the NFS server as it brings only eth0 up
> I encountered the same with VMs provided by XenServer. As soon as I add
> a second interface, the newly added interface is enumerated as the first
> one ('eth0') and the previously existing interface is now the second one
> ('eth1'). Which is not that much of a problem when the VM has been
> installed. udev figures out the correct order.

udev and/or ifrename may help.  That implies you provide some sort of
configuration file(s).

You could write a script that picks up the interface name and mac address
during installation and stores that for example in /etc/iftab.
Upon the next boot ifrename will pick that and rearrange stuff for you in
a deterministic manner.

You could also mangle /etc/udev/rules.d/70-persistent-net.rules
or some such.


Cheers,

-- 
Cristian


Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-05 Diskussionsfäden Thomas Neumann

Jean Spirat schrieb:
 All my tests works well but i have a failure when i try to install a 
host with two ethernet cards. The dhcp and tftp runs on the eth1 
network and it works fine. But the issue is that the fai kernel when 
loaded bring not eth1 but eth0.


[...]

to add a little more explanation:

- host boot ok
- pxe boot get the ip from the dhcp
- tftp load the kernel ok
- kernel fail to get the NFS server as it brings only eth0 up
I encountered the same with VMs provided by XenServer. As soon as I add 
a second interface, the newly added interface is enumerated as the first 
one ('eth0') and the previously existing interface is now the second one 
('eth1'). Which is not that much of a problem when the VM has been 
installed. udev figures out the correct order.


However it's quite a hassle when providing a new VM (or reinstalling an 
existing one), because the VM will boot from the wrong interface. I 
found 2 workarounds, but neither are pretty.


1.) create VM with one interface, install it, add the second one
 works for the installing, but remember to delete and create the second 
interface before/after re-installation
2.) if the VM is going to have 2 interfaces then create them in swapped 
order.

 works fine with installation and reinstallation.
 Flaws:  - Fortunately we didn't have to provide a VM with 3 or more 
interfaces yet
 -  Adding an interface to an already existing VM is a bit 
tricky, because I have to not only add it, but also remember to swap them.


Xen(Server) specific:
There's a hidden parameter device id, which you can't influence from the 
gui. We are in the process of provisioning VMs from the command line 
automatically. With the command line one is able to influence this 
parameter. Maybe this would be enough to guaranteeing the 
'FAI'-interface to be the 'first' one.


But a more general fix would be appreciated.

tschüß
thomas


Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-05 Diskussionsfäden Andreas Sindermann
Jean Spirat writes:
 > Jean Spirat a écrit :
 > > Hello,
 > >
 > >  All my tests works well but i have a failure when i try to install a 
 > > host with two ethernet cards. The dhcp and tftp runs on the eth1 
 > > network and it works fine. But the issue is that the fai kernel when 
 > > loaded bring not eth1 but eth0.
 > >
 > >  So it can never connect to the nfs server.i tried to add 
 > > ether=0,0,eth1 to the pxe config but this does not work as it seems 
 > > the tg3 modules is not in kernel but comes from the initramfs. I do 
 > > not see how i can change anything in the fai kernel or initd to make 
 > > this works. Anyone know how to deal with this problem or know if i do 
 > > something wrong ?
 > >
 > > regards,
 > > Jean.
 > to add a little more explanation:
 > 
 > 
 > - host boot ok
 > - pxe boot get the ip from the dhcp
 > - tftp load the kernel ok
 > - kernel fail to get the NFS server as it brings only eth0 up

Try disabling one of the ethernet interfaces in the BIOS.

Hope this helps
Andreas



Re: NFS/dhcp/tftp on eth1, kernel search NFS it on eth0

2008-10-05 Diskussionsfäden Jean Spirat

Jean Spirat a écrit :

Hello,

 All my tests works well but i have a failure when i try to install a 
host with two ethernet cards. The dhcp and tftp runs on the eth1 
network and it works fine. But the issue is that the fai kernel when 
loaded bring not eth1 but eth0.


 So it can never connect to the nfs server.i tried to add 
ether=0,0,eth1 to the pxe config but this does not work as it seems 
the tg3 modules is not in kernel but comes from the initramfs. I do 
not see how i can change anything in the fai kernel or initd to make 
this works. Anyone know how to deal with this problem or know if i do 
something wrong ?


regards,
Jean.

to add a little more explanation:


- host boot ok
- pxe boot get the ip from the dhcp
- tftp load the kernel ok
- kernel fail to get the NFS server as it brings only eth0 up

Regards,
Jean.