Merge "Skip gate FS optimization if no secondary disk"

This commit is contained in:
Jenkins 2015-12-14 09:42:33 +00:00 committed by Gerrit Code Review
commit 987ae1af77
2 changed files with 39 additions and 32 deletions

View File

@ -14,6 +14,8 @@ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58
sudo apt-get update
sudo apt-get install -y --no-install-recommends docker-engine=1.8.2-0~trusty btrfs-tools
# Only do FS optimization if we have a secondary disk
if [[ -b /dev/${DEV} ]]; then
# The reason for using BTRFS is stability. There are numerous issues with the
# devicemapper backed on Ubuntu and AUFS is slow. BTRFS is very solid as a
# backend in my experince. I use ie almost exclusively.
@ -33,6 +35,7 @@ sudo umount /var/lib/docker
sudo mount -o noatime,compress=lzo,space_cache,subvol=docker /dev/${DEV} /var/lib/docker
sudo service docker start
fi
sudo docker info

View File

@ -19,6 +19,8 @@ EOF
sudo yum install -y libffi-devel openssl-devel docker-engine-1.8.2 xfsprogs
# Only do FS optimization if we have a secondary disk
if [[ -b /dev/${DEV} ]]; then
# Setup backing disk for use with Docker. This is to ensure we use the ephemeral
# disk provided to the build instance. It ensures the correct disk and storage
# driver are used for Docker. It is recommend to use the thin provisioning
@ -35,6 +37,8 @@ yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/
# Setup Docker
sudo sed -i -r 's,(ExecStart)=(.+),\1=/usr/bin/docker daemon --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=kolla01-thin01 --storage-opt dm.use_deferred_removal=true,' /usr/lib/systemd/system/docker.service
sudo systemctl daemon-reload
fi
sudo systemctl start docker
sudo docker info