Image sync fails when a VM refers to an unrelated image that doesn't exist

Bug #1998054 reported by wutr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uvtool
Triaged
Low
Unassigned

Bug Description

When trying to run:
uvt-simplestreams-libvirt sync release=jammy arch=amd64
the following error occurs:

Traceback (most recent call last):
  File "/usr/bin/uvt-simplestreams-libvirt", line 27, in <module>
    uvtool.libvirt.simplestreams.main()
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/simplestreams.py", line 332, in main
    args.func(args)
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/simplestreams.py", line 267, in main_sync
    clean_extraneous_images()
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/simplestreams.py", line 149, in clean_extraneous_images
    volume_names_in_use = frozenset(
  File "/usr/lib/python3/dist-packages/uvtool/libvirt/__init__.py", line 261, in get_all_domain_volume_names
    volume = conn.storageVolLookupByKey(path)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 5563, in storageVolLookupByKey
    raise libvirtError('virStorageVolLookupByKey() failed')
libvirt.libvirtError: Storage volume not found: no storage vol with matching key /home/wutr/kvm/base-images/focal-server-cloudimg-amd64.qcow2

I'm not sure why it is referring to a completely unrelated storage pool (the pool is "home-kvm" whereas uvtool uses the "uvtool" pool). The focal-server-cloudimg-amd64.qcow2 is a base image for another VM that is currently running fine and has been for over a year.

I have not delved deep because I'm unsure where to start, I am a new uvtool user!

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

Hi,

The image sync removes unused images. To do that it to scan all VMs to see if any are using an image that could be deleted. It sounds like you have a VM defined that refers to a volume that no longer exists? I think uvtool is trying to look it up to see if it matches one of its own volumes. If this is true then your libvirt setup is a little bit broken.

I suppose uvtool could try to skip the VM and move on in this case, but maybe that knowledge will help you work around the problem for now.

summary: - uvt-simplestreams-libvirt sync fails with: Storage volume not found: no
- storage vol with matching key /home/wutr/kvm/base-images/focal-server-
- cloudimg-amd64.qcow2
+ Image sync fails when a VM refers to an unrelated image that doesn't
+ exist
Changed in uvtool:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
wutr (wutr) wrote :

Thank you for taking the time to reply.

You are probably correct. I can't replicate it using virsh though, so I'm unsure what exactly is wrong with the other volume. Everything I normally do with my VMs other than uvt-simplestreams-libvirt works as expected. I initially stopped after this error showed up, but it turns out uvt-kvm works, so uvt-simplestreams-libvirt does save a useable image despite the error.

If I discover what part of my home-kvm storage pool is causing the issue I'll update this bug, but I'm not sure I will ever find out.

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.