Add role for restoring registry images from docker archive.
Import user images from docker archive to docker.
Push the images referencing local registry. After the push the images
tags will be deleted. If there are no tags pointing to the same image
unique id the image will be deleted from the docker filesystem thus
recovering the space.
Partition where archive is located, docker partition, local registry
partition must all be big enough.
The archive can be bigger than available space before bootstrap
playbook is played. Restore platform procedure needs to be called before
restoring docker images so that bootstrap playbook is called and space
allocated.
For local plays there are 2 key variables, while for remote play there
are 4.
Var `initial_backup_dir` points to the directory where the backup file is
located.
Var `backup_filename` points to the file in the directory.
Var `backup_dir` is used for remote plays and is the destination folder
on the remote where the file will be copied.
Var `ansible_remote_tmp` points to a temporary directory on the remote
that ansible `copy` module will use to transfer the file.
Directories pointed to by `initial_backup_dir, `backup_dir` and
`ansible_remote_tmp` must be mounted where free space exceeds backup
size.
Reviewed: https:/ /review. opendev. org/743281 /git.openstack. org/cgit/ starlingx/ ansible- playbooks/ commit/ ?id=b8e84bb5d05 db95436da35c555 8c0402f9838337
Committed: https:/
Submitter: Zuul
Branch: master
commit b8e84bb5d05db95 436da35c5558c04 02f9838337
Author: Dan Voiculeasa <email address hidden>
Date: Thu Jul 16 13:43:13 2020 +0300
B&R: Add playbook to restore user images
Add role for restoring registry images from docker archive.
Import user images from docker archive to docker.
Push the images referencing local registry. After the push the images
tags will be deleted. If there are no tags pointing to the same image
unique id the image will be deleted from the docker filesystem thus
recovering the space.
Partition where archive is located, docker partition, local registry
partition must all be big enough.
The archive can be bigger than available space before bootstrap
playbook is played. Restore platform procedure needs to be called before
restoring docker images so that bootstrap playbook is called and space
allocated.
For local plays there are 2 key variables, while for remote play there backup_ dir` points to the directory where the backup file is remote_ tmp` points to a temporary directory on the remote
are 4.
Var `initial_
located.
Var `backup_filename` points to the file in the directory.
Var `backup_dir` is used for remote plays and is the destination folder
on the remote where the file will be copied.
Var `ansible_
that ansible `copy` module will use to transfer the file.
Directories pointed to by `initial_ backup_ dir, `backup_dir` and remote_ tmp` must be mounted where free space exceeds backup
`ansible_
size.
Example call: user_images. yml \ backup_ dir=/host1/ sufficient/ space1/ " \ filename= example. tar" \ remote_ tmp=/host2/ sufficient/ space1/ " \ dir=/host2/ sufficient/ space1/ "
restor_
-e "initial_
-e "backup_
-e "ansible_
-e "backup_
Closes-Bug: 1886152 34f163d218e69dc 4ceb148985a 07af85ef51bb406 8d0dc16c560
Depends-On: I4644784ea41641
Change-Id: I0a7dcf9d174fbc
Signed-off-by: Dan Voiculeasa <email address hidden>