2

I have Ubuntu 12.04 LTS KVM host with a OpenBSD 5.4 guest.

I am having an issue with virsh shutdown not working / freezing guest.

After calling shutdown, guest freezes and is unresponsive. Any ssh sessions freeze, and any vnc consoles are unresponsive. Nothing in the client logs at time of freeze.

Only resolution is to destroy guest in vish.


The issue appears similar to: http://comments.gmane.org/gmane.os.openbsd.misc/200982


Shutdown From Host

  • From host:

$ sudo virsh list --all ... 15 ssh2 running ...

$ sudo virsh shutdown ssh2 Domain ssh2 is being shutdown

$ sudo virsh list --all ... 15 ssh2 running ...

  • After waiting 5 min, no status change.

Shutdown From Guest

  • Wathcing log during hist shutdown request:

sudo tail -F /var/log/messages

  • No additional values logged as result of shutodwn request.
  • Terminal (ssh) and console (via vnc) both become unresponsive.
  • Terminal (ssh) eventaully errors with Write failed: Broken pipe.

Host Details

  • Host:

$ uname -a Linux kvm2 3.2.0-51-generic #77-Ubuntu SMP Wed Jul 24 20:18:19 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

  • Host kvm version:

$ virsh version Compiled against library: libvir 0.9.8 Using library: libvir 0.9.8 Using API: QEMU 0.9.8 Running hypervisor: QEMU 1.0.0

  • Host kvm dominfo on guest:

$ virsh dominfo ssh2 Id: - Name: ssh2 UUID: 7bb1977e-7268-f40a-32d4-5ae972be7e5f OS Type: hvm State: shut off CPU(s): 2 Max memory: 524288 kB Used memory: 524288 kB Persistent: yes Autostart: disable Managed save: no Security model: apparmor Security DOI: 0

Guest Install Steps

sudo qemu-img create -f qcow2 -o preallocation=metadata /vm/ssh2-disk0.qcow2 2G

  • Run virt-install:

sudo virt-install \ --name ssh2 \ --ram 512 \ --vcpus=1 \ --os-variant=openbsd4 \ --hvm \ --cdrom /vm/install/install54-amd64.iso \ --network bridge:br0,model=virtio \ --graphics vnc \ --disk path=/vm/ssh2-disk0.qcow2,bus=virtio,size=2

  • Note: Used br0 instead of virbr0, as host uses br0.

  • From kvm:

sudo virsh vncdisplay ssh2

  • From desktop:

ssh -L 5910:127.0.0.1:5909 kvm2

  • Connect over vnc to localhost 5910, continue install.

  • Did not install game54.tgz or any x packages:

-game* -x*

2 Answers 2

1

Qemu makes assumptions about ACPI that OpenBSD does not. Over the course of multiple OpenBSD and multiple Qemu/KVM versions, I have found the only way to effectively shut an OpenBSD guest down is with

halt -p

in the guest itself.

4
  • This was the conclusion I was arriving at too. I was looking at the 'echo system_powerdown' to the monitor to see if that worked as expected.
    – Gordo
    Dec 22, 2013 at 17:10
  • There are no assumptions. QEMU simply sends an ACPI shutdown request to the guest. If the guest cannot honour such a request, the command will not work.
    – dyasny
    Dec 22, 2013 at 20:57
  • No, I remember seeing this on openbsd-tech@; it has to do with overwriting ECX (IIRC) when the OpenBSD context is returning. (And now that I say that it it's probably KVM that's making that assumption, given that...)
    – Bandrami
    Dec 22, 2013 at 21:02
  • @Bandrami Only subscribers can read OpenBSD mailing list archives. Can you find this information and summarize it for interested parties? Feb 8, 2014 at 20:59
1

This is a common problem with OpenBSD as a vm when trying to shutdown in KVM.

Solved by:

root@myhost:~# config -ef /bsd
disable mpbios
q
root@myhost:~# reboot
1
  • Thanks, but this was one of the first things I tried.
    – Gordo
    Feb 9, 2014 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.