canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 931 forks source link

Enhancement Request: replace hard-wired calls to "tar" for "lxc import/export" with user-defined command line templates #4966

Closed m-ueberall closed 6 years ago

m-ueberall commented 6 years ago

Required information

Issue description

Currently, lxc import/export will result in hard-wired calls to tar in order to read/write (compressed) archives from/to disk. Especially in cases where forementioned archives are to be stored externally for backup purposes, the current format is "not necessarily" suitable.

Instead of post- (backup) and pre-processing (restore) the resulting archives in their current (.tar.xz) form, it would be much better if the above hard-wired calls to tar could be replaced/overridden by user-defined commands in order to be able to, e.g., apply better compression (zstd), encryption (gpg), split large archives into smaller parts (tar), and protect the resulting files against bit-rot (par2/par3) directly.

stgraber commented 6 years ago

We're planning on adding compression algorithm configuration but don't expect to do much more than that. For more complex options, it's likely best to just download the backups through the API and store them in whatever way you want.

davidfavor commented 5 years ago

For additional consideration.

The simple way to allow great ease/flexibility might be to just all specifying the -I option as a pass through to tar.

So any new compression method can be used, as they become available.

For example...

lxc export -I"zstd --threads=0 --no-check -19 --long=31" cname cname.tar.zst