Score:1

new VM's won't complete after I moved /var/lib/libvirt/images to a larger disc

ug flag

I have been building VM's on my fedora 37 server for a while, when I suddenly started running out of disc space. So, I looked in the filesystem and saw that the new VM's had their discs built at /var/lib/libvirt/images, so I made /var/lib/libvirt/images a symlink to a new partition which I had created, which has a lot more space. Now, however, when I virt-install a new VM, it gets stuck in the console and never completes the build. I'm not 100% sure the permissions of the new symlink are setup correctly. Here's what I have:

ls -l /var/lib/libvirt
total 0
drwx--x--x. 2 root root   6 Nov 20 12:45 boot
drwxr-xr-x. 2 root root  97 Mar 10 19:33 dnsmasq
drwx--x--x. 2 root root   6 Nov 20 12:45 filesystems
lrwxrwxrwx. 1 root root  15 Mar 20 06:00 images -> /vmroot/images/
drwx------. 2 root root   6 Nov 20 12:45 network
drwxr-x--x. 9 qemu qemu 103 Mar 24 11:32 qemu
drwx--x--x. 2 root root   6 Nov 20 12:45 swtpm

The VM Launch failure looks like this, FWIW:

1;39mmultipathd.[    4.614630] multipathd[555]: /etc/multipath.conf. See man    mpathconf(8) for more details
service…apper [    4.616316] multipathd[555]: /etc/multipath.conf does not exist, blacklisting all devices.
Multipath Device[    4.617884] multipathd[555]: You can run "/sbin/mpathconf --enable" to create
 Controller.[    4.619390] multipathd[555]: /etc/multipath.conf. See man mpathconf(8) for more details

[    4.620934] multipathd[555]: reconfigure: setting up paths and maps
[    4.622211] systemd[1]: Started multipathd.service - Device-Mapper Multipath Device Controller.
[   ***] Job dev-disk-by\x2dlabel-boot.device/start running (20s / 1min 30s)

And, eventually:

[    4.510452] systemd[1]: Started multipathd.service - Device-Mapper Multipath Device Controller.
[[   93.412712] systemd[1]: dev-disk-by\x2dlabel-boot.device: Job dev-disk-by\x2dlabel-boot.device/start timed out.
 TIME ] Timed out waiting fo[   93.418160] systemd[1]: Timed out waiting for device dev-disk-by\x2dlabel-boot.device - /dev/disk/by-label/boot.
r device ▒▒ice - /dev/disk/by-label/boot.

After this, it's stuck in a loop, allowing me to hit Ctrl-D to continue the loop, or Enter for maintenance mode.

As I was able to launch VM's with no trouble before the symlink change, but after I can no longer build VM's, I'm pretty sure this is the problem. But I have no idea how to fix. Any suggestions?

Score:0
ca flag

This is probably due to selinux.

Try this:

semanage fcontext -a -e /var/lib/libvirt /vmroot/images
restorecon -RF /var/lib/libvirt
restorecon -RF /vmroot/images
systemctl restart libvirtd

If it does not work, you can try to remove the /var/lib/libvirt/images symlink and substituting it with a bind mount doing the following:

semanage fcontext -a -e /var/lib/libvirt /vmroot/images
mkdir /var/lib/libvirt/images
mount --bind /vmroot/images /var/lib/libvirt/images
restorecon -RF /var/lib/libvirt
systemctl restart libvirtd

If it still does not work you can set selinux in permissive mode:

setenforce 0
systemctl restart libvirtd

To permanently set selinux in permissive mode, you need to edit /etc/selinux/config and set

SELINUX=permissive
Jason Michael avatar
ug flag
that's a pretty terrific suggestion, thanks!
Jason Michael avatar
ug flag
But alas, it didn't work. I updated the description above with more details.
shodanshok avatar
ca flag
A bind mount with selinux in permissive mode should almost surely work. Have you tried it? If so, please share libvirt and qemu logs when trying to start your virtual machine.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.