This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdo

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdown $id --wait does not wait
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Mon, 7 May 2007 16:15:04 -0700
Delivery-date: Mon, 07 May 2007 16:15:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx

           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.

<           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 



Configure bugmail: 
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Xen-bugs mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdown $id --wait does not wait, bugzilla-daemon <=