On Mon, May 29, 2023 at 08:22:06PM +0200, Helmut Grohne wrote:
> Hi Wouter,
> 
> On Mon, May 29, 2023 at 02:20:09PM +0200, Wouter Verhelst wrote:
> > I am exploring the possibility to write an autopkgtest for the initramfs
> > stuff that I wrote for nbd-client.
> 
> Please see my other mail regarding the use of debvm in autopkgtests.
> Let's not duplicate that topic here. I note that this fully applies in
> the exact way to the projected use of mmdebstrap below.

Sure, but as there were two feature requests, I opened two wishlist bugs ;-)

> > In order to do so, I want to run a client VM that has no root hard disk
> > configured, but is configured to attempt to mount the VM image over the
> > network, using NBD. This is accomplished by way of a few kernel command
> > line parameters.
> > 
> > I tried running
> > 
> > debvm-run -- -append 'nbdroot=192.168.88.103,root_export,nbd0'
> 
> May I suggest that this is a quite unusual use case

Sigh.

Everyone who I talk to about nbd autopkgtest tells me it's an "unusual"
use case.

I don't think it is. All packages that do things at early boot have
complicatd requirements; nbd isn't the only one. It's just the first one
you hear about.

> and that debvm may not be the right hammer for your job? While debvm
> gives you a complete rootfs, you seem to be satisfied with a kernel an
> an initrd.

No, that is not accurate; I do need a root filesystem too.

For reference, nbd is not nfs; it is a network BLOCK device, which means
you need to layer a filesystem on top. So in order to be able to boot
from nbd, you need to create an image that you export. While I could do
this myself, it's what debvm-create does, and I don't think it makes
much sense to replicate that.

In short, the plan is to do something along these lines:

1. Create a filesystem image
2. Configure nbd-server to export that image over NBD, and restart nbd-server
3. boot a VM with the root filesystem on NBD, pointed to the nbd-server that we
   just configured
4. Verify that we reach a shell in the VM
5. shut down the VM again
6. Verify that the shutdown worked correctly
7. Boot the VM again, make configuration changes, update the initramfs
8. Reboot the VM, repeat steps 4 through 6.

(I might also want to try some of the other nbdroot= argument formats
that are documented in nbd-client's README.Debian, which all would
require their own reboot, but these are details)

I was looking at guestfish and other similar things, but really, debvm
already does all of this, so there's no point. The only thing is that it
insists on passing root and hard disk arguments to qemu, which break for
my use case.

Yes, I could run debvm-create and then do the extraction of the kernel
and initrd myself, but that shouldn't be necessary -- debvm-run would be
a perfectly good abstraction, if only it allowed me to tell it not to
try to mount the hard drive automatically and/or let me override the
root= parameter.

Thanks for considering,

-- 
     w@uter.{be,co.za}
wouter@{grep.be,fosdem.org,debian.org}

I will have a Tin-Actinium-Potassium mixture, thanks.

Reply via email to