summaryrefslogtreecommitdiff
path: root/tools/setup_Debian.sh
diff options
context:
space:
mode:
authorEduardo Gonzalez <dabarren@gmail.com>2017-08-24 16:19:25 +0200
committerMichal Jastrzebski (inc0) <michal.jastrzebski@intel.com>2017-08-29 19:52:07 +0000
commitd0a5ff1050f173d7a2600c8d391f608b712626a6 (patch)
tree641eeb22fcc722079331e26bdb6035634dc1dbd9 /tools/setup_Debian.sh
parentbbeda30a9df9021bf463b90d864e39cd6d7870df (diff)
downloadkolla-d0a5ff1050f173d7a2600c8d391f608b712626a6.tar.gz
kolla-d0a5ff1050f173d7a2600c8d391f608b712626a6.zip
Fix gates out of disk space
Sometimes gates fails due lack of space, post merge jobs gates fails always for oraclelinux binary, not being able create a tarball registry. This change mounts a second disk in opt and moves registry data to opt. Disk format commands are excepts from devstack-gate: https://github.com/openstack-infra/devstack-gate/blob/dc49f9e6eb18e42c6b175e4e146fa8f3b7633279/functions.sh#L306 Closes-Bug: #1713652 Change-Id: I883e51042841709eb9ab348cfdce9fecbd4fb890
Diffstat (limited to 'tools/setup_Debian.sh')
-rwxr-xr-xtools/setup_Debian.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/setup_Debian.sh b/tools/setup_Debian.sh
index f217d5bc2..b04369052 100755
--- a/tools/setup_Debian.sh
+++ b/tools/setup_Debian.sh
@@ -18,6 +18,25 @@ function setup_disk {
DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
fi
+# Excerpts from https://github.com/openstack-infra/devstack-gate/blob/dc49f9e6eb18e42c6b175e4e146fa8f3b7633279/functions.sh#L306
+ if [ -b /dev/xvde ]; then
+ DEV2='/dev/xvde'
+ if mount | grep ${DEV2} > /dev/null; then
+ echo "*** ${DEV2} appears to already be mounted"
+ echo "*** ${DEV2} unmounting and reformating"
+ sudo umount ${DEV2}
+ fi
+ sudo parted ${DEV2} --script -- mklabel msdos
+ sync
+ sudo partprobe
+ sudo mkfs.ext4 ${DEV2}
+ sudo mount ${DEV2} /mnt
+ sudo find /opt/ -mindepth 1 -maxdepth 1 -exec mv {} /mnt/ \;
+ sudo umount /mnt
+ sudo mount ${DEV2} /opt
+ grep -q ${DEV2} /proc/mounts || exit 1
+ fi
+
# Format Disks and setup Docker to use BTRFS
sudo parted ${DEV} -s -- mklabel msdos
sudo rm -rf /var/lib/docker