Should not stop if there are active clients

Bug #1215617 reported by Dimitri John Ledkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

So there have been a couple of libvirt upgrades.

I start dist-upgrade, while working in a VM.

Suddently virtual-manager disconnects and thows me out of the VM, because libvirt-bin has stopped the service in preinstall.
Then I had to wait for a long time (all other packages install), until postinstall did finally run and start libvirt-bin again.

Ideally, you'd not stop libvirt whilst there are connections open to the libvirt client.
And possibly to reduce down time, can libvirt-bin stop & start during postinstall to minimise down time?

Changed in libvirt (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1215617] [NEW] Should not stop if there are active clients

Is that considered a generally-ok thing to do? It seems like it
could cause severe problems if the libvirt daemon kept running
while configuration bits might be updated by package upgrade. I'm
obviously open to guidance to the contrary.

Note that you can always directly access the VM - I.e. using
vncviewer or spicy by hand. The VM doesn't actually get stopped,
it's only your virt-manager connection to libvirtd which goes
away.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 22 August 2013 22:12, Serge Hallyn <email address hidden> wrote:
> Is that considered a generally-ok thing to do? It seems like it
> could cause severe problems if the libvirt daemon kept running
> while configuration bits might be updated by package upgrade. I'm
> obviously open to guidance to the contrary.
>

Some critical daemons that must not loose connections do that.
E.g. openssh doesn't close connections and in postinstall does a
configuration reload.
But openssh upstream allows for such scenarios.

> Note that you can always directly access the VM - I.e. using
> vncviewer or spicy by hand. The VM doesn't actually get stopped,
> it's only your virt-manager connection to libvirtd which goes
> away.
>

Still annoying, for those of us who do use virt-manager =)
(i work mostly on graphical install in the VM, thus directly on the
live-cd before anything is installed, so virt-manager is actually a
very nice way to flip between cds etc.)

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

If you'd like to file a bug against virt-manager that might be appropriate, but libvirt absolutely should not stay running.

You can connect over vnc/spice and those connections do not go away just bc libvirt stops. So virt-manager should be able to show that it can't show machine details (bc libvit is down) bu tit can still keep up the active graphics connections.

Changed in libvirt (Ubuntu):
status: New → Incomplete
status: Incomplete → Won't Fix
status: Won't Fix → Invalid
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

You can however minimise the downtime:

Currently this happens:

prerm libvirt-bin -> stop libvirt
...
upgrade hundreds of packages
...
postinst libvirt-bin -> start libvirt

However using --restart-after-upgrade option should be feasible:
       -R, --restart-after-upgrade
           Do not stop the init script until after the package upgrade has been completed. This is different than the default behavior, which stops the script in the prerm, and starts it again in the
           postinst.

           This can be useful for daemons that should not have a possibly long downtime during upgrade. But you should make sure that the daemon will not get confused by the package being upgraded
           while it's running before using this option.

That way:
prerm libvirt-bin -> old libvirt continious to run
....
postinst libvirt-bin -> stop; start libvirt-bin (restarted into new libvirt)

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

Thanks, xnox, where should that be specified?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Given it looks like it's using cdbs something like:

DEB_DH_INSTALLINIT_ARGS=--restart-after-upgrade

should work.

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

This bug was fixed in the package libvirt - 1.2.8-0ubuntu20

---------------
libvirt (1.2.8-0ubuntu20) vivid; urgency=medium

  * debian/rules:
    - use --with-esx (LP: #565771)
    - specify restart-after-upgrade (LP: #1215617)
  * debian/control: add libcurl4-gnutls-dev for esx support
 -- Serge Hallyn <email address hidden> Wed, 21 Jan 2015 13:01:59 -0600

Changed in libvirt (Ubuntu):
status: Confirmed → 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.