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 ##############################################################################
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 }'`
16 fallocate -l $disksize $fueldisk
18 bootorder_hddvd fuel-master
20 addisofile fuel-master $isofile
22 virsh start fuel-master
25 echo "Waiting for Fuel master to accept SSH"
28 ssh root@10.20.0.2 date 2>/dev/null
35 # Wait until fuelmenu is up
36 echo "Waiting for fuelmenu to come up"
38 while [ -z "$menuPid" ]
40 menuPid=`ssh root@10.20.0.2 "ps -ef" 2>&1 | grep fuelmenu | grep -v grep | awk '{ print $2 }'`
44 # This is where we would inject our own astute.yaml
46 echo "Found menu as PID $menuPid, now killing it"
47 ssh root@10.20.0.2 "kill $menuPid" 2>/dev/null
49 # Wait until installation complete
50 echo "Waiting for bootstrap of Fuel node to complete"
53 ssh root@10.20.0.2 "ps -ef" 2>/dev/null \
54 | grep -q /usr/local/sbin/bootstrap_admin_node
61 echo "Waiting two minutes for Fuel to stabilize"