[Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdo
Summary: xendomains causes unclean shutdown - xm shutdown $id --
wait does not wait
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
------- 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]
||[Next in Thread>|
- [Xen-bugs] [Bug 977] New: xendomains causes unclean shutdown - xm shutdown $id --wait does not wait,