diff options
| author | Martin André <m.andre@redhat.com> | 2015-12-11 11:11:05 +0900 |
|---|---|---|
| committer | Martin André <m.andre@redhat.com> | 2015-12-11 15:31:35 +0900 |
| commit | 40b8a0243e20d551f2e153759f531749783656be (patch) | |
| tree | 01c62b3bfcc4adb91a1abb18f2bdd04b92be54f3 /tests/setup_RedHat.sh | |
| parent | a98628453b0c1fc72692376abd873cbccb5a35a9 (diff) | |
| download | kolla-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_RedHat.sh')
| -rwxr-xr-x | tests/setup_RedHat.sh | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/tests/setup_RedHat.sh b/tests/setup_RedHat.sh index e9920a0da..e6b82da82 100755 --- a/tests/setup_RedHat.sh +++ b/tests/setup_RedHat.sh @@ -19,22 +19,26 @@ EOF sudo yum install -y libffi-devel openssl-devel docker-engine-1.8.2 xfsprogs -# 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 -# driver. https://github.com/docker/docker/blob/master/man/docker.1.md -sudo parted /dev/${DEV} -s -- mklabel msdos mkpart pri 1 -1 -# Figure out the path to the partitioned device -PARTDEV=$(ls "/dev/${DEV}"* | egrep "/dev/${DEV}p?1") -sudo pvcreate ${PARTDEV} -sudo vgcreate kolla01 ${PARTDEV} -sudo lvcreate -n thin01 -L 60G kolla01 -sudo lvcreate -n thin01meta -L 2G kolla01 -yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/thin01 - -# 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 +# 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 + # driver. https://github.com/docker/docker/blob/master/man/docker.1.md + sudo parted /dev/${DEV} -s -- mklabel msdos mkpart pri 1 -1 + # Figure out the path to the partitioned device + PARTDEV=$(ls "/dev/${DEV}"* | egrep "/dev/${DEV}p?1") + sudo pvcreate ${PARTDEV} + sudo vgcreate kolla01 ${PARTDEV} + sudo lvcreate -n thin01 -L 60G kolla01 + sudo lvcreate -n thin01meta -L 2G kolla01 + yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/thin01 + + # 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 |
