summaryrefslogtreecommitdiff
path: root/playbooks
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2022-10-10 10:54:44 -0700
committerDan Smith <dansmith@redhat.com>2022-11-09 11:34:02 -0800
commit010983e80374ef6538c965d3db3247cda1bc6edc (patch)
tree5923bcf733fba95e72bb95fd5b71ce0e134204c2 /playbooks
parentc97507dfcd57cce9d76670d3b0d48538900c00e9 (diff)
downloadnova-010983e80374ef6538c965d3db3247cda1bc6edc.tar.gz
Test ceph-multistore with a real image
This inflates the cirros image to 1G for a more realistic scenario. Technically we should have been doing something like this all along, as the deployment guidance for ceph is to use a raw image, not a qcow2 one, so this also increases our accuracy to real-life. We also need to up the volume size tempest uses for various tests to make sure we will fit. Change-Id: I5c447e630aaf1413a5eac89c2e8103506d245221
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/ceph/glance-copy-policy.yaml15
-rw-r--r--playbooks/ceph/glance-setup.yaml39
2 files changed, 39 insertions, 15 deletions
diff --git a/playbooks/ceph/glance-copy-policy.yaml b/playbooks/ceph/glance-copy-policy.yaml
deleted file mode 100644
index 41654a103d..0000000000
--- a/playbooks/ceph/glance-copy-policy.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-- hosts: controller
- tasks:
- - name: create local.sh
- become: yes
- blockinfile:
- path: /opt/stack/devstack/local.sh
- create: True
- mode: 0777
- block: |
- # This policy is default to admin only in glance. Override
- # here to allow everyone and every type of image (private
- # or public) to copy. This way we will be able to test copy
- # image via non-admin as well as on private images.
- echo $'"copy_image": ""' >> /etc/glance/policy.yaml
- sudo systemctl restart 'devstack@g-*'
diff --git a/playbooks/ceph/glance-setup.yaml b/playbooks/ceph/glance-setup.yaml
new file mode 100644
index 0000000000..5792c72237
--- /dev/null
+++ b/playbooks/ceph/glance-setup.yaml
@@ -0,0 +1,39 @@
+- hosts: controller
+ tasks:
+ - name: create local.sh
+ become: yes
+ blockinfile:
+ path: /opt/stack/devstack/local.sh
+ create: True
+ mode: 0777
+ block: |
+ # Delete all existing images
+ source /opt/stack/devstack/openrc admin
+ for img in $(openstack image list -f value -c ID); do
+ openstack image show $img
+ echo Deleting $img
+ openstack image delete $img
+ done
+
+ # Inflate our cirros image to 1G raw
+ arch=$(uname -m)
+ image=$(ls /opt/stack/devstack/files/cirros*${arch}-disk.img | tail -n1)
+ rawimage="/opt/stack/devstack/files/cirros-raw.img"
+ qemu-img convert -O raw "$image" "$rawimage"
+ truncate --size $((950 << 20)) "$rawimage"
+
+ # Upload it to glance as the sole image available so tempest
+ # config will find it. Wait ten seconds after doing this
+ # before the restart below.
+ openstack image create --container-format bare --disk-format raw --public "cirros-raw" < "$rawimage"
+ sleep 10
+ openstack image list
+ openstack image show cirros-raw
+
+ # This policy is default to admin only in glance. Override
+ # here to allow everyone and every type of image (private
+ # or public) to copy. This way we will be able to test copy
+ # image via non-admin as well as on private images.
+ echo $'"copy_image": ""' >> /etc/glance/policy.yaml
+ sudo systemctl restart 'devstack@g-*'
+