multipass icon indicating copy to clipboard operation
multipass copied to clipboard

[daemon] need to kill misbehaving instances on `stop`

Open Saviq opened this issue 5 years ago • 5 comments

When an instance doesn't stop, a multipass stop command happily exits, when the instance actually continues to run.

We need to apply a timeout, after which we let the user know that the instance didn't stop, and maybe add a --force option to multipass stop so that it gets killed instead after the timeout.

This is at least the case on QEMU.

Saviq avatar Nov 05 '19 09:11 Saviq

This is easily reproduced by issuing halt inside a running instance. halt only takes the OS down to runlevel 0, but does not issue an ACPI poweroff. This causes the hypervisor to continue to run. It's actually no different than issuing a halt on a machine itself where the machine will not poweroff.

townsend2010 avatar Nov 08 '19 14:11 townsend2010

I will say too, that this can lead to the daemon being in a bad state since it thinks the instance is running and has a valid IP address where in fact, the instance is not really running.

townsend2010 avatar Nov 08 '19 14:11 townsend2010

Is there a workaround to kill an instance in this state?

[Edit] I killed qemu and that at least allowed me to start Multipass and the instance again.

jbosse avatar Feb 16 '22 03:02 jbosse

@jbosse ultimate hammer is always sudo kill -9 the qemu process.

Saviq avatar Feb 16 '22 08:02 Saviq

This particularly needs fixing now that instance modification is possible and it's possible to overcommit resources to an instance, making it unbootable yet unstoppable.

townsend2010 avatar Jul 01 '22 14:07 townsend2010