aboutsummaryrefslogtreecommitdiff
path: root/tests/setup_Debian.sh
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2015-12-11 11:11:05 +0900
committerMartin André <m.andre@redhat.com>2015-12-11 15:31:35 +0900
commit40b8a0243e20d551f2e153759f531749783656be (patch)
tree01c62b3bfcc4adb91a1abb18f2bdd04b92be54f3 /tests/setup_Debian.sh
parenta98628453b0c1fc72692376abd873cbccb5a35a9 (diff)
downloadkolla-40b8a0243e20d551f2e153759f531749783656be.tar.gz
kolla-40b8a0243e20d551f2e153759f531749783656be.zip
Skip gate FS optimization if no secondary disk
This commit removes the assumption that all gate nodes have a secondary disk, and skip tuning the filesystem if the node doesn't have one. This fixes gate failures on OVH nodes. Closes-Bug: #1525047 Change-Id: Ief22f34b32caf7a8b446df888fc5cc1964ad272e
Diffstat (limited to 'tests/setup_Debian.sh')
-rwxr-xr-xtests/setup_Debian.sh41
1 files changed, 22 insertions, 19 deletions
diff --git a/tests/setup_Debian.sh b/tests/setup_Debian.sh
index c9159e003..e2a4c939b 100755
--- a/tests/setup_Debian.sh
+++ b/tests/setup_Debian.sh
@@ -14,25 +14,28 @@ 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
-# 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.
-# Format Disks and setup Docker to use BTRFS
-sudo umount /dev/${DEV} || true
-sudo parted /dev/${DEV} -s -- mklabel msdos
-sudo service docker stop
-echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
-sudo rm -rf /var/lib/docker/*
-
-# We want to snapshot the entire docker directory so we have to first create a
-# subvolume and use that as the root for the docker directory.
-sudo mkfs.btrfs -f /dev/${DEV}
-sudo mount /dev/${DEV} /var/lib/docker
-sudo btrfs subvolume create /var/lib/docker/docker
-sudo umount /var/lib/docker
-sudo mount -o noatime,compress=lzo,space_cache,subvol=docker /dev/${DEV} /var/lib/docker
-
-sudo service docker start
+# 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.
+ # Format Disks and setup Docker to use BTRFS
+ sudo umount /dev/${DEV} || true
+ sudo parted /dev/${DEV} -s -- mklabel msdos
+ sudo service docker stop
+ echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
+ sudo rm -rf /var/lib/docker/*
+
+ # We want to snapshot the entire docker directory so we have to first create a
+ # subvolume and use that as the root for the docker directory.
+ sudo mkfs.btrfs -f /dev/${DEV}
+ sudo mount /dev/${DEV} /var/lib/docker
+ sudo btrfs subvolume create /var/lib/docker/docker
+ 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