On Fri, Jan 24, 2014 at 11:57:03AM +0800, WANG Chao wrote:
On 01/22/14 at 12:59pm, Vivek Goyal wrote:
> On Mon, Jan 13, 2014 at 06:23:11PM +0800, WANG Chao wrote:
>
> [..]
> > #save netdev used for kdump as cmdline
> > - echo "kdumpnic=${_netdev}" >
${initdir}/etc/cmdline.d/60kdumpnic.conf
> > - echo "bootdev=${_netdev}" >
${initdir}/etc/cmdline.d/70bootdev.conf
> > + #fence kdump would override bootdev and kdumpnic, we should avoid that.
> > + if [ ! -f ${initdir}${initdir}/etc/cmdline.d/60kdumpnic.conf ] &&
> > + [ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then
> > + echo "kdumpnic=${_netdev}" >
${initdir}/etc/cmdline.d/60kdumpnic.conf
> > + echo "bootdev=${_netdev}" >
${initdir}/etc/cmdline.d/70bootdev.conf
> > + fi
>
> Chao,
>
> What's this change. Can you explain a bit.
Hi, Vivek
In case of network dump, bootdev and kdumpnic should be set to the NIC
routing to the network target, so that dracut is aware of which NIC
needs to be setup and configured as the gateway. It's fine that we just
set bootdev and kdumpnic without checking if these two are already set.
Because we know there is only one bootdev and kdumpnic in 2nd kernel.
However when fence_kdump comes into the picture, there might be several
NICs connecting to different target (different nodes and network dump
target). We need to ensure that the NIC that connects to the network
dump target works as the default one in the system (IE. to be bootdev
and kdumpnic) and the NICs that connects to other cluster nodes not to
be in the default route path.
In kdump-module-setup.sh, I'm re-using the setup network function. So I
figure out this way to avoid fence_kdump NIC overriding bootdev and
kdumpnic. Because setup dump target NIC is earlier then setup the fence
kdump NIC.
I know this part is a little bit tricky. But it does avoid some problems
we might face in case of a network dump in cluster environment...
Ok, got it. So first person who calls kdump_install_net() gets to set the
default gateway in kdump kernel?
This is kind of little odd. I guess it will work for time being, but I
wished there was a better mechanism to determine which network interface
should act as default gateway in second kernel.
Also it would be good to put few lines of comments explaining this
in code so that when next time we are reading the code, it is easier
to understand.
Thanks
Vivek