I’m trying to create a new VM on Libvirt from the image. Unfortunately, I get this error: Failed to save: Failed to create a compute am2-infravmhost001 (Libvirt) instance am2-testapi016.dc.egnyte.lan: ERF42-3305 [Foreman::Exception]: Unable to find template /var/lib/libvirt/images/am2-testapi016
I configured a path to this image in Compute Resources -> am2-infravmhost001 -> Images.
I tried to change permission to this file but without success. I tried also convert image to qcow2 format using qemu-img convert. Without success as well.
Hello, you put an absolute path to the image file, including the extension and everything. Make sure that libvirt (not foreman) can access the file. Check permissions, group, SELinux etc.
When launching a libvirt host using a template, the “image” has to have the full path to the base template.
First go to Infrastructure > Compute resources > libvirt CR > Images and check that the image in use has the full path to the base image file on the hypervisor. Check with “ls -l PATH” that it’s correct.
You may need to refresh libvirt’s view of the images available using virsh pool-refresh default (or the appropriate pool name from virsh pool-list ).
Are you sure you are creating the VM in the “default” storage domain which has path set to /var/lib/libvirt/images? Our compute resource provider is only tested with “default” storage and network domains.
I ran into ERF42-3305 shortly after manually putting an image file in my pool directory (basically just the time it took me to define the image in the Compute Resource).
After virsh pool-refresh guest-image-pool (on the libvirt machine), I could use the image from foreman (Satellite 6.7 to be precise) just fine. Obviously adjust to your pool name.