forked from skolekonov/fuel-kvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_fuel.sh
executable file
·49 lines (39 loc) · 929 Bytes
/
deploy_fuel.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
#!/bin/bash
source functions.sh
if [ $# -ne 2 ]
then
echo "Usage: $0 iso-path #nodes"
exit 1
fi
#Set virtual interfaces driver for VMs
#export net_driver=virtio
#Fuel master node
master_name=fuel-master #currently hardcoded in cleanup script
master_ram=3072
master_cpu=2
master_disk=50G
iso_path=$1
#Cluster nodes
node_name=fuel-slave #currently hardcoded in cleanup script
node_ram=3072
node_cpu=1
node_size=75G
node_count=$2
#Check and install required packages
check_packages
#Remove old VMs
remove_master
remove_slaves
#Deploy Fuel master node
./deploy_master.sh $iso_path $master_name $master_ram $master_cpu $master_disk || exit 1
#Start slaves
if [ $node_count -eq 0 ]; then
echo "WARNING: No slaves will be created"
else
echo "Starting slaves..."
for (( i=1; i<=$node_count; i++ ))
do
./deploy_slave.sh $node_name-$RANDOM $node_ram $node_cpu $node_size
done
fi
echo "Deployment was finished"