multipass
multipass copied to clipboard
[daemon] need to kill misbehaving instances on `stop`
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.
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.
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.
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 ultimate hammer is always sudo kill -9
the qemu process.
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.