Hi,
Having read the sections about Rancher upgrades, backups, restorations and rollbacks of single node Rancher installations, I am still wondering how the data is stored. As per the description, snapshots / backups are generated by creating a new container that mounts the volumes of the previously stopped current Rancher container, as in:
docker create --volumes-from <RANCHER_CONTAINER_ID> \
--name rancher-backup-<RANCHER_VERSION> rancher/rancher:<RANCHER_CONTAINER_TAG>
As far as I understand, the content of the volumes is just shared, which means subsequent modifications of the content is also shared. How does the creation of the backup / snapshot container preserve (i.e. freeze) the state at the time of its creation? Is there some magic going on during container creation? As the container is not even run, it cannot do anything during its runtime (such as creating a copy or a tar archive of the content of the volume).
After creating the backup container, an inspection shows that bowh the original and the backup container bind-mount the same host directory at the same location:
"Mounts": [
{
"Type": "volume",
"Name": "ffb2ccf9161cfd7a5c17114758a79a50b89188777ce9ad43663e7f1e3343ef0e",
"Source": "/var/lib/docker/volumes/ffb2ccf9161cfd7a5c17114758a79a50b89188777ce9ad43663e7f1e3343ef0e/_data",
"Destination": "/var/lib/rancher",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
In fact, the content of the “Mounts” section of the result of docker inspect is identical for both the original and the backup container.