Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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*

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '13 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 '13 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 '13 at 21:02
    
@Bandrami Only subscribers can read OpenBSD mailing list archives. Can you find this information and summarize it for interested parties? –  Michael Hampton Feb 8 at 20:59

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
share|improve this answer
    
Thanks, but this was one of the first things I tried. –  Gordo Feb 9 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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