Commit eb5cd518 authored by Spyros Trigazis's avatar Spyros Trigazis
Browse files

[cern] Fix docker-storage configuration

Cherry-pick from [1] for file:
magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh
Revert changes in:
magnum/drivers/common/templates/fragments/configure-docker-storage.sh
magnum/drivers/common/templates/fragments/configure-cvmfs.sh

Related-Ticket: OS-4106
[1] https://review.openstack.org/#/c/417457/
parent ba824b46
......@@ -22,7 +22,3 @@ docker cp docker-volume-cvmfs:/usr/sbin/docker-volume-cvmfs /var/lib/kubelet/plu
# TODO: drop this requirement (kubelet seems to need the binary there on start)
systemctl restart kubelet
# TODO: move this elsewhere
lvextend /dev/atomicos/root --size 5G
xfs_growfs /dev/mapper/atomicos-root
......@@ -32,8 +32,6 @@ if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
fi
fi
systemctl stop docker
$configure_docker_storage_driver
if [ "$DOCKER_STORAGE_DRIVER" = "overlay" ]; then
......@@ -48,5 +46,3 @@ if [ "$DOCKER_STORAGE_DRIVER" = "overlay" ]; then
else
configure_devicemapper
fi
systemctl start docker-storage-setup
# This file contains docker storage drivers configuration for fedora
# atomic hosts. Currently, devicemapper and overlay are supported.
# - Remove any existing docker-storage configuration. In case of an
# * Remove any existing docker-storage configuration. In case of an
# existing configuration, docker-storage-setup will fail.
# - Remove the current storage graph.
# * Remove docker storage graph
clear_docker_storage () {
# stop docker
systemctl stop docker
# clear storage graph
rm -rf /var/lib/docker/*
# remove current LVs
docker-storage-setup --reset
if [ -f /etc/sysconfig/docker-storage ]; then
sed -i "/^DOCKER_STORAGE_OPTIONS=/ s/=.*/=/" /etc/sysconfig/docker-storage
fi
rm -rf /var/lib/docker/*
}
# Configure docker storage with xfs as backing filesystem.
......@@ -24,20 +29,29 @@ configure_overlay () {
echo "STORAGE_DRIVER=overlay" > /etc/sysconfig/docker-storage-setup
# SELinux must be enabled and in enforcing mode on the physical
# machine, but must be disabled in the container when performing
# container separation
sed -i "/^OPTIONS=/ s/--selinux-enabled/--selinux-enabled=false/" /etc/sysconfig/docker
docker-storage-setup
local lvname=$(lvdisplay | grep "LV\ Path" | awk '{print $3}')
local pvname=$(pvdisplay | grep "PV\ Name" | awk '{print $3}')
lvextend -r $lvname $pvname
}
# Configure docker storage with devicemapper using direct LVM
configure_devicemapper () {
clear_docker_storage
echo "GROWROOT=True" > /etc/sysconfig/docker-storage-setup
echo "ROOT_SIZE=5GB" >> /etc/sysconfig/docker-storage-setup
if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
pvcreate -f ${device_path}
vgcreate docker ${device_path}
echo "VG=docker" > /etc/sysconfig/docker-storage-setup
echo "VG=docker" >> /etc/sysconfig/docker-storage-setup
else
echo "DATA_SIZE=95%FREE" >> /etc/sysconfig/docker-storage-setup
fi
docker-storage-setup
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment