Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ default nonha multinode job used upstream in tripleo-ci.

It executes the ci job end to end and then leaves the environment up at the end
for inspection and/or development.

If you need your overcloud or overcloud to use a particular
overcloud-full.tar images you can use the
`./scripts/upload-overcloud.sh` utility.

For instance to get pike overcloud images in your account:

./scripts/upload-overcloud.sh http://66.187.229.139/builds-pike/current-tripleo/overcloud-full.tar overcloud-pike-full

That’s it.
63 changes: 63 additions & 0 deletions scripts/upload-overcloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/bash

set -eux

delete_existing_image()
{
local name="${1}"
if openstack image show $name -f value -c id | read id; then
echo "Deleting ${name} ($id)"
openstack image delete $id
fi

}
# Usually more space there.
export TMPDIR=${TMPDIR:-/var/tmp}

OVERCLOUD_TAR_URL=${1?:'Please provide the overcloud tar url'}
OVERCLOUD_NAME=${2?:'Please provide the overcloud name prefix in glance'}

OVERCLOUD_TAR_NAME="$(basename ${OVERCLOUD_TAR_URL})"
TMP_DIR=$(mktemp -d)

curl -o ${TMP_DIR}/${OVERCLOUD_TAR_NAME} ${OVERCLOUD_TAR_URL}
(
cd ${TMP_DIR}
tar xf ${OVERCLOUD_TAR_NAME}

echo "Handling overcloud-full.initrd"
delete_existing_image ${OVERCLOUD_NAME}.initrd
RAMDISK_ID=$(
openstack image create \
--disk-format ari --container-format ari \
-f value -c id \
--file ./overcloud-full.initrd ${OVERCLOUD_NAME}.initrd
)

openstack image show $RAMDISK_ID
echo "Handling overcloud-full.vmlinuz"
delete_existing_image ${OVERCLOUD_NAME}.vmlinuz
KERNEL_ID=$(
openstack image create \
--disk-format aki --container-format aki \
-f value -c id \
--file ./overcloud-full.vmlinuz ${OVERCLOUD_NAME}.vmlinuz
)

openstack image show $KERNEL_ID
echo "Handling overcloud-full.qcow2, maybe very long depending on your upload speed."
delete_existing_image ${OVERCLOUD_NAME}
OVERCLOUD_ID=$(openstack image create \
--disk-format qcow2 --container-format bare \
--file ./overcloud-full.qcow2 \
-f value -c id \
--property kernel_id=${KERNEL_ID} --property ramdisk_id=${RAMDISK_ID} \
${OVERCLOUD_NAME})

openstack image show $OVERCLOUD_ID

openstack image list

echo "DONE"

)