xendomains can't stop any domU with xl toolstack

Bug #1178625 reported by WATANABE Wataru
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
xen (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

release of Ubuntu : 13.04
package : xen-utils-common 4.2.1-0ubuntu3.1

With xl toolstack, 'xendomains' upstart script cannot stop any domains.
This is because 'xen-init-list', which is script used by xendomains, cannot handle with the output of xl command.

Code in /etc/init.d/xendomains for stopping domU.
---------------------------------------
do_stop_shutdown()
{
  while read id name rest; do
    log_action_begin_msg "Shutting down Xen domain $name ($id)"
    xen shutdown $id 2>&1 1>/dev/null
    log_action_end_msg $?
  done < <(/usr/lib/xen-common/bin/xen-init-list)
---------------------------------------

With xm/xend toolstack, /usr/lib/xen-common/bin/xen-init-list returns domains-list :
---------------------------------------
$ xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 4096 2 r----- 18.5
web 2 8192 1 --p--- 0.0

$ /usr/lib/xen-common/bin/xen-init-list
2 web
---------------------------------------

With xl toolstack, it returns nothing :
---------------------------------------
$ xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 4096 2 r----- 419.3
web 1 8187 1 ------ 1.0

$ /usr/lib/xen-common/bin/xen-init-list

---------------------------------------

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xen (Ubuntu):
status: New → Confirmed
Revision history for this message
Tom Hendrikx (whyscream) wrote :

There are more issues with the xendomains init script:
- starting domains complains: '/etc/init.d/xendomains: line 128: domains: bad array subscript' (but domains get started)
- directory /var/run/xen is missing after reboots

First issue is due to the fact that check_config_name() returns an empty string
Second issue is related to pygrub needing the /var/run/xen directory, so this might actually be an issue with /etc/init.d/xen init script in stead.

Attached is a patch that fixes all three issues for me, and a minor addition regarding issuing 'xen destroy' when 'xen shutdown' fails. I wasn't too happy fixing the python dict parsing, so I took a few shortcuts here and there, but the idea should be clear.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch for /etc/init.d/xendomains" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Tom Fanning (tfanning) wrote :

Tom Hendrikx' patch applies cleanly to an up-to-date 14.04 and appears to fix the bugs with "xl" for me too. Thanks Tom.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.