This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-cloud-kvm-iso.sh
executable file
·68 lines (55 loc) · 1.96 KB
/
create-cloud-kvm-iso.sh
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
#!/bin/bash
rm -rf /var/log/cloud-install.log
exec 1>/var/log/cloud-install.log 2>&1 # send stdout and stderr from rc.local to a log file
#set -x
. ./iso-functions.sh
. ./vm-configurations.sh
######### VM Counts
control_count=$(getVMCount "control")
network_count=$(getVMCount "network")
compute_count=$(getVMCount "compute")
monitoring_count=$(getVMCount "monitoring")
storage_count=$(getVMCount "storage")
### add vm's to array
vms=()
while [ "$control_count" -gt 0 ]; do
printf -v control_count_format "%02d" "$control_count"
echo "add vm to create string -> control$control_count_format"
vms+=("control$control_count_format")
control_count=$((control_count - 1))
done
while [ "$network_count" -gt 0 ]; do
printf -v network_count_format "%02d" "$network_count"
echo "add vm to create string -> network$network_count_format"
vms+=("network$network_count_format")
network_count=$((network_count - 1))
done
while [ "$compute_count" -gt 0 ]; do
printf -v compute_count_format "%02d" "$compute_count"
echo "add vm to create string -> compute$compute_count_format"
vms+=("compute$compute_count_format")
compute_count=$((compute_count - 1))
done
while [ "$monitoring_count" -gt 0 ]; do
printf -v monitoring_count_format "%02d" "$monitoring_count"
echo "add vm to create string -> monitoring$monitoring_count_format"
vms+=("monitoring$monitoring_count_format")
monitoring_count=$((monitoring_count - 1))
done
while [ "$storage_count" -gt 0 ]; do
printf -v storage_count_format "%02d" "$storage_count"
echo "add vm to create string -> storage$storage_count_format"
vms+=("storage$storage_count_format")
storage_count=$((storage_count - 1))
done
############ Build and push custom iso's for VM types
for d in "${vms[@]}"; do
echo "building and pushing ISO for $d"
buildAndPushVMTypeISO "$d"
done
#############################
wait
############# create setup vm
echo "creating openstack setup vm"
buildAndPushOpenstackSetupISO
########################