diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-12-23 18:40:09 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-12-23 20:01:42 +0100 |
commit | 60c80df479c0798b8832b58b668d31fa6bfeeab8 (patch) | |
tree | dee09d62f65441dc6e42af8eb389309309435127 /src/migration-scripts/container | |
parent | 40efa3e7284c29e0f00406236cdfc2a4a732a48e (diff) | |
download | vyos-1x-60c80df479c0798b8832b58b668d31fa6bfeeab8.tar.gz vyos-1x-60c80df479c0798b8832b58b668d31fa6bfeeab8.zip |
container: T4870: bump package version 0 -> 1 for filesystem change
move from vfs to overlay driver
The following pre iage upgrade script must be executed to have containers after
the reboot:
for pod in $(cli-shell-api listActiveNodes container name); do
systemctl stop vyos-container-${pod//\'}.service
done
sed -i 's/vfs/overlay/g' /etc/containers/storage.conf /usr/share/vyos/templates/container/storage.conf.j2
rm -rf /usr/lib/live/mount/persistence/container/storage/libpod
for pod in $(cli-shell-api listActiveNodes container name); do
image=$(cli-shell-api returnActiveValue container name ${pod//\'} image)
podman image pull $image
systemctl start vyos-container-${pod//\'}.service
done
for dir in vfs vfs-containers vfs-images vfs-layers; do
rm -rf /usr/lib/live/mount/persistence/container/storage/$dir
done
Diffstat (limited to 'src/migration-scripts/container')
-rwxr-xr-x | src/migration-scripts/container/0-to-1 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/migration-scripts/container/0-to-1 b/src/migration-scripts/container/0-to-1 new file mode 100755 index 000000000..96ed6edee --- /dev/null +++ b/src/migration-scripts/container/0-to-1 @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2022 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# T4870: change underlaying container filesystem from vfs to overlay + +import os +import sys +import shutil + +from vyos.configtree import ConfigTree + +if (len(sys.argv) < 1): + print("Must specify file name!") + sys.exit(1) + +# We actually need no filename as this is a filesystem operation +base_path = '/usr/lib/live/mount/persistence/container/storage' +for dir in ['libpod', 'vfs', 'vfs-containers', 'vfs-images', 'vfs-layers']: + if os.path.exists(f'{base_path}/{dir}'): + shutil.rmtree(f'{base_path}/{dir}') + |