instack-undercloud/scripts/instack-prepare-for-overcloud
Lucas Alvares Gomes 0a60b5416c Ironic: Enable iPXE
This patch is enabling and configuring the envrironment for iPXE in
Ironic and ironic-discoverd.

Change-Id: Id16edb902b2af663c086c27157873e037a215246
2015-05-07 16:30:28 +01:00

55 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -eux
IMAGE_PATH=${IMAGE_PATH:-"."}
export DEPLOY_NAME=${DEPLOY_NAME:-deploy-ramdisk-ironic}
export DISCOVERY_NAME=${DISCOVERY_NAME:-discovery-ramdisk}
HTTP_ROOT=${HTTP_ROOT:-/httpboot}
source <(sudo cat /root/stackrc)
OS_AUTH_URL=${OS_AUTH_URL:-""}
if [ -z "$OS_AUTH_URL" ]; then
echo "You must source a stackrc file for the Undercloud."
exit 1
fi
function check_image {
local image_name=$IMAGE_PATH/$1
if [ ! -f $image_name ]; then
echo "$image_name does not exist."
exit 1
fi
}
function load_image {
local image_name=$IMAGE_PATH/$1
tripleo load-image -d $image_name
}
check_image $DEPLOY_NAME.initramfs
check_image $DEPLOY_NAME.kernel
check_image $DISCOVERY_NAME.initramfs
check_image $DISCOVERY_NAME.kernel
check_image overcloud-full.qcow2
load_image overcloud-full.qcow2
glance image-delete bm-deploy-kernel 2>/dev/null || :
glance image-create --name bm-deploy-kernel --is-public true \
--disk-format aki < $IMAGE_PATH/$DEPLOY_NAME.kernel
glance image-delete bm-deploy-ramdisk 2>/dev/null || :
glance image-create --name bm-deploy-ramdisk --is-public true \
--disk-format ari < $IMAGE_PATH/$DEPLOY_NAME.initramfs
deploy_kernel_id=$(glance image-show bm-deploy-kernel | awk ' / id / {print $4}')
deploy_ramdisk_id=$(glance image-show bm-deploy-ramdisk | awk ' / id / {print $4}')
sudo cp -f "$IMAGE_PATH/$DISCOVERY_NAME.kernel" "$HTTP_ROOT/discovery.kernel"
sudo cp -f "$IMAGE_PATH/$DISCOVERY_NAME.initramfs" "$HTTP_ROOT/discovery.ramdisk"