-
Notifications
You must be signed in to change notification settings - Fork 0
/
baremetal-rollback.scenario
77 lines (69 loc) · 2.21 KB
/
baremetal-rollback.scenario
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This file can be used directly by 'phd', see 'build-all.sh' in this
# directory for how it can be invoked. The only requirement is a list
# of nodes you'd like it to modify.
#
# The scope of each command-block is controlled by the preceeding
# 'target' line.
#
# - target=all
# The commands are executed on evey node provided
#
# - target=local
# The commands are executed from the node hosting phd. When not
# using phd, they should be run from some other independant host
# (such as the puppet master)
#
# - target=$PHD_ENV_nodes{N}
# The commands are executed on the Nth node provided.
# For example, to run on only the first node would be target=$PHD_ENV_nodes1
#
# We start with 3 (or more, up to 16) nodes running a minimal CentOS 6
#
# Tasks to be performed include:
# - setting up the required repositories from which to download Openstack and the HA-Addon
# - disabling firewalls and SElinux. This is a necessary evil until the proper policies can be written.
# - creating network bridges for use by VMs hosting OpenStack services
# - normalizing network interface names
# - fixing multicast
# - removing /home and making the root partition as large as possible to maximumize the amount of space available to openstack
#################################
# Scenario Requirements Section #
#################################
= VARIABLES =
#################################
# Scenario Requirements Section #
#################################
= REQUIREMENTS =
nodes: 9
######################
# Deployment Scripts #
######################
= SCRIPTS =
target=all
....
lvconvert --merge /dev/mapper/*baremetal_snap
....
target=local
....
# Reboot each node and wait for it to return
# disable set -e when calling phd_cmd_* because
# phd doesn't manage all return codes properly
set +e
for node in $(echo $PHD_ENV_nodes); do
phd_cmd_exec "reboot > /dev/null 2>&1" "$node"
phd_wait_connection 2400 $node || exit 1
done
....
target=all
....
# wait for the old snapshot to be merged/deleted
loop=0
while ! lvcreate -s -n baremetal_snap -l100%FREE /dev/mapper/*root; do
sleep 1
if [ "$loop" = 240 ]; then
echo "Unknown error waiting for old snap to be deleted/merged"
exit 1
fi
loop=$((loop + 1))
done
....