lxc-snapshot destroys container

Bug #1354375 reported by Dan McGrath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
High
Unassigned
Trusty
Fix Released
High
Unassigned

Bug Description

Was following instructions for lxc-snapshots at:

  https://help.ubuntu.com/lts/serverguide/lxc.html

The problem I am reporting is that when I create a snapshot with:

  lxc-snapshot -n c1

which creates snap0 (snap1...snapN, etc.), after I try restore the snapshot with:

  lxc-snapshot -r snap0 -n c1

lxc seems to happily remove snap0 and c1, thus destroying the entire container. I would paste the output, but it was via a vbox vm and wasn't easy to copy/paste the text, so I have attached a screenshot instead.

The release was 14.0.4.1 LTS with lxc 1.0.5-0ubuntu0.1. What I expected was for the snapshot to first remove c1 and then rename snap0 to c1. Seeing as how the c1 container was a LVM snapshot I can see that removing c1 (the origin of snap0) might be the reason for it killing snap0 and c1, but it seems a little unpexted, especially if this had been more than a test.

Is this a real bug?

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: lxc 1.0.5-0ubuntu0.1
ProcVersionSignature: Ubuntu 3.13.0-32.57-generic 3.13.11.4
Uname: Linux 3.13.0-32-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
Date: Fri Aug 8 05:58:41 2014
InstallationDate: Installed on 2014-08-07 (0 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
ProcEnviron:
 LANGUAGE=en_CA:en
 TERM=linux
 PATH=(custom, no user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
 lxc.network.type = veth
 lxc.network.link = lxcbr0
 lxc.network.flags = up
 lxc.network.hwaddr = 00:16:3e:xx:xx:xx

Revision history for this message
Dan McGrath (troubled) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1354375] [NEW] lxc-snapshot destroys container

Thanks for reporting this bug. I'm afraid snapshotting is currently not
compatible with LVM. In the short term we should simply refuse snapshots
for lvm-backed containers. In the longer term, we'll need the lvm backing
store to provide a different naming scheme for snapshots, and its own
snapshot restoration algorithm.

 status: confirmed
 importance: high

Changed in lxc (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The safety workaround (refusing lxc-snapshot of lvm-backed containers) is committed in git.

Changed in lxc (Ubuntu):
status: Confirmed → Fix Committed
Changed in lxc (Ubuntu Trusty):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 1.1.0~alpha2-0ubuntu2

---------------
lxc (1.1.0~alpha2-0ubuntu2) utopic; urgency=medium

  * Cherry-pick usptream bugfix for lxc-usernic test.
 -- Stephane Graber <email address hidden> Thu, 02 Oct 2014 15:01:56 -0400

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