S
S
Sergey2016-07-22 07:29:51
ZFS
Sergey, 2016-07-22 07:29:51

How to organize container cloning on zfs?

Good afternoon.
Task: there are 20 developers, there are 2 large projects with large databases, but there is no single working environment. It is necessary to make sure that all developers have the opportunity to create / re-create working environments in the blink of an eye + that all environments are equally configured and all projects (there are 2 of them) are rolled out with their full bases (let's say there are also 2 of them). The databases are quite large (let's say 100 GB each) and just copying the entire environment is not very cool (because it will take up a lot of space + time to copy). It seems like zfs can work well for these purposes. That is, we create a master environment using, say, docker-compose -- we will take snapshots from this environment, so that later we can clone this whole thing so as not to copy files that will not change in vain. Therefore, to deploy a new environment along with the base and projects,
Question: how to organize it all? I installed zfs, created a pool, created a file system mounted on /var/lib/docker and everything seems to work, but now this solves the problem of copying / cloning / restoring all the containers that we have, and not some specific ones . Please direct me to the path of truth. Is it possible to mount zfs to the container level, then make snapshots, clone, and then somehow magically change the paths and make the container seem to be different, but the data is taken from the clone. Or is it possible to allocate storage containers from voluum to zfs, where to put all the data (projects, database files), and then just use these containers as voluums for other containers so that they use just this data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2016-07-22
@Zarom

Perhaps I did not fully understand your problem, but I would try to solve the problem as follows:

  • Create a basic "reference" container, take a snapshot and protect it from deletion. Snapshot clone to the required number of containers.
  • Configure each container, take a snapshot and protect it from deletion - we get a bunch of configured containers with a rollback point.
  • Clone sample containers as needed. Of course, you will have to add a script to change docker configs...

A
Armenian Radio, 2016-07-22
@gbg

Stop stop stop. Docker already has a file system with change stacking and rollbacks , why push ZFS there?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question