Bug 89975

Summary: RFE: nspawn: --template should support overlayfs too
Product: systemd Reporter: Damjan Georgievski <gdamjan>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Damjan Georgievski 2015-04-10 16:18:46 UTC
The --template option in systemd-nspawn will take a filesystem, make a btrfs snapshot of it, and run the container in the snapshot, then destroy the snapshot when it's over.

The same functionality could be implemented with overlay(fs) in kernels newer or equal than 3.18, for systems not running on btrfs. The base filesystem would be the read-only lower layer of the overlay, and the write layer can be in a tmpfs or anywhere else on the real filesystem.


Additionally, the overlay(fs) now also supports more than one read-only layer.

Also food for thought, it might be an interesting option to have the write layer persistent - but that would diverge from the btrfs usage.
Comment 1 Damjan Georgievski 2015-05-22 11:00:23 UTC
I guess this is fixed in systemd 220 and the new --overlay= and --overlay-ro= options:

http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--overlay=
Comment 2 Lennart Poettering 2015-05-22 11:04:27 UTC
(In reply to Damjan Georgievski from comment #1)
> I guess this is fixed in systemd 220 and the new --overlay= and
> --overlay-ro= options:
> 
> http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--
> overlay=

Not really. We don't support this in --template=.
Comment 3 Lennart Poettering 2019-08-19 10:11:27 UTC
There's now --volatile=overlayfs since 242. Let's close this. If there's anything else missing in this, please file an RFE issue on the github instance instead.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.