-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconf
289 lines (234 loc) · 7.84 KB
/
conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
### General variables.
# Project name.
# This will be used for files and folder names.
PROJECT="coti"
# Help message
HELP="
Before running the script, make sure that conf is updated and the steps in
the script itself suits your needs.
./run will start its thing and its expecting access to internal resources.
There is no reason to think it will work outside the internal network.
Parameters:
clean: Cleans the system of _any_ virtual resource.
host: Host preparation, making sure the host and resources are ready.
uc-prep: Prepares the undercloud machine for undercloud installation.
uc-inst: Install the unercloud and some tweaks.
uc-post: Runs post installation tasks.
oc-prep: Overcloud preperations (images, containers, flavors etc').
oc-depl: Overcloud deployment.
oc-post: Runs post deployment tasks.
bnr: Backup and restore, this will backup the undercloud machine and
restore onto a new undercloud. It needs a running deployment.
tests: Run tests from the tests folder on a deployment.
full: Aims to deploy a working environment.
once: Run a single function.
func-ls List all funtions.
until: Run steps from clean to the required step (including).
For instance, prepare a system but don't run undercloud deploy:
'./run until oc-prep'.
For a full deployment:
./run clean
./run host
./run uc-prep
./run uc-inst
./run uc-post
./run oc-prep
./run oc-depl
./run oc-post
Or ./run full
"
# Starting location, used to resolve paths.
CWD=$(pwd)
# The script works here.
# It is deleted and recreated in each run.
WORK_DIR="/$CWD/workdir"
# Shortcut to the tripleo heat templates.
THT="/usr/share/openstack-tripleo-heat-templates"
# Shortcut to libvirt's image folder.
VIRT_IMG="/var/lib/libvirt/images"
# Log file
BASE_LOG_FILE="$(pwd)/logs/$PROJECT-$(date +%H%M%S)"
# Selinux enabled or disabled during undercloud installation
UNDER_SEL="false"
# Selinux state on the overcloud.
OVER_SEL="permissive"
# Undercloud admin password
ADMIN_PASSWORD="12345678"
# Base path to EPEL
EPEL="https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages"
# Messge to display on long operations
LONG="(This step takes time.)"
# RPM location of latest rhos-release
LATEST_RR="http://download.eng.bos.redhat.com/rcm-guest/puddles/OpenStack/rhos-release/rhos-release-latest.noarch.rpm"
# TODO:
# I need to fix this part to search for specific puddles.
# Version to install deploy.
OS_VER=14
PUDDLE_VER="latest"
# Argument to pass to rhos-release.
RR_CMD="$OS_VER"
# Do we obtain images from predefined images or do we create our own.
# prepare_puddle_images - create our own.
# edit_predefined_images - edit images from RPM.
# predefined_images - use untouched images from RPM.
OBTAIN_IMAGES="predefined_images"
# Do images and proto gets updated to the latest bits from the repos.
UPDATE_IMAGE=true
# Is the Overcloud deployeds via UI? If so you want to stop this script after
# the overcloud pre-deploy stage and skip introspection.
VIA_UI=false
# DNS to be used.
# The default here is to use the host's configuration.
DNS=$(grep nameserver /etc/resolv.conf | head -n 1 | cut -d " " -f 2)
# Host default nic.
NIC=$(ip route get $DNS | grep dev | awk '{print $5}')
# Hostname's FQDN
HOST_NAME=$(hostnamectl --static)
# Host IP.
HOST_IP=$(ifconfig $NIC | grep "inet " | awk '{print $2}')
# Host root password.
HOST_PASS="12345678"
# virt-customize arguments.
VIRSH_CUST="-m 8192 --smp 6 -q"
# SSH arguments.
SSH_CUST="/usr/bin/ssh -qtt -o StrictHostKeyChecking=no"
# Package management arguments.
PKG_CUST="yum -q -y"
# Installing Telemetry, its false by default.
USE_TELEMETRY=true
# RHOS docker registry
RHOS_REG="docker-registry.engineering.redhat.com"
# CEPH docker registry
CEPH_REG="brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888"
# Letters array
LETTERS=( "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" )
### File server location.
### This is were the script gets stuff like guest images,
### and also where it keeps modified ones.
# Server to download images from.
FILE_SERVER="http://ikook.tlv.redhat.com"
# Server's domain.
SRV_DOMAIN=${FILE_SERVER##*://}
# RHEL guest image.
RHEL_VERSION="7.6"
RHEL_GUEST="$FILE_SERVER/gen_images/cloud/rhel-guest-image-${RHEL_VERSION}-239.x86_64.qcow2"
GUEST_FILE=$(basename $RHEL_GUEST)
# Director image RPMs path.
OC_IMAGES="$FILE_SERVER/rpms/rhos$OS_VER/rhosp-director-images-$OS_VER-latest.rpm"
OC_IPA="$FILE_SERVER/rpms/rhos$OS_VER/rhosp-director-images-$OS_VER-ipa-latest.rpm"
# Path to the folder that contains all the repos
AUTO_PATH="$FILE_SERVER/auto"
# Guest image time zone.
# The default is taken from the host's.
GUEST_TZ=$(timedatectl | grep "Time zone" | awk '{print $3}')
# How and where to upload images.
UPLOAD_URL="${SRV_DOMAIN}:/home/ftp/auto"
UPLOAD_DIR=${UPLOAD_URL##*:}
UPLOAD_USER="rhos-qe"
UPLOAD_PASS="qum5net"
# Nodes and undercloud's root password.
ROOT_PASS="12345678"
# NTP server to be used.
# Default is taken from the host.
NTP=$(grep "'^server'\|iburst" /etc/ntp.conf | cut -d " " -f 2 | head -n 1)
# Backup and restore. Starting Liberty, a backing up and restore mechanism for the
# Undercloud node was created. If set to true here, undercloud-0 will be backed-up,
# destroyed and undercloud-1 will be installed with all the settings and data.
BCK_RES=true
### Nodes and per node settings.
# Node names.
# Nodes will be _defined_ in this order.
# Keep undercloud first!
NODES=(
"undercloud"
"controller"
"compute"
"ceph"
)
# Network setup per node.
# Always keep provisioning network first and the external network last.
# First network will be 10.10.0.1, second 10.20.0.1 ...
NETWORKS=(
"ControlPlane"
"StorageIP"
"StorageMGT"
"Internal"
"Tenant"
"External"
)
# Undercloud's local interface and host adresses, this is a new internel net.
LOCAL_INTERFACE="eth0"
# We need only the first three octates.
if [ $OS_VER -gt 11 ]
then
CIDR="192.168.0"
else
CIDR="192.0.2"
fi
LOCAL_IP="${CIDR}.1/24"
PUBLIC_HOST="${CIDR}.2"
ADMIN_HOST="${CIDR}.3"
# External network IP range. This is needed to attach an IP for accessing the
# nodes externally bypassing some limitations caused from network isolation.
# There is a pair of ranges, one for internal access and one for external.
# The number here represent the final (rightmost) notation.
# '.1' is reserved for the gateway.
# Introspection IPs are in the same CIDR but have a differnt range.
DHCP_OUT_START=2
DHCP_OUT_END=90
DHCP_IN_START=92
DHCP_IN_END=180
DHCP_INTRO_START=181
DHCP_INTRO_END=250
# Node numbers and settings.
# !! The base name needs to be the same as the node names in the NODES array.
# NAM - Name of the node.
# FLV - Flavor to be used for nodes.
# NUM - How many of that node.
# RAM - RAM in MB.
# SWP - SWAP in MB.
# CPU - How many vCPU.
# DUM - Extra (Dummy) nodes of the same type.
# DSK - Size of disk in GB. Nodes can work with 12, Undercloud needs 30.
# OSD - Ceph specific, this is the size for the Ceph OSD.
# SDX - How many disks (SDx's) per node. Ceph needs 6: 1 for root and 5 OSDs.
# undercloud nodes
undercloud_NAM="undercloud"
undercloud_NUM=1
undercloud_RAM=32768
undercloud_SWP=256
undercloud_CPU=6
undercloud_DUM=0
undercloud_DSK=64
undercloud_SDX=1
# controller nodes
controller_NAM="controller"
controller_FLV="controller"
controller_NUM=3
controller_RAM=32768
controller_SWP=256
controller_CPU=4
controller_DUM=0
controller_DSK=64
controller_SDX=1
# compute nodes
compute_NAM="compute"
compute_FLV="compute"
compute_NUM=2
compute_RAM=32768
compute_SWP=256
compute_CPU=6
compute_DUM=0
compute_DSK=64
compute_SDX=1
# ceph nodes
ceph_NAM="ceph"
ceph_FLV="ceph"
ceph_NUM=1
ceph_RAM=8192
ceph_SWP=256
ceph_CPU=6
ceph_DUM=0
ceph_DSK=12
ceph_SDX=6
TOT_NODES=$(( controller_NUM + compute_NUM + ceph_NUM ))