Score:0

Shutdown KVM Guest via rdp

cn flag

We have multiple OpenSuse VMs running on a server via KVM. Our users access the VMs via Guacamole as a xrdp session. If the VMs are in status "shut off" or "pause" a magic packet send from the guacamole Server is triggering a script based service which will "start" or "resume" the specific VM.

The problem now. If my users shutdown their VM, the VM doesn't switch to status "shut off" instead it stays in status "running". The issue is now that the system stalls and does not load the Desktop.

I expected the machine to shutdown to save system resources if the VM is not needed. Shutting down the VM with virsh is working as expected.

Nikita Kipriyanov avatar
za flag
KVM is a kernel machine; what userspace tool you are using to run it (e.g. libvirt, etc.) and how is the VM configured in that tool? It is *possible* configure it so it won't "power off" the VM in the event of shutdown, but it depends on the tool. In libvirt check `<on_poweroff />` setting; your behaviour described as if it is set to `ignore`.
MaKaNu avatar
cn flag
I mostly use `virsh` for controlling and editing the VMs. The `on_poweroff` is set to `destroy`.
Nikita Kipriyanov avatar
za flag
`virsh` is the part of `libvirt` toolset. So strange, and so when your system was shut down what's on the "screen" (enable VNC and see), and what it is doing (does it load CPU, I/O, etc.)?
MaKaNu avatar
cn flag
It seems the VM is started directly again. VNC works as usual and send me to the login screen. This might be the problem with XRDP, since the guacamole connection is not allowed to login to other users. This explains the "stall".
Nikita Kipriyanov avatar
za flag
Can you confirm `qemu` process running the VM is the same (based on the PID and the startup time) or the not? E.g. it *did not stop* at all, or it was stopped (destroyed) and then immediately started back again? If the latter, you might need to find out what starts it back.
MaKaNu avatar
cn flag
The qemu PID for the VM stays the same. So I assume it is not getting destroyed.
Nikita Kipriyanov avatar
za flag
Are you sure it is being put into shutdown in the first place? How exactly you are doing this? Try to give a explicit command `shutdown -h now`, and check if it really shuts the system down.
MaKaNu avatar
cn flag
I used the kde plasma menu to shutdown the VM. Since it kind of similar to my day-2-day system and there doing the same as `shutdown -h now` I thought it would do the same. The Problem our users are not superusers and I needed to call `sudo shutdown -h now`, which worked. I wander what is happening while I use the Plasma Menu.
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.