Description of problem: As summary, invalid shutdown function. Version-Release number of selected component (if applicable): rhel5u3: 2.6.18-128.1.6.el5 kvm-83-27.el5ovirt libvirt-0.6.2-1.el5 How reproducible: Always Steps to Reproduce: 1. define a guest domain from xml to install guest os 2. # virsh start kvmtest 3. # virsh shutdown kvmtest Actual results: Shutdown function is invalid during install. Expected results: The guest domain can be shutdown successfully. Additional info: It is normally shutdown after install finish. No this issue on Xen hypervisor.
Can you provide the XML config from 'virsh dumpxml kvmtest' and the 'dmesg' output from inside the guest OS. Also can you confirm whether 'acpid' process is running in the guest.
The guest was installing status, so I could not get the 'dmesg' info from inside the guest OS, also cannot check the 'acpid' process in the guest. [root@dhcp-66-70-85 ~]# virsh dumpxml kvmtest <domain type='kvm' id='3'> <name>kvmtest</name> <uuid>bb435001-89dd-a091-7c60-0b9f6972482d</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <kernel>/var/lib/libvirt/boot/virtinst-vmlinuz.u9lQYh</kernel> <initrd>/var/lib/libvirt/boot/virtinst-initrd.img.D1_rCu</initrd> <cmdline>method=http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.4-Server-latest/tree-x86_64/ ks=http://10.66.70.202/~nzhang/ks-rhel54.cfg</cmdline> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>destroy</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <source file='/var/lib/libvirt/images/kvmtest.img'/> <target dev='hda' bus='ide'/> </disk> <interface type='network'> <mac address='54:52:00:56:d0:17'/> <source network='default'/> <target dev='vnet0'/> </interface> <serial type='pty'> <source path='/dev/pts/3'/> <target port='0'/> </serial> <console type='pty' tty='/dev/pts/3'> <source path='/dev/pts/3'/> <target port='0'/> </console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='5901' autoport='yes' keymap='en-us'/> <sound model='es1370'/> </devices> </domain> [root@dhcp-66-70-85 ~]# virsh shutdown kvmtest Domain kvmtest is being shutdown [root@dhcp-66-70-85 ~]# virsh list --all Id Name State ---------------------------------- 3 kvmtest running - demo shut off - foo shut off
Once the graphical anaconda stage2 installer appears, you should be able to get a console shell by using Ctrl+Alt+F2 to switch to a alternate virtual terminal. In any case, if the guest is ignoring ACPI shutdown signals during the installer, then there isn't really anything we can do from libvirt. For KVM we send an ACPI shutdown signal, and fact that this works post-install shows the libvirt bit is working. So if we want this fixed, then it needs to be reassigned to ananconda IMHO.
Created attachment 347025 [details] guest dmesg info Yes, I got the 'dmesg' info from the guest.
The dmesg logs show ACPI is enabled, so I can only assume the installer is not dealing with ACPI power button events. Changing component to anaconda
anaconda doesn't do anything with ACPI at all. Can we see a screenshot of the exact error messages? Did this used to work and now has suddenly stopped working? If so, between which versions?
Doesn't work all the while, no extra error messages appears on screen during installer running. BTW, It can works well on Xen, just doesn't work on KVM.
In Xen, the controlled shutdown is triggered directly by the kernel in same way as C-A-D. In KVM guests, the guest receives an ACPI power event, and thus needs acpid running to process this & request init to shutdown. My guess was that the stage2 anaconda process has not launched acpid, hence why i picked anaconda as the BZ component...
Danile: Is there a way to avoid having to have acpid in the installer? Niel: Does this also happen in f{10,11}? Maybe there is something that we can backport.
Neil Zhang: Is this a matter of the installer not automatically rebooting after installation? Or is the issue only when you give the virsh shutdown command? Is `virsh destroy` not an option?
AFAIK, in RHEL-5 acpid is the only thing that deals with these kind of events in userspace. IMHO this bug is reasonably low importance. As you say, you can easily force a power off by using 'virsh destroy' instead of 'virsh shutdown'. Needing a graceful shutdown of the installer is not really critical since its stateless. If RHEL-5 intsaller isn't already running acpid then perhaps its best to just WONTFIX this bug.
We aren't running acpid at all in anaconda, and we never have in RHEL5 as far as I know. I'll leave you guys to close this if you don't feel like it's worth investigating further.
Joel and Daniel: I agree to use 'virsh destroy' instead of 'virsh shutdown', I think this will not affect user experience. So if you think it's the low important issue, it could be closed.