default network autostart symlink recreated

Bug #372001 reported by Jamin W. Collins
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Low
Unassigned
Lucid
Fix Released
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned
Natty
Won't Fix
Undecided
Unassigned
Oneiric
Fix Released
Undecided
Unassigned

Bug Description

===================================================
SRU Justification:
1. Impact: if admins disable the example default network, then each libvirt upgrade re-enables it
2. Development fix: use a patch in debian to not install the default network auto-run symlink, and tweak postinst to create it (only) on a first install.
3. Stable fix: same as development fix
4. Test case:
 a. sudo apt-get install libvirt-bin
 b. sudo rm /etc/libvirt/qemu/network/defaults/autostart.xml
 c. sudo apt-get install --reinstall libvirt-bin
 d. ls -l /etc/libvirt/qemu/network/defaults/autostart.xml
   After reinstall, autostart should not exist.
5. Regression Potential: a mistake in the postinst script could cause installations and upgrades to fail.
===================================================
Periodically the autostart symlink for libvirt-bin's default network is recreated. This is not expected or desired behavior. I've manually removed the symlink repeatedly as I've created my own network definitions that I'd prefer were started instead.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia ath_hal
Package: libvirt-bin 0.6.1-0ubuntu6
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: libvirt
Uname: Linux 2.6.28-11-generic x86_64
UnreportableReason: This is not a genuine Ubuntu package

Revision history for this message
Jamin W. Collins (jcollins) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:
1. Is this reproducible?
2. If so, what specific steps should we take to recreate this bug? Be as detailed as possible.
This will help us to find and resolve the problem.

Changed in libvirt (Ubuntu):
status: New → Incomplete
Chuck Short (zulcss)
Changed in libvirt (Ubuntu):
importance: Undecided → Low
Revision history for this message
Jamin W. Collins (jcollins) wrote :

Steps to reproduce:

Create additional network definitions. I have the following (all set to start on boot):
- public_1, 192.168.51.0/24, 192.168.51.128, 192.168.51.254, w/NAT
- private_1, 192.168.61.0/24, 192.168.61.128, 192.168.61.254, isolated
- private_2, 192.168.62.0/24, 192.168.62.128, 192.168.62.254, isolated

Disable the default network definition (uncheck Autostart and Apply).

Verify that the symlink for starting the default network definition is no longer present:

ls -l /etc/libvirt/qemu/networks/autostart/

Install, or reinstall, the libvirt-bin package or any update to the package. The symlink for the default network autostart is restored.

Chuck Short (zulcss)
Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Jamin, is the network recreated if you undefine the default network with:
$ virsh net-destroy default
$ virsh net-undefine default

Changed in libvirt (Ubuntu):
assignee: nobody → Jamie Strandboge (jdstrand)
status: Confirmed → Incomplete
Revision history for this message
Jamin W. Collins (jcollins) wrote :

I don't want them undefined or removed, only not set to auto start.

Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
Changed in libvirt (Ubuntu):
assignee: Jamie Strandboge (jdstrand) → nobody
Revision history for this message
Alvin (alvind) wrote :

Every time you create a virtual machine, using virt-manager, it will be started again. Maybe that's the case here?

Revision history for this message
Adam Conrad (adconrad) wrote :

This is happening because the package is shipping the symlink as a conffile. Generally speaking, this isn't a great idea, and dpkg's handling of symlink-as-conffile cases is shockingly non-obvious.

Like most packages with symlink trees in /etc, what this should be doing is not shipping the symlink as a file, but rather creating it in the postinst on new installs (and only new installs), so a sysadming choosing to remove the symlink won't have to worry about it coming back spontaneously.

Revision history for this message
Simon Déziel (sdeziel) wrote :

I am also annoyed by that behaviour after every update of the package. Adam's analysis in comment #7 is right and I think its suggestion should be implemented.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks Simon and Adam, what you suggest sounds reasonable.

Do you mind raising this as a bug against the debian package? (If you do, I'll go ahead and do it).

Changed in libvirt (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Simon Déziel (sdeziel) wrote :

Serge, you seem to have addressed this in Precise (http://changelogs.ubuntu.com/changelogs/pool/main/libv/libvirt/libvirt_0.9.7-2ubuntu2/changelog). Would that be possible to do a SRU for Lucid ? I'd like to test your fix on Precise but I lack a test setup ATM.

Thanks for addressing this anyways.

Changed in libvirt (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Simon Déziel (sdeziel) wrote :

Oops, I misread the fix that in fact no longer apply the patch.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Simon,

do you think we should be applying debian/Don-t-enable-default-network-on-boot.patch?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ah, I see. Enabling only that patch breaks automatic net setup on new installs. So to fix this bug, we should enable that patch and fix postinst to create the symlink on new install.

Changed in libvirt (Ubuntu):
status: Fix Committed → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I do think that fix should be SRU-able, but I want to do a whole lot of testing of new installs and upgrades before committing that fix.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Here is the debdiff I"m proposing to fix this bug. It tests fine for me - new installs get the default network autostart symlink, upgrades do not.

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

This bug was fixed in the package libvirt - 0.9.7-2ubuntu3

---------------
libvirt (0.9.7-2ubuntu3) precise; urgency=low

  * Don't override local removal of default network autostart on upgrades
    (LP: #372001)
    - re-enable debian/Don-t-enable-default-network-on-boot.patch
    - debian/libvirt-bin.postinst: create default network autostart symlink
      for new installs only.
 -- Serge Hallyn <email address hidden> Thu, 01 Dec 2011 21:55:01 +0000

Changed in libvirt (Ubuntu):
status: Triaged → Fix Released
description: updated
Changed in libvirt (Ubuntu Maverick):
status: New → Won't Fix
Changed in libvirt (Ubuntu Natty):
status: New → Won't Fix
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

My postinst patch was bad. I will re-upload a proper fix after it gets more testing in precise.

Revision history for this message
Simon Déziel (sdeziel) wrote :

Serge, sorry for the late reply, I forgot to subscribe. I'll be available to test both upgrade and fresh install behaviour of your patch when it will be ready.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Simon,

thanks. As everyone (including SRU team) will likely be out for a good chunk of the rest of the month, do you mind if we wait until early january to do it?

I'm fine either way, but would prefer this not to slip through the cracks or get out of sync on account of the holidays.

Revision history for this message
Simon Déziel (sdeziel) wrote :

Works for me as the problem only manifests when updating libvirt and if the SRU team will be out for holidays there shouldn't be any update causing the default network to "re-appear".

Revision history for this message
Simon Déziel (sdeziel) wrote :

@Serge, whenever you are ready for this I'll be available to test, thanks.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks Simon, I want to do extensive testing myself first (since I messed up the first time), but will aim to get this uploaded today. Hopefully it will hit the archive tomorrow.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Jamin, or anyone else affected,

Accepted libvirt into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in libvirt (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Simon Déziel (sdeziel) wrote :

libvirt version 0.9.2-4ubuntu15.2 fixes the issue on Oneiric. Many thanks.

tags: added: verification-done-oneiric
removed: verification-needed
tags: added: verification-done
removed: verification-done-oneiric
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.9.2-4ubuntu15.2

---------------
libvirt (0.9.2-4ubuntu15.2) oneiric-proposed; urgency=low

  * Don't override local removal of default network autostart on upgrades
      (LP: #372001)
    - re-enable debian/Don-t-enable-default-network-on-boot.patch
    - debian/libvirt-bin.preinst: note if the symlink exists
    - debian/libvirt-bin.postinst: if symlink existed, OR if we are upgrading
      from one of the broken versions, then recreate the symlink. (Continue
      to create the symlink on new installs.)
 -- Serge Hallyn <email address hidden> Mon, 23 Jan 2012 11:12:51 -0600

Changed in libvirt (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hello Jamin, or anyone else affected,

Accepted libvirt into lucid-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in libvirt (Ubuntu Lucid):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Revision history for this message
Simon Déziel (sdeziel) wrote :

libvirt version 0.7.5-5ubuntu27.22 fixes the issue on Lucid. Many thanks.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.7.5-5ubuntu27.22

---------------
libvirt (0.7.5-5ubuntu27.22) lucid-proposed; urgency=low

  * Don't override local removal of default network autostart on upgrades
      (LP: #372001)
    - re-enable debian/Don-t-enable-default-network-on-boot.patch
    - debian/libvirt-bin.preinst: note if the symlink exists
    - debian/libvirt-bin.postinst: if symlink existed, OR if we are upgrading
      from one of the broken versions, then recreate the symlink. (Continue
      to create the symlink on new installs.)
 -- Serge Hallyn <email address hidden> Mon, 23 Jan 2012 10:15:56 -0600

Changed in libvirt (Ubuntu Lucid):
status: Fix Committed → Fix Released
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.