simsplestream-synced image persistent across purges on armhf

Bug #1941713 reported by Simon Chopin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uvtool
Confirmed
Undecided
Unassigned

Bug Description

Hi,

After an initial success booting an armhf impish VM using

uvt-simplestreams-libvirt sync --source http://cloud-images.ubuntu.com/daily release=impish arch=armhf

an unfortunate series of mistakes resulted in my deleting the VM and purging the image (broken initramfs in it) via

uvt-simplestreams-purge

Re-syncing the image seemed to work as expected, as I could see the network traffic. However, creating a new armhf VM resulted in using the broken initramfs (and kernel) from the image before the purge.

I've tried manually deleting everything I could find under /var/lib/uvtool, but the broken image kept popping up.

Revision history for this message
Robie Basak (racb) wrote :

Thank you for your report.

Could you please provide steps to reproduce?

I've marked the bug title with armhf for now as I believe that external kernel/initrd is armhf-specific.

summary: - simsplestream-synced image persistent across purges
+ simsplestream-synced image persistent across purges on armhf
Changed in uvtool:
status: New → Incomplete
Revision history for this message
Simon Chopin (schopin) wrote :

Note that I can properly boot a fresh image using the mount-image-callback method to extract the vmlinuz and initrd, as done in the source code. The only difference is that I'm using a manually downloaded image (and running qemu manually, obviously)

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hmm,
it was supposed to recreate the file if it is deleted for issues like yours or if anyone wants to e.g. place their own kernel/initrd.
If not there it should on creation extracts the initrd/kernel from the image.

The current impish image seems to be broken thou :-/

root@i:~# uvt-simplestreams-libvirt --verbose sync --source http://cloud-images.ubuntu.com/daily arch=armhf label=daily release=impish
Adding: com.ubuntu.cloud.daily:server:21.10:armhf 20210824
root@i:~# uvt-kvm create --password=ubuntu --guest-arch=armhf testarm release=impish arch=armhf label=daily
Warning: using --password from the command line is not secure and should be used for debugging only.
qemu-nbd: Failed to open /dev/nbd0: No such file or directory
qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to socket: Broken pipe
Failed [1]: /var/lib/uvtool/libvirt/images/x-uvt-b64-Y29tLnVidW50dS5jbG91ZC5kYWlseTpzZXJ2ZXI6MjEuMTA6YXJtaGYgMjAyMTA4MjQ= qcow2 auto rw
error: extract vmlinuz from image /var/lib/uvtool/libvirt/images/x-uvt-b64-Y29tLnVidW50dS5jbG91ZC5kYWlseTpzZXJ2ZXI6MjEuMTA6YXJtaGYgMjAyMTA4MjQ=
Traceback (most recent call last):
  File "/usr/bin/uvt-kvm", line 35, in <module>
    uvtool.libvirt.kvm.main_cli_wrapper(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py", line 1102, in main_cli_wrapper
    main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py", line 1097, in main
    args.func(parser, args)
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py", line 890, in main_create
    create(
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py", line 625, in create
    kernel = get_boot_item(base_volume_name, hostname, "vmlinuz")
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py", line 426, in get_boot_item
    return item_vol.path()
UnboundLocalError: local variable 'item_vol' referenced before assignment
root@i:~# vim /usr/lib/python3/dist-packages/uvtool/libvirt/kvm.py

The issue is "error: extract vmlinuz ..."

Most likely this is what break re-extraction in your case as well.
So assuming this can't work as something in the image is broken (or in a way that uvtool can't handle yet).

Trying Hirsute ... hmmm no that breaks the same way.
So the problem is that we can't extract those files anymore.

Changed in uvtool:
status: Incomplete → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Note:
Since the code is meant to allow manually placed files it will be happy to work with those (as you have said yours work if you extract it yourself with mount-image-callback.
If you'd place those in the right paths manually the rest of uvtool might even work:
  /var/lib/uvtool/libvirt/images/<guestname>-vmlinuz
  /var/lib/uvtool/libvirt/images/<guestname>-initrd.img

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Doing manually what happens under the cover
I think this fails because I need to leave my container to do the mount magic needed here ...
So do not trust this comment too much.
It is mostly to document a next step for someone with a system around.

$ mkdir /tmp/test
$ mount-image-callback /var/lib/uvtool/libvirt/images/x-uvt-b64-Y29tLnVidW50dS5jbG91ZC5kYWlseTpzZXJ2ZXI6MjEuMTA6YW1kNjQgMjAyMTA4MDc\= --mountpoint /tmp/test -- cp -L /tmp/test/boot/vmlinuz /tmp/vmlinuz
qemu-nbd: Failed to open /dev/nbd0: No such file or directory
qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to socket: Broken pipe
Failed [1]: /var/lib/uvtool/libvirt/images/x-uvt-b64-Y29tLnVidW50dS5jbG91ZC5kYWlseTpzZXJ2ZXI6MjEuMTA6YW1kNjQgMjAyMTA4MDc= qcow2 auto rw

The same with a manually downloaded file:

$ wget https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-armhf.img
$ mount-image-callback /root/impish-server-cloudimg-armhf.img --mountpoint /tmp/test -- cp -L /tmp/test/boot/vmlinuz /tmp/vmlinuz

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.