Bug 439970 - Unclear how to power off guest
Unclear how to power off guest
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: virt-manager (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
:
: 441236 443980 444989 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-01 01:23 EDT by Andrew Bartlett
Modified: 2009-01-05 18:50 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-21 03:27:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
libvirt config file for machine that won't power off (860 bytes, text/xml)
2008-04-01 21:47 EDT, Andrew Bartlett
no flags Details
Logfile for above libvirt xml description (3.97 KB, text/plain)
2008-04-01 22:02 EDT, Andrew Bartlett
no flags Details

  None (edit)
Description Andrew Bartlett 2008-04-01 01:23:21 EDT
Description of problem:
Using virt-manager (but assigned to KVM because it appears only on KVM upgrade)

Pressing stop (either on the per-VM console or the Virtual Machine Manager
console) will not stop VMs

Version-Release number of selected component (if applicable):
virt-manager-0.5.4-2.fc9.i386
libvirt-0.4.1-6.fc9.i386
kvm-64-2.fc9.i386

How reproducible:
Every time

Steps to Reproduce:
1. Start a Virtual Machine in Virt Manager
2. Press the 'stop' button or
3. Right-click on the entry and select stop
  
Actual results:
VM still running

Expected results:
VM Halted

Additional info:
Also appears on Fedora 8 with rawhide kvm on standard libvirt/virt manager
Comment 1 Daniel Berrange 2008-04-01 10:04:58 EDT
libvirt will do a graceful shutdown of KVM guests by triggering a virtual ACPI
button press. This requires ACPI be enabled for the VM, and inside the OS.

So we can check, please provide the XML config for your VM from
/etc/libvirt/qemu/[NAME].xml

And the logfile from /var/log/libvirt/qemu/[NAME].xml

Comment 2 Andrew Bartlett 2008-04-01 21:47:02 EDT
Created attachment 300000 [details]
libvirt config file for machine that won't power off

These virtual machines were at various stages of a failed boot, or did not have
ACPI enabled.  

Eg the attached VM does not have a valid disk at the moment, so sits in a 100%
cpu loop at the bios.
Comment 3 Andrew Bartlett 2008-04-01 22:02:39 EDT
Created attachment 300004 [details]
Logfile for above libvirt xml description
Comment 4 Daniel Berrange 2008-04-02 00:11:21 EDT
Ok, so the XML config shows that ACPI is enabled. If the guest is crashed / hung
/ failed to boot, then it is unlikely it will respond to ACPI button press
events used to trigger a shutdown. There isn't really much we can do about that,
so I'm inclined to close this NOTABUG unless the problem also occurs with a
guest that is running 'normally'

As a failsafe, in the virt-manager UI you should also be able to trigger a
'destroy' operation from the File menu of the guest console window. This is akin
to physically pulling the power plug out of the machine. Alternatively from the
command line you can do 'virsh destroy GUEST-NAME'.  
Comment 5 Andrew Bartlett 2008-04-02 06:51:28 EDT
Well, it also happens for guests where ACPI was enabled in the guest VM setup,
but disabled in the guest (as was suggested by some authorities, by pressing F5
at the right point, for Windows better/acceptable WinXP VM performance).  

I had always assumed destroy would physically destroy the disk image, or some
such.  

Perhaps if the power button is pressed twice, it should ask if you wish to hard
power off?  
Comment 6 Jan Hutař 2008-04-03 03:07:18 EDT
Hello,
I see this on F8 as well, even for virtual systems where I know shutdown worked 
before.

kernel-2.6.24.3-50.fc8.x86_64
libvirt-0.4.1-2.fc8.x86_64
virt-manager-0.5.3-2.fc8.x86_64
Comment 7 Cole Robinson 2008-04-16 11:17:28 EDT
*** Bug 441236 has been marked as a duplicate of this bug. ***
Comment 8 Cole Robinson 2008-04-16 12:56:32 EDT
Comment #6,

This previously worked, but it wasn't actually "shutting down" the machine, it
was effectively ripping the plug from the wall. Previously kvm did not have any
way to perform a graceful ACPI shutdown, so libvirt implemented the shutdown
command to be the same as destroy. That is probably why it previously appeared
to work. Can you ensure that you have kvm-60 or later installed?
Comment 9 Adam Huffman 2008-04-18 09:00:21 EDT
I have kvm-60-3.fc8.x86_64 and this problem is still there.
Comment 10 Jan Hutař 2008-04-21 04:08:05 EDT
Hello Cole,
I have these packages installed:

kvm-60-3.fc8.x86_64
qemu-0.9.0-7.fc8.x86_64

I have just noticed that this happens when I destroy the system:

$ virt-manager --no-fork
libvir: Domain error : invalid domain pointer in virDomainGetID
libvir: Domain error : invalid domain pointer in virDomainGetName
libvir: Domain error : invalid domain pointer in virDomainGetID

I'll be glad to do some testing.
Comment 11 Daniel Berrange 2008-04-21 22:16:52 EDT
Ok, so the problem is that although virt-manager enabled ACPI, and KVM enabled
ACPI, the Linux  guest kernel decided to disable ACPI, as can be seen from this
dmesg log I get:

  DMI not present or invalid.
  Using APIC driver default
  ACPI: Disabling ACPI support


From what I can tell, the problem  is that there is no DMI BIOS data, and thus
the kernel assumes its a buggy BIOS and disables ACPI.

If you pass  'acpi=force' on the guest kernel command line, then the
virt-manager/libvirt graceful shutdown will work correctly.

The core problem though is that KVM needs to supply DMI BIOS data so Linux
automagically enables ACPI
Comment 12 Jens Petersen 2008-04-23 21:58:48 EDT
So reassign to kvm?
Comment 13 Dominik Sandjaja 2008-04-24 07:32:11 EDT
Well, I can't even shutdown a machine which didn't boot at all, meaning:
- start virt-manager
- create new vm, e.g. with freebsd, choose qemu or kvm, doesn't matter
- start the vm
- cancel the setup routine. The cd-image will be unmounted from the vm
- start the vm again, obviously no install media is found
- not possible to shut down the vm or send any keys via the "Send key" menu

Package versions on my machine:
libvirt-0.4.2-1.fc9.i386
virt-manager-0.5.4-3.fc9.i386
kvm-65-1.fc9.i386
qemu-0.9.1-5.fc9.i386
Comment 14 Daniel Berrange 2008-04-24 07:54:31 EDT
Use the 'Destroy' menu to forcably poweroff a machine which isn't responding.
'Shutdown' is only for doing a graceful controlled shutdown in cooperation with
the guest OS. If the guest OS is dead,then a Destroy is needed
Comment 15 Andrew Bartlett 2008-04-24 08:14:20 EDT
Then the bug needs to be re-addressed as:

It is unclear how to power of a guest that is unwilling or unable to answer ACPI
events.  The shutdown button shows no user interaction, nor is there any
indication that 'destroy' means 'power off' (not say, destory my VM data).

It is also just hard to find 'Destory'.  It should appear on the toolbar,
perhaps after the user unsuccessfully presses the shut down button. 
Comment 16 Daniel Berrange 2008-04-24 10:32:01 EDT
*** Bug 443980 has been marked as a duplicate of this bug. ***
Comment 17 Martin Jürgens 2008-04-24 10:45:55 EDT
> It is also just hard to find 'Destory'.  It should appear on the toolbar,
perhaps after the user unsuccessfully presses the shut down button. 

Definitely. The funny thing is, I use the German localized version and they
translate Destroy with Delete which is even more confusing.
Comment 18 Cole Robinson 2008-04-24 10:56:29 EDT
(In reply to comment #17)
> Definitely. The funny thing is, I use the German localized version and they
> translate Destroy with Delete which is even more confusing.

Wow! Yeah that clearly means we need to reword it. I know Dan has some patches
pending that clear this up by renaming it 'Force Poweroff' or similar. Placing
it on the toolbar as a button is probably not a good idea though given the
dangerous nature of the command. The fact is, graceful shutdown _should_ work
for all supported guests, and we shouldn't design the ui around a bug in kvm.

This bug should be moved back to the kvm issue layed out in Comment #11 though,
and someone should open a seperate bug for the 'destroy' wording, otherwise the
first 10 comments are useless.
Comment 19 Andrew Bartlett 2008-04-24 11:23:31 EDT
Well, why KVM guest don't respond is a matter of guest OS and KVM bugs, but in
my case I had created situations where ACPI power off was not sufficient, and
these situations were even when ACPI worked perfectly in KVM.  ACPI not being
advertised properly for guests is indeed a separate issue.

In terms of UI, I don't see the toolbar as unsafe, if it pops up a dialog with a
warning such as 'confirm forced power off of guest? power off/cancel'
Comment 20 Daniel Berrange 2008-04-24 11:30:41 EDT
Even when KVM is working perfectly there is no guarentee whatsoever  that
'Shutdown' will actually shutdown. The semantics of shutdown are that it is a
request to the guest OS to shut itself down cleanly. The guest is under no
obligation to honor this request, and in this circumstance, 'destroy' must be
used to hard poweroff. As Cole mentions the next virt-manager release will have
a  toolbar option to choose between Shutdown, Reboot and Force poweroff.
Comment 21 David Juran 2008-05-05 04:48:49 EDT
*** Bug 444989 has been marked as a duplicate of this bug. ***
Comment 22 Cole Robinson 2008-05-08 10:58:16 EDT
Dan added some large UI work upstream which combines the 'Console' and 'Details'
view into the same tabbed window. Along with these changes, the 'Destroy' option
was renamed 'Force Poweroff' (hopefully a bit more clear). I'll put this bug in
POST.
Comment 23 Bug Zapper 2008-05-14 04:30:08 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 24 Fedora Update System 2008-12-01 13:10:25 EST
virt-manager-0.6.0-0.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/virt-manager-0.6.0-0.fc9
Comment 25 Fedora Update System 2008-12-01 13:22:59 EST
virt-manager-0.6.0-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/virt-manager-0.6.0-1.fc9
Comment 26 Fedora Update System 2008-12-02 20:29:49 EST
virt-manager-0.6.0-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update virt-manager'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-10705
Comment 27 Fedora Update System 2008-12-21 03:26:51 EST
virt-manager-0.6.0-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 28 Andrew Bartlett 2009-01-05 18:50:50 EST
The new design (and menu for different power off options) is much better!

Note You need to log in before you can comment on or make changes to this bug.