When stopping a VM from within the guest with shutdown or halt, qemu-kvm just hangs there.

Solution In Progress - Updated -

Issue

  • When stopping a VM from within the guest with shutdown or halt, qemu-kvm just hangs there:
[heat-admin@overcloud-novacompute-0 ~]$ ps aufxg | grep qemu-kvm
heat-ad+   12724  0.0  0.0  12108  1028 pts/1    S+   16:05   0:00              \_ grep --color=auto qemu-kvm
qemu       12386 49.8  2.9 951324 113932 ?       Sl   16:05   0:22  \_ /usr/libexec/qemu-kvm -name guest=instance-00000007,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-instance-00000007/master-key.aes -machine pc-i440fx-rhel7.6.0,accel=kvm,usb=off,dump-guest-core=off -cpu Westmere-IBRS,vme=on,pclmulqdq=on,x2apic=on,tsc-deadline=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,arch-capabilities=on,pdpe1gb=on,skip-l1dfl-vmentry=on -m 256 -overcommit mem-lock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 30cafeb7-f2fd-436f-977c-ec16a21d22bb -smbios type=1,manufacturer=Red Hat,product=OpenStack Compute,version=20.1.2-0.20200401205214.28324e6.el8ost,serial=30cafeb7-f2fd-436f-977c-ec16a21d22bb,uuid=30cafeb7-f2fd-436f-977c-ec16a21d22bb,family=Virtual Machine -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=36,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/dev/sda,format=raw,if=none,id=drive-virtio-disk0,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=on,serial=ca489b7b-7b54-4291-a30d-8df1b5efe68f -netdev tap,fd=38,id=hostnet0,vhost=on,vhostfd=39 -device virtio-net-pci,rx_queue_size=512,host_mtu=1442,netdev=hostnet0,id=net0,mac=fa:16:3e:dc:23:8a,bus=pci.0,addr=0x3 -add-fd set=3,fd=41 -chardev pty,id=charserial0,logfile=/dev/fdset/3,logappend=on -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 172.17.0.152:0 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
  • First we login the guest and run halt from within:
(overcloud) [stack@undercloud-0-rhosp16 cloud]$ ssh -i id_rsa cirros@192.168.122.211
$ sudo -i
# halt
# Connection to 192.168.122.211 closed by remote host.
Connection to 192.168.122.211 closed.
  • Then we login the compute node and list the running processes and you can notice they won't exit:
(overcloud) [stack@undercloud-0-rhosp16 cloud]$ ssh heat-admin@192.0.2.9
This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register

Last login: Tue Jun 15 16:05:41 2021 from 192.0.2.1
[heat-admin@overcloud-novacompute-0 ~]$ ps aufxg | grep qemu-kvm
heat-ad+   12990  0.0  0.0  12108   960 pts/1    S+   16:06   0:00              \_ grep --color=auto qemu-kvm
qemu       12386 34.7  2.9 951324 113932 ?       Sl   16:05   0:24  \_ /usr/libexec/qemu-kvm -name guest=instance-00000007,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-instance-00000007/master-key.aes -machine pc-i440fx-rhel7.6.0,accel=kvm,usb=off,dump-guest-core=off -cpu Westmere-IBRS,vme=on,pclmulqdq=on,x2apic=on,tsc-deadline=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,arch-capabilities=on,pdpe1gb=on,skip-l1dfl-vmentry=on -m 256 -overcommit mem-lock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 30cafeb7-f2fd-436f-977c-ec16a21d22bb -smbios type=1,manufacturer=Red Hat,product=OpenStack Compute,version=20.1.2-0.20200401205214.28324e6.el8ost,serial=30cafeb7-f2fd-436f-977c-ec16a21d22bb,uuid=30cafeb7-f2fd-436f-977c-ec16a21d22bb,family=Virtual Machine -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=36,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/dev/sda,format=raw,if=none,id=drive-virtio-disk0,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=on,serial=ca489b7b-7b54-4291-a30d-8df1b5efe68f -netdev tap,fd=38,id=hostnet0,vhost=on,vhostfd=39 -device virtio-net-pci,rx_queue_size=512,host_mtu=1442,netdev=hostnet0,id=net0,mac=fa:16:3e:dc:23:8a,bus=pci.0,addr=0x3 -add-fd set=3,fd=41 -chardev pty,id=charserial0,logfile=/dev/fdset/3,logappend=on -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 172.17.0.152:0 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on

Environment

  • Red Hat OpenStack Platform 16.1 (RHOSP)
  • Red Hat OpenStack Platform 13.0 (RHOSP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content