instance setup script 62/1362/2
authorMatthewLi <matthew.lijun@huawei.com>
Tue, 1 Sep 2015 12:01:33 +0000 (20:01 +0800)
committerMatthewLi <matthew.lijun@huawei.com>
Tue, 1 Sep 2015 12:06:07 +0000 (20:06 +0800)
BOTTLENECK-5

Change-Id: I87384205a47b4b395a97756eba59d073e8bde9fc
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
utils/infra_setup/README.rst [new file with mode: 0644]
utils/infra_setup/create_instances.sh [new file with mode: 0644]

diff --git a/utils/infra_setup/README.rst b/utils/infra_setup/README.rst
new file mode 100644 (file)
index 0000000..57b4947
--- /dev/null
@@ -0,0 +1,32 @@
+==================
+Infra Setup Guide
+==================
+
+This document gives the guide of how to set up the infrastructure for the use of bottlenecks test cases.
+
+create instances for the applications
+=====================================
+
+Firstly, there is a need to set up several instances for the applications which will be installed.
+
+The script create_instances.sh will set up several instances, the parameters used in this script can be obtained according to the following,
+
+Parameter $OPENRC_PATH is the path of where your admin-openrc.sh located, which includes the username and password of your openstack. Other parameters can be obtained under your openstack CLI as listed below,
+
++-------------+----------------------+
+| parameter   | commond line commond |
++=============+======================+
+| NET_ID      | neutron net-list     |
++-------------+----------------------+
+| FLAVOR_TYPE | nova flavor-list     |
++-------------+----------------------+
+| IMAGE_ID    | nova image-list      |
++-------------+----------------------+
+| SEC_GROUP   | nova secgroup-list   |
++-------------+----------------------+
+
+**Documentation tracking**
+
+Revision: _sha1_
+
+Build date:  _date_
diff --git a/utils/infra_setup/create_instances.sh b/utils/infra_setup/create_instances.sh
new file mode 100644 (file)
index 0000000..5d238c3
--- /dev/null
@@ -0,0 +1,32 @@
+##############################################################################
+# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
+# matthew.lijun@huawei.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+#! /usr/bin/env bash
+
+set -e
+
+THIS_DIR=`pwd`
+
+OPENRC_PATH=/opt/
+CREATE_INSTANCE_PATH=$THIS_DIR
+
+INSTANCE_NUM=3
+NET_ID=531c4557-7349-4984-8d5e-cceebb77205f
+FLAVOR_TYPE=m1.small
+IMAGE_ID=7c2f3e2b-cf6e-44ed-83ac-e87712167f9e
+SEC_GROUP=default
+INSTANCE_NAME=example_
+
+source $OPENRC_PATH/admin-openrc.sh
+cd $CREATE_INSTANCE_PATH
+for((count=1;count<=$INSTANCE_NUM;count++))
+do
+   INSTANCE_NAME_TMP=${INSTANCE_NAME}${count}
+   nova boot --nic net-id=${NET_ID} --flavor=${FLAVOR_TYPE} --image=${IMAGE_ID} --security_group=${SEC_GROUP} ${INSTANCE_NAME_TMP}
+done