forked from konono/openshift-fast-install
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path08_install_master.sh
executable file
·60 lines (51 loc) · 1.45 KB
/
08_install_master.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
#!/bin/bash
. ./setup.conf
ROLE=master
cp -p boot.ipxe.${ROLE} /usr/share/nginx/html/ipxe/boot.ipxe
for i in `seq 0 $((${MASTERS}-1))`; do
mac=$((i+2))
virt-install \
--name master-$i \
--hvm \
--virt-type kvm \
--pxe \
--arch x86_64 \
--os-type linux \
--os-variant rhel8.0 \
--network network=ocp,mac="52:54:00:00:01:0${mac}" \
--vcpus ${MCPU} \
--ram ${MRAM} \
--disk pool=default,size=${MDISK},format=qcow2,cache=unsafe \
--check disk_size=off \
--nographics \
--noautoconsole \
--boot menu=on,useserial=on
done
if [[ x$AUTOMATIC_INSTALL == xY ]]; then
VM_LST=$(seq 0 $((${MASTERS}-1)) | sed -e "s/^/${ROLE}-/g")
VM_RGX=$(echo $VM_LST | sed -e 's/ /|/g')
if [[ $(virsh list --name | egrep -c "${VM_RGX}") -ge 0 ]]; then
for N in $(virsh list --name | egrep "${VM_RGX}"); do
while true; do
virsh list | grep -q "${N}"|| break
sleep 5
echo -n .
done
done
fi
sleep 2
echo -en "\nInstall Done!\nRebooting..\n"
for N in ${VM_LST}; do
virsh start ${N}
done
for N in $(virsh list --name | egrep "${VM_RGX}"); do
while true; do
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null core@${N} exit 2>/dev/null && break
sleep 5
echo -n .
done
echo
done
echo "Reboot Done!"
fi
sh restore_boot.ipxe.sh ${ROLE}