Fix gates out of disk space

Sometimes gates fails due lack of disk space,

This change mounts a second disk in opt and moves
registry data to opt.
Disk format commands are excepts from devstack-gate:
dc49f9e6eb/functions.sh (L306)

Change-Id: I606aa491b8cbf678e83281bad1a0ff39d3920ff2
Closes-Bug: #1713652
This commit is contained in:
Eduardo Gonzalez 2017-08-29 09:11:56 +01:00
parent 81de1420e6
commit 894e73146c
3 changed files with 40 additions and 2 deletions

View File

@ -34,6 +34,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

View File

@ -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

View File

@ -158,7 +158,7 @@ function setup_logging {
}
function prepare_images {
sudo docker run -d -p 4000:5000 --restart=always -v /tmp/kolla_registry/:/var/lib/registry --name registry registry:2
sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
# NOTE(Jeffrey4l): Zuul adds all changes depend on to ZUUL_CHANGES
# variable. if find "openstack/kolla:" string, it means this patch depends
@ -175,7 +175,7 @@ function prepare_images {
filename=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
wget -q -c -O "/tmp/$filename" \
"${NODEPOOL_TARBALLS_MIRROR}/kolla/images/${TMP_REGISTRY}${filename}"
sudo tar xzf "/tmp/$filename" -C /tmp/kolla_registry
sudo tar xzf "/tmp/$filename" -C /opt/kolla_registry
fi
}