[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Early ACPI events prevent subsequent ACPI functionality on xen 4.3 + HVM domU



George,

On 21/05/13 17:09, George Dunlap wrote:
On 05/21/2013 04:59 PM, Alex Bligh wrote:
George,

--On 21 May 2013 16:23:00 +0100 George Dunlap
<george.dunlap@xxxxxxxxxxxxx> wrote:

On 05/21/2013 04:16 PM, Alex Bligh wrote:
George,

--On 21 May 2013 14:39:55 +0100 George Dunlap
<George.Dunlap@xxxxxxxxxxxxx> wrote:

So this appears to be an xl toolstack thing.  I managed to reproduce
your results using "xl shutdown -F [domain]"; but if you then do "xl
trigger [domian] power", the domain shuts down as normal.

OK. But doesn't the power thing yank the power rather than send a
clean shutdown?

No -- if you push the button just once on most modern hardware it will
send an ACPI "poweroff" event that the OS handles gracefully. That's
what gets sent when you do "xl trigger [domain] power".  If the OS
ignores it (either on real hardware or virtual hardware) nothing happens. On real hardware you have to then hold down the button for 5 seconds for
a hard-shutdown, with xl you have to do "xl destroy".

OK, great. I am guessing the reason why 'xl shutdown' doesn't do
that is to cope with (a) non-HVM domains, and (b) old fashioned
HVM domains with PV support but not ACPI support. Correct?

We are using libxl here (admittedly having looked carefully at
the xl code for guidance) and get the same problem.

The relevant xl code is here:

     rc=libxl_domain_shutdown(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
             fprintf(stderr, "PV control interface not available:"
                     " sending ACPI power button event.\n");
rc = libxl_send_trigger(ctx, domid, LIBXL_TRIGGER_POWER, 0);
         } else {
             fprintf(stderr, "PV control interface not available:"
                     " external graceful shutdown not possible.\n");
             fprintf(stderr, "Use \"-F\" to fallback to ACPI power
event.\n");
         }
     }

It looks like libxl_domain_shutdown() will only use the PV shutdown
method.  If that method is not available, then it will call
libxl_send_trigger().

OK. Well if that's the case, why is it not working? i.e. how
is using 'xl trigger power' a workaround? As our testing was
on xl (as well as libxl). Perhaps libxl_domain_shutdown
is returning an error other than ERROR_NOPARAVIRT or no error
at all?

xl/libxl is working as designed. xl tried libxl_domain_shutdown() first. libxl saw that there were PV drivers available, so it sent the PV shutdown signal over xenstore and returned success. libxl and xl have no way of knowing that the signal was never received, so it never falls back to ACPI.

"xl trigger power" is a work-around because when you detect that a guest is stuck, you should be able to issue an ACPI shutdown and get a clean shutdown, even when the PV shutdown path is stuck.

(In fact, as a short-term solution, you might consider just replacing "xl shutdown $d" with "xl trigger $d power" in your control framework.)


I am having problems replicating the short-term solution reliably on our end, even with xl/libxl. It seems that issuing an "xl trigger dom power" does not make the domain shutdown, even after a 10 minute wait. Subsequent ones tend to do the same and after issuing quite a few I managed to get the domU to power off.

This happens even if I do not issue the shutdown early in the boot process, but rather issue directly an xl trigger dom power.

Does xl trigger reset do the same thing (i.e. a graceful shutdown)?
If not we'd also (I think) have to recode reboots to do a power trigger
then a restart.

Hmm, this is what I get:

# xl trigger h0 reset
libxl: error: libxl.c:4639:libxl_send_trigger: Send trigger 'reset' failed: Function not implemented

YMMV...

 -George

--
Diana Crisan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.