libvirt-guest.sh will never sucessfully shutdown more than one virtual machine in my setup

Bug #1591695 reported by Omar Siam
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Unassigned

Bug Description

In function list list_guests() al list of running guests for some uri is produced which now looks like
xen:/// uuid
uuid
uuid

A list like this is processed as if the 2nd uuid etc. are uris. That causes the script to only shut donw one virtual machine

My fix is to make the list look like
xen:/// uuid uuid uuid

Hence the modified /usr/lib/libvirt/libvirt-guests.sh .

Not shutting down the VMs correctly makes my system hang on shutdown which is not tolerable for me.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libvirt-bin 1.3.1-1ubuntu10 [modified: usr/lib/libvirt/libvirt-guests.sh]
ProcVersionSignature: Ubuntu 4.4.0-24.43-generic 4.4.10
Uname: Linux 4.4.0-24-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Sun Jun 12 15:45:16 2016
InstallationDate: Installed on 2015-06-27 (351 days ago)
InstallationMedia: Ubuntu-MATE 15.04 "Vivid Vervet" - Release amd64 (20150422.1)
ProcEnviron:
 LANGUAGE=de_AT:de
 TERM=xterm
 PATH=(custom, no user)
 LANG=de_AT.UTF-8
 SHELL=/bin/bash
SourcePackage: libvirt
UpgradeStatus: Upgraded to xenial on 2016-04-24 (49 days ago)
modified.conffile..etc.default.libvirt-guests: [modified]
modified.conffile..etc.libvirt.qemu.networks.default.xml: [modified]
mtime.conffile..etc.default.libvirt-guests: 2016-06-12T15:34:55.910265
mtime.conffile..etc.libvirt.qemu.networks.default.xml: 2015-12-19T16:43:14.601700

Revision history for this message
Omar Siam (simar-w) wrote :
Revision history for this message
Omar Siam (simar-w) wrote :
Revision history for this message
Omar Siam (simar-w) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "libvirt-guests.sh.in.patch" 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
Launchpad Janitor (janitor) wrote :

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

Changed in libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
Richard (rs-workmail) wrote :

I can confirm that this bug still exists and appears also when libvirt+qemu-kvm is used.

Ubuntu 16.04.1 LTS
libvirt-bin: 1.3.1-1ubuntu10.1
qemu-kvm: 1:2.5+dfsg-5ubuntu10.4

The provided patch fixes this issue.
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1591695/+attachment/4682215/+files/libvirt-guests.sh.in.patch

Revision history for this message
Matt Summers (matt-summers) wrote :

This is affecting me, can confirm that a patch to convert newlines to spaces in list_guests resolves issue.

Ubuntu 16.04.1 LTS
libvirt-bin: 1.3.1-1ubuntu10.1
qemu-kvm: 1:2.5+dfsg-5ubuntu10.2

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Omar Siam (simar-w) wrote :

So I saw my patch is not good enough to be incorporated into the latest bug fix release libvirt (1.3.1-1ubuntu10.2). Perhaps we should have a discussion about it then.
If you ask me you broke my setup with your fix and I would actually like to avoid that in the future.

Best Regards
Omar Siam

Robie Basak (racb)
tags: added: server-next
Revision history for this message
Nish Aravamudan (nacc) wrote :

The patch mentioned in comment 3 has already been applied to libvirt in Yakkety.

Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Nish Aravamudan (nacc) wrote :

Actually, I apologize, the fix in question that is present in 16.04 and 16.10 (confirmed by source examination) is the non-tr content of the patches in this bug.

Changed in libvirt (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Stefan Bader (smb) wrote :

I will have a look at this. It is still morning and I might not be fully awake, yet. But I have a vague feeling as if the proposed patches may work but not be what should be done. IIRC in the past the resulting list was a listing of UUIDs separated by newlines. Otherwise the grep to filter out the UUID for dom0 (the all zero one) makes no sense. Also I am pretty sure the URI for xen:/// should not be in the final list... But as said, I had no time, yet to look into the details.

Revision history for this message
Stefan Bader (smb) wrote :

Ah, ok. The change is correct. Oddly the script handles the list being one UUID per line correctly for all printing out messages cases, just not for creating the actual list which it works on. And that list is supposed to contain the URI (that was confusing me earlier).

Revision history for this message
Omar Siam (simar-w) wrote :

Another patch release 1.3.1-1ubuntu10.3, broke my setup yet again. I would not complain that much but in my combined XEN + ZFS setup this prevents the system from shutting down. It just hangs because the xen block backends obviously don't get released if the VMs don't shut down.
I also have to say that I am worried about the xen:/// discussion. If it's about moving the actual hypervisor URI somwhere else then fine but if you remove xen handling than please state how shutdown should be done using other packages.

Best regards
Omar Siam

Revision history for this message
Stefan Bader (smb) wrote :

While working on the update. it occurred to me that this could be fixed even simpler (avoiding an additional pipe and call to tr). This appears to be working for me locally.

@Omar, are you ok with me referring to you in the patch?

Revision history for this message
Stefan Bader (smb) wrote :

Hi Omar, no its not about removing Xen handling. I just got confused by the URI part in the list because I thought that was the output of the guest list which would only contain the guest UIDs.

Nish Aravamudan (nacc)
Changed in libvirt (Ubuntu):
status: Triaged → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Omar Siam (simar-w) wrote :

Thanks for clarifying this. Of course you can refer to me. Thanks for looking at this.

Nish Aravamudan (nacc)
Changed in libvirt (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
assignee: Nish Aravamudan (nacc) → nobody
Stefan Bader (smb)
Changed in libvirt (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Stefan Bader (smb) wrote :

Committed into our git tree. There is another update of libvirt currently in progress of being released. The fix should be in the ubuntu10.5 release.

Changed in libvirt (Ubuntu Xenial):
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 2.1.0-1ubuntu9

---------------
libvirt (2.1.0-1ubuntu9) yakkety; urgency=medium

  * Fix libvirt-guest.sh to handle multiple guests (LP: #1591695).

 -- Stefan Bader <email address hidden> Thu, 06 Oct 2016 12:14:05 +0200

Changed in libvirt (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Omar, or anyone else affected,

Accepted libvirt into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libvirt/1.3.1-1ubuntu10.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Omar Siam (simar-w) wrote :

libvirt 1.3.1-1ubuntu10.5 works for me.

tags: added: verification-done
removed: verification-needed
Revision history for this message
tionov (christof-deganius) wrote :

Also works for me. My computer does not hang on shutdown any more.

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

This bug was fixed in the package libvirt - 1.3.1-1ubuntu10.5

---------------
libvirt (1.3.1-1ubuntu10.5) xenial; urgency=medium

  * Fix libvirt-guest.sh to handle multiple guests (LP: #1591695).

libvirt (1.3.1-1ubuntu10.4) xenial; urgency=medium

  [ Dann Frazier ]

  * Enable NUMA for arm64 (LP: #1627926).

  [ Stefan Bader ]

  * Update Vcs lines to point to launchpad (LP: #1629210).

 -- Stefan Bader <email address hidden> Thu, 06 Oct 2016 13:07:20 +0200

Changed in libvirt (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for libvirt has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.