summaryrefslogtreecommitdiffstats
path: root/qa/qa_scripts/openstack/execs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /qa/qa_scripts/openstack/execs
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/qa_scripts/openstack/execs')
-rwxr-xr-xqa/qa_scripts/openstack/execs/ceph-pool-create.sh34
-rwxr-xr-xqa/qa_scripts/openstack/execs/ceph_cluster.sh50
-rwxr-xr-xqa/qa_scripts/openstack/execs/libvirt-secret.sh19
-rwxr-xr-xqa/qa_scripts/openstack/execs/openstack-preinstall.sh17
-rwxr-xr-xqa/qa_scripts/openstack/execs/run_openstack.sh23
-rwxr-xr-xqa/qa_scripts/openstack/execs/start_openstack.sh15
6 files changed, 158 insertions, 0 deletions
diff --git a/qa/qa_scripts/openstack/execs/ceph-pool-create.sh b/qa/qa_scripts/openstack/execs/ceph-pool-create.sh
new file mode 100755
index 00000000..723c8306
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/ceph-pool-create.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+set -f
+
+#
+# On the ceph site, make the pools required for Openstack
+#
+
+#
+# Make a pool, if it does not already exist.
+#
+function make_pool {
+ if [[ -z `sudo ceph osd lspools | grep " $1,"` ]]; then
+ echo "making $1"
+ sudo ceph osd pool create $1 128
+ fi
+}
+
+#
+# Make sure the pg_num and pgp_num values are good.
+#
+count=`sudo ceph osd pool get rbd pg_num | sed 's/pg_num: //'`
+while [ $count -lt 128 ]; do
+ sudo ceph osd pool set rbd pg_num $count
+ count=`expr $count + 32`
+ sleep 30
+done
+sudo ceph osd pool set rbd pg_num 128
+sleep 30
+sudo ceph osd pool set rbd pgp_num 128
+sleep 30
+make_pool volumes
+make_pool images
+make_pool backups
+make_pool vms
diff --git a/qa/qa_scripts/openstack/execs/ceph_cluster.sh b/qa/qa_scripts/openstack/execs/ceph_cluster.sh
new file mode 100755
index 00000000..5afb3c78
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/ceph_cluster.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+set -f
+
+echo $OS_CEPH_ISO
+if [[ $# -ne 4 ]]; then
+ echo "Usage: ceph_cluster mon.0 osd.0 osd.1 osd.2"
+ exit -1
+fi
+allsites=$*
+mon=$1
+shift
+osds=$*
+ISOVAL=${OS_CEPH_ISO-rhceph-1.3.1-rhel-7-x86_64-dvd.iso}
+sudo mount -o loop ${ISOVAL} /mnt
+
+fqdn=`hostname -f`
+lsetup=`ls /mnt/Installer | grep "^ice_setup"`
+sudo yum -y install /mnt/Installer/${lsetup}
+sudo ice_setup -d /mnt << EOF
+yes
+/mnt
+$fqdn
+http
+EOF
+ceph-deploy new ${mon}
+ceph-deploy install --repo --release=ceph-mon ${mon}
+ceph-deploy install --repo --release=ceph-osd ${allsites}
+ceph-deploy install --mon ${mon}
+ceph-deploy install --osd ${allsites}
+ceph-deploy mon create-initial
+sudo service ceph -a start osd
+for d in b c d; do
+ for m in $osds; do
+ ceph-deploy disk zap ${m}:sd${d}
+ done
+ for m in $osds; do
+ ceph-deploy osd prepare ${m}:sd${d}
+ done
+ for m in $osds; do
+ ceph-deploy osd activate ${m}:sd${d}1:sd${d}2
+ done
+done
+
+sudo ./ceph-pool-create.sh
+
+hchk=`sudo ceph health`
+while [[ $hchk != 'HEALTH_OK' ]]; do
+ sleep 30
+ hchk=`sudo ceph health`
+done
diff --git a/qa/qa_scripts/openstack/execs/libvirt-secret.sh b/qa/qa_scripts/openstack/execs/libvirt-secret.sh
new file mode 100755
index 00000000..75e9e91a
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/libvirt-secret.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -f
+
+#
+# Generate a libvirt secret on the Openstack node.
+#
+openstack_node=${1}
+uuid=`uuidgen`
+cat > secret.xml <<EOF
+<secret ephemeral='no' private='no'>
+ <uuid>${uuid}</uuid>
+ <usage type='ceph'>
+ <name>client.cinder secret</name>
+ </usage>
+</secret>
+EOF
+sudo virsh secret-define --file secret.xml
+sudo virsh secret-set-value --secret ${uuid} --base64 $(cat client.cinder.key)
+echo ${uuid}
diff --git a/qa/qa_scripts/openstack/execs/openstack-preinstall.sh b/qa/qa_scripts/openstack/execs/openstack-preinstall.sh
new file mode 100755
index 00000000..a2b235e7
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/openstack-preinstall.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -f
+
+#
+# Remotely setup the stuff needed to run packstack. This should do items 1-4 in
+# https://docs.google.com/document/d/1us18KR3LuLyINgGk2rmI-SVj9UksCE7y4C2D_68Aa8o/edit?ts=56a78fcb
+#
+yum remove -y rhos-release
+rpm -ivh http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm
+rm -rf /etc/yum.repos.d/*
+rm -rf /var/cache/yum/*
+rhos-release 8
+yum update -y
+yum install -y nc puppet vim screen setroubleshoot crudini bpython openstack-packstack
+systemctl disable ntpd
+systemctl stop ntpd
+reboot
diff --git a/qa/qa_scripts/openstack/execs/run_openstack.sh b/qa/qa_scripts/openstack/execs/run_openstack.sh
new file mode 100755
index 00000000..8764cbeb
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/run_openstack.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+set -fv
+
+#
+# Create a glance image, a corresponding cinder volume, a nova instance, attach, the cinder volume to the
+# nova instance, and create a backup.
+#
+image_name=${1}X
+file_name=${2-rhel-server-7.2-x86_64-boot.iso}
+source ./keystonerc_admin
+glance image-create --name $image_name --disk-format iso --container-format bare --file $file_name
+glance_id=`glance image-list | grep ${image_name} | sed 's/^| //' | sed 's/ |.*//'`
+cinder create --image-id ${glance_id} --display-name ${image_name}-volume 8
+nova boot --image ${image_name} --flavor 1 ${image_name}-inst
+cinder_id=`cinder list | grep ${image_name} | sed 's/^| //' | sed 's/ |.*//'`
+chkr=`cinder list | grep ${image_name}-volume | grep available`
+while [ -z "$chkr" ]; do
+ sleep 30
+ chkr=`cinder list | grep ${image_name}-volume | grep available`
+done
+nova volume-attach ${image_name}-inst ${cinder_id} auto
+sleep 30
+cinder backup-create --name ${image_name}-backup ${image_name}-volume --force
diff --git a/qa/qa_scripts/openstack/execs/start_openstack.sh b/qa/qa_scripts/openstack/execs/start_openstack.sh
new file mode 100755
index 00000000..f5f12fe5
--- /dev/null
+++ b/qa/qa_scripts/openstack/execs/start_openstack.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -fv
+
+#
+# start the Openstack services
+#
+sudo cp /root/keystonerc_admin ./keystonerc_admin
+sudo chmod 0644 ./keystonerc_admin
+source ./keystonerc_admin
+sudo service httpd stop
+sudo service openstack-keystone restart
+sudo service openstack-glance-api restart
+sudo service openstack-nova-compute restart
+sudo service openstack-cinder-volume restart
+sudo service openstack-cinder-backup restart