Merge "Change PTL informatin in INFO"
[bottlenecks.git] / utils / infra_setup / create_instances.sh
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 # matthew.lijun@huawei.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 #! /usr/bin/env bash
11
12 set -e
13
14 THIS_DIR=`pwd`
15
16 OPENRC_PATH=/opt/
17 CREATE_INSTANCE_PATH=$THIS_DIR
18
19 INSTANCE_NUM=3
20 NET_ID=531c4557-7349-4984-8d5e-cceebb77205f
21 FLAVOR_TYPE=m1.small
22 IMAGE_ID=7c2f3e2b-cf6e-44ed-83ac-e87712167f9e
23 SEC_GROUP=default
24 INSTANCE_NAME=example_
25
26 source $OPENRC_PATH/admin-openrc.sh
27 cd $CREATE_INSTANCE_PATH
28 for((count=1;count<=$INSTANCE_NUM;count++))
29 do
30    INSTANCE_NAME_TMP=${INSTANCE_NAME}${count}
31    nova boot --nic net-id=${NET_ID} --flavor=${FLAVOR_TYPE} --image=${IMAGE_ID} --security_group=${SEC_GROUP} ${INSTANCE_NAME_TMP}
32 done