ppggff / vagrant-qemu

Use Vagrant to manage machines using QEMU. Test with Apple Silicon / M1 and CentOS aarch64 image
MIT License
431 stars 35 forks source link

qemu processes still running after "vagrant destroy" #35

Open jayunit100 opened 1 year ago

jayunit100 commented 1 year ago

I notice that after running vagrant destroy --force i still often have some QEMU processes running.

for example, running vagrant destroy --force on a 2 node cluster (1 windows, 1 linux)... i see the linux node is still running.

==> winw1: Stopping the instance...
==> winw1: Destroying the instance...
==> controlplane: Stopping the instance...
==> controlplane: Destroying the instance...

And then checking , theres still a qemu-system process...

➜  sig-windows-dev-tools git:(master-qemu) ✗ ps -ax | grep qemu
30074 ??       333:11.26 /opt/homebrew/bin/qemu-system-x86_64 -machine q35 -cpu qemu64 -smp 2 -m 4096 -device virtio-net-pci,netdev=net0 -netdev user,id=net0,hostfwd=tcp::50022-:22,net=10.20.30.0/24,dhcpstart=10.20.30.10 -drive if=virtio,format=qcow2,file=/Users/jayunit100/SOURCE/sig-windows-dev-tools/.vagrant/machines/controlplane/qemu/jVYrVcYN1nw/linked-box.img -chardev socket,id=mon0,path=/Users/jayunit100/.vagrant.d/tmp/vagrant-qemu/jVYrVcYN1nw/qemu_socket,server=on,wait=off -mon chardev=mon0,mode=readline -chardev socket,id=ser0,path=/Users/jayunit100/.vagrant.d/tmp/vagrant-qemu/jVYrVcYN1nw/qemu_socket_serial,server=on,wait=off -serial chardev:ser0 -pidfile /Users/jayunit100/SOURCE/sig-windows-dev-tools/.vagrant/machines/controlplane/qemu/jVYrVcYN1nw/qemu.pid -parallel null -monitor none -display none -vga none -daemonize
ppggff commented 1 year ago

Currently the VM is ended by sending a shutdown signal to qemu. This may have some delay or may also fail. If it still doesn't work after some time, you need to manually kill the residual processes for now.

Later I will put the 'wait-kill' logic to the plugin.