[lxc-users] Can you update templates without full image rebuild?

Fajar A. Nugraha list at fajar.net
Tue Mar 7 16:07:59 UTC 2017


On Tue, Mar 7, 2017 at 10:43 PM, RayFerguson <subscriber at share-foo.com>
wrote:

> I'm cheap, so I don't have great storage on my dev boxes and I have some
> custom templates that I want in my images.  My current process is something
> like.
>
> lxc publish contain --alias=foo
> lxc image export foo
> ....
> extract metadata, add templates, mod the metadata.yaml, create meta.tgz
> and root.tgz
> ...
> lxc image import meta.tgz root.tgz
>
> You can see where this is painfully inefficient.  Not only do I decompress
> and recompress, lxd does the same thing and more several times causing more
> I/O coffee breaks than my old bladder can handle.
>
> Is there any shortcut to just modify the metadata.yaml and templates of an
> existing image without the export->decompress->monkey->recompress->import?
>
> I've been tempted to try monkeying the files directly in
> /var/lib/lxd/images, but I'm not sure if that would corrupt it by changing
> some integrity checksum or something?
>


Have you tried using zfs backend (or btrfs), and simpy use "lxc copy"
(using a container as your 'template') instead of publish-launch?

launch (image -> container) and copy (container -> container) should use
zfs snapshot, with near-zero I/O load. publish (containter -> image) does
not.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170307/1a2ea4fe/attachment.html>


More information about the lxc-users mailing list