summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/heat_template/HOT_create_instance.sh
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2015-12-22 08:59:39 +0000
committerMatthewLi <matthew.lijun@huawei.com>2015-12-22 08:59:39 +0000
commit51de3c47c39f9f3a22108320d3b94a0f16723a0b (patch)
tree6089d7312a1237f1638ae14f1b7af5d2a2ba5b0c /utils/infra_setup/heat_template/HOT_create_instance.sh
parent4b3809ba69a38e7a5c069f37d322d170ea9c53b8 (diff)
amend heat template instance creation script
JIRA: BOTTLENECK-35 Change-Id: I4e324f3155b42b92290af0b17ba3723947fb241d Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
Diffstat (limited to 'utils/infra_setup/heat_template/HOT_create_instance.sh')
-rwxr-xr-xutils/infra_setup/heat_template/HOT_create_instance.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/utils/infra_setup/heat_template/HOT_create_instance.sh b/utils/infra_setup/heat_template/HOT_create_instance.sh
index c6c1fe3a..43d729f0 100755
--- a/utils/infra_setup/heat_template/HOT_create_instance.sh
+++ b/utils/infra_setup/heat_template/HOT_create_instance.sh
@@ -6,10 +6,16 @@ bottlenecks_create_instance()
{
echo "create bottlenecks instance using heat template"
+ if [ -d $BOTTLENECKS_REPO_DIR ]; then
+ rm -rf ${BOTTLENECKS_REPO_DIR}
+ fi
+
mkdir -p ${BOTTLENECKS_REPO_DIR}
git config --global http.sslVerify false
git clone ${BOTTLENECKS_REPO} ${BOTTLENECKS_REPO_DIR}
+ source $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
+
echo "upload keypair"
nova keypair-add --pub_key $KEY_PATH/bottleneck_key.pub $KEY_NAME
#need FIX, only upload the public key? should be keypair
@@ -33,9 +39,6 @@ bottlenecks_cleanup()
echo "clean up image $image"
glance image-delete $iamge || true
done
-
- #FIX ME
- #nova flavor-delete yardstick-flavor &> /dev/null || true
}
bottlenecks_build_image()
@@ -49,16 +52,18 @@ bottlenecks_load_cirros_image()
{
echo "load bottlenecks cirros image"
- local image_file=/home/opnfv/images/cirros-0.3.3-x86_64-disk.img
+ wget http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -O /tmp/cirros.img
result=$(glance image-create \
--name cirros-0.3.3 \
--disk-format qcow2 \
--container-format bare \
- --file $image_file)
+ --file /tmp/cirros.img)
echo "$result"
- IMAGE_ID_CIRROS=$(echo "$output" | grep " id " | awk '{print $(NF-1)}')
+ rm -rf /tmp/cirros.img
+
+ IMAGE_ID_CIRROS=$(echo "$result" | grep " id " | awk '{print $(NF-1)}')
if [ -z "$IMAGE_ID_CIRROS" ]; then
echo 'failed to upload cirros image to openstack'
exit 1
@@ -106,7 +111,6 @@ main()
PUBLIC_NET_NAME=net04_ext
#need FIX
#IMAGE_FILE_NAME=""
- source $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
#bottlenecks_cleanup
#bottlenecks_build_image