[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Root-on-NBD



On Fri, Jul 17, 2009 at 11:25:53AM -0400, Paul Clements wrote:
> Wouter Verhelst wrote:
> >Hi Paul,
> >
> >Recently (that is, a few months ago), I did some initramfs hooks for
> >Debian to allow the root filesystem to be on an NBD device. They work
> >well, but Vagrant Cascadian (who maintains LTSP in Debian, which can
> >optionally use NBD for quite a few things) pointed out one issue with
> >this: when the system shuts down, there's no point in which userspace
> >can safely issue an nbd disconnect message to the kernel anymore. As
> >such, you rely on the TCP keepalive probes, which on a server serving
> >for a high amount of clients (as is common in LTSP environments) might
> >be problematic. Userspace can't do this, because that'd mean both
> >poweroff and nbd-client would need to be the very last command issued in
> >the shutdown sequence (running either makes doing the other impossible),
> >so that's a non-option.
> 
> Sounds reasonable to me. I'm not sure I understand the need to
> disconnect though. What is the issue that occurs if you don't
> disconnect?

Just that the server doesn't notice the client is gone until the TCP
keepalive probes time the connection out. It shouldn't be a major issue,
but on resource-strapped servers that serve hundreds of clients, it
might be better to avoid it if possible. Also, it's just cleaner to
properly disconnect if we know we're going down anyway, and I don't see
any downside to doing this (but then, I could be missing something).

> >As such, I thought it'd make sense to have the NBD kernel module do so.
> >Since the software-RAID subsystems seems to do a final sync right before
> >a system poweroff occurs, I presume there's support in the kernel to
> >hook into the poweroff sequence, and do some final cleanup operation. If
> >NBD could hook into that and at that point just send an NBD_DISCONNECT
> >message to the server, that would solve this issue.
> 
> Yes, there is a hook that md, for example, uses to stop all md
> devices at shutdown time.
> 
> Shouldn't be hard to get nbd to use that.

Great, thanks then.

-- 
The biometric identification system at the gates of the CIA headquarters
works because there's a guard with a large gun making sure no one is
trying to fool the system.
  http://www.schneier.com/blog/archives/2009/01/biometrics.html



Reply to: