Am Donnerstag, 12. August 2021, 16:15:29 CEST schrieben Sie:
> Hello Helmut and thanks for this bug report. From my testing libvirt VMs
> do not automatically get registered to machined (they are not listed by
> `systemctl list-machines`),

Hello, Paride,

please try machinectl...

$ systemctl list-machines 
  NAME        STATE   FAILED JOBS
  news (host) running 0      0   

1 machines listed.

$ machinectl
MACHINE       CLASS SERVICE      OS VERSION ADDRESSES
qemu-2-wxtest vm    libvirt-qemu -  -       -        
qemu-3-win10  vm    libvirt-qemu -  -       -        
qemu-4-mfs1   vm    libvirt-qemu -  -       -        

3 machines listed.


> and indeed machined, not "owning" then,

I didnt register any of these VMs on any part of systemd, so i was wondering 
about the kills.

You can try the following:
Start VM with libvirt (virsh, virt-manager, ...)
run:
systemctl stop systemd-machined
Last command will kill the VM.

After modifying the dependency it works (on shutdown) like expected, first 
libvirt-guest.sh trys to shutdown the VM, if that fails, systemd-machined 
kills the process:

... libvirt-guests.sh[319541]: Starting shutdown on guest: win10
... libvirt-guests.sh[319543]: Domain 1e2a598c-2135-4c27-884c-662ff61be44b is 
being shutdown
... libvirt-guests.sh[319576]: Domain 1e2a598c-2135-4c27-884c-662ff61be44b is 
being shutdown
... libvirt-guests.sh[318964]: Waiting for guest win10 to shut down, 120 
seconds left
... libvirtd[3550]: internal error: End of file from qemu monitor
... systemd[1]: Stopped Virtual Machine qemu-1-win10.
... libvirt-guests.sh[319896]: Shutdown of guest win10 complete.


You can also find the following in journal after: virsh start win10:
... systemd-machined[2836]: New machine qemu-1-win10.
... systemd[1]: Started Virtual Machine qemu-1-win10.

> doesn't seem to touch them at shutdown.

It does...

> To better understand your issue here and verify this is actually a bug
> in Ubuntu and not a local configuration issue we need more details on
> how you start the affected VMs. Could you please provide a minimal set
> of steps to reproduce the issue from a clean Ubuntu system?

It is a fresh install of Ubuntu 20.04.2 LTS with HWE Stack, only added qemu/
libvirt and ZFS from original Ubuntu-sources. (It is my first Ubuntu, i am 
still learnig... Ubuntu, not Linux:-))
 
> I can't exclude that libvirt doesn't play well with machined in some
> cases, but should this behavior given by how libvirt behaves and not by
> how it's distributed in Ubuntu then my suggestion here is to file a bug
> upstream:

I think, it is the interaction between libvirt and systemd-machined. In the 
machined-manpage you can find, that libvirt-vms are partially managed, i did 
not find, how to start them by machined, and stop only kills the qemu-process, 
no acpi-shutdown or similar possible, so it seems, machined is work in 
progress... So the simplest way to solve this without deactivation of machined 
was adding the dependency.

Hope it helps, fiddeling shutdown-problems with systemd is crazy enough, i 
needed many hours, before i realized, that machined plays also this game..

>   https://gitlab.com/libvirt/libvirt/-/issues
> 
> Waiting for your reply here I'm marking this bug report as Incomplete.
> 
> ** Changed in: libvirt (Ubuntu)
>        Status: New => Incomplete


-- 
Mit freundlichen Grüßen

Helmut Adams

------------------------------------
5 von 6 Wissenschaftlern haben festgestellt:

Russisches Roulette ist harmlos.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1939577

Title:
  Missing dependency in libvirt-guests.service leads sometimes to killed
  VMs on host shutdown

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1939577/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to