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

[Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdown $id --wait does not wait



http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=977

           Summary: xendomains causes unclean shutdown - xm shutdown $id --
                    wait does not wait
           Product: Xen
           Version: 3.0.4
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Tools
        AssignedTo: xen-bugs@xxxxxxxxxxxxxxxxxxx
        ReportedBy: vladimir.mencl@xxxxxxxxxxxxxxxx


In my setup (on CentOS x86 Linux), machines were reporting unclean shutdown
after being shut down with xendomains.

After looking inside xendomains, I realized that it's because

  xm shutdown $id --halt --wait

does not honor the --wait option and returns immediately.  After sending
shutdown to all virtual machines, xendomains proceeds to

xm shutdown --all --halt --wait

which sends a second shutdown command to each virtual machine that has not
completed shutdown yet.  The linux kernel responds by immediately powering the
machine down, without unmounting the filesystem.  I have been able to
workaround this issue by fixing xendomains calls to xm shutdown to use domain
names instead of numeric ids.  This way, waiting works as expected.

373c373
<           xm shutdown $id $XENDOMAINS_SHUTDOWN
---
>           xm shutdown $name $XENDOMAINS_SHUTDOWN


The problem itself is caused in
/usr/lib/python/xen/xm/shutdown.py#wait_shutdown:74, where the check whether a
domain is still alive is done with

 if d in alive

As a numeric Id is never in (names of) alive domains, the wait_shutdown
function returns immediately.  A proper fix should implement a mapping of
domain Ids to Names to see whether a domain has already shut down even when its
identified by a numeric id.

I have documented this project, together with other ("cosmetic") fixes in the
xendomains script at 

http://www.bestgrid.org/index.php/Vladimir:Setup_XenHost#Xendomains

Cheers,
Vladimir


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Xen-bugs mailing list
Xen-bugs@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs


 


Rackspace

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