Lxd: Snapshots lost expires after fullcopy

Created on 29 Dec 2020  路  7Comments  路  Source: lxc/lxd

Required information

  • Distribution: Debian 10

    • Kernel version: 5.9.0-0.bpo.2-amd64

    • LXC version: 4.9

    • LXD version: 4.9

    • Storage backend in use: btrfs

Issue description

After copying CT from source to destination with lxc copy --refresh source:lecollectif lecollectif, I can see with lxc info.

source# lxc info lecollectif | grep "Snapshots:" -A 1
Snapshots:
   snap0 (taken at 2020/12/29 02:12 UTC) (expires at 2020/12/30 02:12 UTC) (stateless)
destination# lxc info lecollectif | grep "Snapshots:" -A 1
Snapshots:
   snap0 (taken at 2020/12/29 02:12 UTC) (stateless)

Obviously I can delete manually the snapshot, so no emergency, but it's inconsistent, and if we do not make any attention, we can keep useless old snapshot.

Thanks in advance.

Bug Easy

Most helpful comment

RE the original problem report regarding snapshot expiry being lost, this is occurring even on local instance copies, e.g.

lxc launch images:ubuntu/focal c1 -s zfs
lxc config set c1 snapshots.expiry=1H
lxc snapshot c1
lxc info c1
...
Snapshots:
       snap0 (taken at 2021/01/04 16:00 UTC) (expires at 2021/01/04 17:00 UTC) (stateless)
...
lxc copy c1 c2
lxc info c2
...
Snapshots:
  snap0 (taken at 2021/01/04 16:00 UTC) (stateless)
...

All 7 comments

Should be a pretty easy issue with the serialization work done as part of migration.

Yesterday I encountered a similar problem.

When copying a container to a different server, snapshot device information is lost.

For example, if you have a proxy setup for the container

[my-proxy] => Array
    (
        [connect] => tcp:127.0.0.1:80
        [listen] => tcp:0.0.0.0:80
        [type] => proxy
    )

Then create a snapshot of the container and run

lxc copy c1 server2:c1

On the remote server, the snapshot does not have the proxy device.

Ubuntu 20.04.1 LTS
LXD version: 4.0.4

RE the original problem report regarding snapshot expiry being lost, this is occurring even on local instance copies, e.g.

lxc launch images:ubuntu/focal c1 -s zfs
lxc config set c1 snapshots.expiry=1H
lxc snapshot c1
lxc info c1
...
Snapshots:
       snap0 (taken at 2021/01/04 16:00 UTC) (expires at 2021/01/04 17:00 UTC) (stateless)
...
lxc copy c1 c2
lxc info c2
...
Snapshots:
  snap0 (taken at 2021/01/04 16:00 UTC) (stateless)
...

Reopening for snapshot devices missing on copy.

Confirmed snapshot devices are copied when copying instance locally but not when copying remotely.

Found the issue, PR posted now, was actually an intermittent issue on the source sender based on Go's behaviour of changing the loop pointer variable used for assigning the device name.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iteco picture iteco  路  3Comments

sforteva picture sforteva  路  3Comments

spacekookie picture spacekookie  路  3Comments

chuegel picture chuegel  路  3Comments

jsnjack picture jsnjack  路  3Comments