-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathscript-04.sh
61 lines (50 loc) · 2.5 KB
/
script-04.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
#!/usr/bin/bash
TASK="Specify Storage Scale Cluster\n===> Target configuration: Single Node Cluster"
source /vagrant/install/common-preamble.sh
# Specify cluster name to 'demo'
echo "===> Specify cluster name"
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale config gpfs -c demo
# Disable callhome for demo environment
echo "===> Specify to disable call home"
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale callhome disable
# Specify nodes and its roles
echo "===> Specify nodes and their roles"
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale node add -a -g -q -m -n m1
# Show cluster specification
echo "===> Show cluster specification"
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale node list
# Specify NSDs and file systems
# ... for AWS
if [ "$PROVIDER" = "AWS" ]
then
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs fs1 /dev/xvdb /dev/xvdc /dev/xvdd
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs cesShared /dev/xvde /dev/xvdf
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com /dev/xvdg /dev/xvdh
fi
# ... for VirtualBox
if [ "$PROVIDER" = "VirtualBox" ]
then
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs fs1 /dev/sdb /dev/sdc /dev/sdd
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs cesShared /dev/sde /dev/sdf
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com /dev/sdg /dev/sdh
fi
# ... and Libvirt
if [ "$PROVIDER" = "libvirt" ]
then
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs fs1 /dev/vdb /dev/vdc /dev/vdd
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com -fs cesShared /dev/vde /dev/vdf
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd add -p m1.example.com /dev/vdg /dev/vdh
fi
# Reduce the amount of nodes to keep the Scale metadata size small
# Unfortunately this can not be changed using the installation toolkit, so patch it manually
sudo dnf -y install jq
tmp=$(sudo mktemp)
clusterdef=/usr/lpp/mmfs/$VERSION/ansible-toolkit/ansible/vars/scale_clusterdefinition.json
sudo jq '.scale_filesystem[].numNodes = "1"' $clusterdef > $tmp
sudo mv $tmp $clusterdef
# Show NSD specification
echo "===> Show NSD specification"
sudo /usr/lpp/mmfs/$VERSION/ansible-toolkit/spectrumscale nsd list
# Exit successfully
echo "===> Script completed successfully!"
exit 0