3 ################################################################################
4 # Copyright (c) 2019 AT&T Intellectual Property. #
5 # Copyright (c) 2019 Nokia. #
7 # Licensed under the Apache License, Version 2.0 (the "License"); #
8 # you may not use this file except in compliance with the License. #
9 # You may obtain a copy of the License at #
11 # http://www.apache.org/licenses/LICENSE-2.0 #
13 # Unless required by applicable law or agreed to in writing, software #
14 # distributed under the License is distributed on an "AS IS" BASIS, #
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
16 # See the License for the specific language governing permissions and #
17 # limitations under the License. #
18 ################################################################################
22 echo "Usage: $0 [ -n <number of VMs {1-99}> ][ -6 ]" 1>&2;
24 echo "n: Set the number of VMs that will be installed. This number must be between 1 and 99; " 1>&2;
25 echo "6: When set, VMs will be configured with an IPv6 interface" 1>&2;
30 while getopts ":n:6" o; do
33 if [[ ${OPTARG} =~ ^[0-9]+$ ]];then
34 if [ ${OPTARG} -ge 1 -a ${OPTARG} -le 15 ]; then
53 NUM_K8S_VMS=$(($vm_num - 1))
55 if [ "$NUM_K8S_VMS" -gt "0" ]; then
56 SEQ=$(seq -f %02g $NUM_K8S_VMS)
59 if [ -z "$WORKSPACE" ]; then
60 export WORKSPACE=`git rev-parse --show-toplevel`
62 PARTS_DIR=$WORKSPACE/tools/k8s/heat/parts
66 # Generated by scripts/gen-onap-oom-yaml.sh; MANUAL CHANGES WILL BE LOST
70 cat $PARTS_DIR/part-1${V6}.yaml
73 # the first node is master
74 #for VM_NUM in mst $(seq -f %02g $NUM_K8S_VMS); do
75 for VM_NUM in mst $SEQ; do
76 VM_TYPE=k8s HOST_LABEL=compute VM_NUM=$VM_NUM envsubst < $PARTS_DIR/part-2${V6}.yaml
80 cat $PARTS_DIR/part-3${V6}.yaml
82 #for VM_NUM in mst $(seq -f %02g $NUM_K8S_VMS); do
83 for VM_NUM in mst $SEQ; do
84 K8S_VM_NAME=k8s_$VM_NUM
87 description: The IP address of the ${K8S_VM_NAME} instance
88 value: { get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address] }