Feature lxc copy --snapshots-only?

(Kees Bos) #1

For lxc copy there’s a option --container-only.

It would be nice to have a --snapshots-only too. That would probably also prevent the freezing of a container for a long time when the storage used is massive.

I’m not sure if it’s possible at al.

(Thomas Hipp) #2

I don’t understand why this should make sense. Also, snapshots are tied to containers so --snapshots-only doesn’t make much sense.

If you want to copy snapshots, you can use lxc copy c1/snap0 c2. Does this help?

(Kees Bos) #3

I’ve tried to use lxc copy --refresh to create a backup of the container on a remote server. Apart from having troubles with hanging rsync, I also noticed that the container freezes for some time during this copy. If the underlying filesystem is large, this may take quite some time.


  • I’m interested in a remote backup of the container, which may be only the last snapshot.
  • I’d like to have no downtime (i.e. no freezing of container).

(Stéphane Graber) #4

Okay, so a --snapshots-only flag which would only be meaningful with --refresh when the target already exists.
As @monstermunchkin mentioned, we can’t copy stuff if no container exists on the target so that’d only work when a target already exists.

I’m not opposed to this, though it may be a bit tricky to do properly in the migration protocol.

Anyway, feel free to file an issue at https://github.com/lxc/lxd/issues and we’ll triage it.