From cb846847dce9790974050ea7f9b678f9489e1741 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 12 Jan 2022 16:32:20 +0100 Subject: [PATCH] copr-hv: upload the ppc64le into OpenStack, too --- .../templates/provision/upload-qcow2-images | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/templates/provision/upload-qcow2-images b/roles/copr/backend/templates/provision/upload-qcow2-images index 9e2521e9c9..e06e7ced53 100755 --- a/roles/copr/backend/templates/provision/upload-qcow2-images +++ b/roles/copr/backend/templates/provision/upload-qcow2-images @@ -4,7 +4,7 @@ die() { echo >&2 "$*" ; exit 1 ; } image=$1 -connections=' +libvirt_connections=' {% for host in groups["copr_hypervisor"] %} {% for arch in ["p08", "x86"] %} {% if arch in inventory_hostname and arch in hostvars[host]['inventory_hostname'] %} @@ -26,8 +26,18 @@ test -n "$image" || die "first argument (image) required" test -f "$image" || die "image $image not found" pool=images -for connection in $connections; do +for connection in $libvirt_connections; do virsh --connect="$connection" vol-create-as --pool "$pool" "$new_volume" 1M virsh --connect="$connection" vol-upload --pool "$pool" "$new_volume" --sparse "$image" done + +case $(uname -m) in +ppc64le) + # We are going to upload the same image to OpenStack + . "{{ provision_directory }}/.rc-osuosl.sh" + glance image-create --name "$new_volume" --disk-format qcow2 --container-format bare --file "$image" --progress + ;; +esac + + echo "uploaded images $new_volume"