Merge "JIRA:BGS-46 Updating the release-notes.rst with aligned language and more...
[genesis.git] / fuel / deploy / functions / install_iso.sh
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 # Recreate disk - needed for the reboot to work
12 fueldisk=`virsh dumpxml fuel-master | \
13   grep fuel-master.raw | sed "s/.*'\(.*\)'.*/\1/"`
14 disksize=`ls -l $fueldisk | awk '{ print $5 }'`
15 rm -f $fueldisk
16 fallocate -l $disksize $fueldisk
17
18 bootorder_hddvd fuel-master
19 sleep 3
20 addisofile fuel-master $isofile
21 sleep 3
22 virsh start fuel-master
23
24 # wait for node up
25 echo "Waiting for Fuel master to accept SSH"
26 while true
27 do
28   ssh root@10.20.0.2 date 2>/dev/null
29   if [ $? -eq 0 ]; then
30     break
31   fi
32   sleep 10
33 done
34
35 # Wait until fuelmenu is up
36 echo "Waiting for fuelmenu to come up"
37 menuPid=""
38 while [ -z "$menuPid" ]
39 do
40   menuPid=`ssh root@10.20.0.2 "ps -ef" 2>&1 | grep fuelmenu | grep -v grep | awk '{ print $2 }'`
41   sleep 10
42 done
43
44 # This is where we would inject our own astute.yaml
45
46 echo "Found menu as PID $menuPid, now killing it"
47 ssh root@10.20.0.2 "kill $menuPid" 2>/dev/null
48
49 # Wait until installation complete
50 echo "Waiting for bootstrap of Fuel node to complete"
51 while true
52 do
53   ssh root@10.20.0.2 "ps -ef" 2>/dev/null \
54     | grep -q /usr/local/sbin/bootstrap_admin_node
55   if [ $? -ne 0 ]; then
56     break
57   fi
58   sleep 10
59 done
60
61 echo "Waiting two minutes for Fuel to stabilize"
62 sleep 2m