-
Notifications
You must be signed in to change notification settings - Fork 95
/
cinder.scenario
132 lines (104 loc) · 4.8 KB
/
cinder.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 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
#
# Tasks to be performed at this step include:
#################################
# Scenario Requirements Section #
#################################
= VARIABLES =
PHD_VAR_deployment
PHD_VAR_env_configdir
PHD_VAR_network_internal
#################################
# Scenario Requirements Section #
#################################
= REQUIREMENTS =
nodes: 1
######################
# Deployment Scripts #
######################
= SCRIPTS =
target=all
....
yum install -y openstack-cinder openstack-utils python-memcached nfs-utils python-keystonemiddleware
....
target=all
....
# Unfortunately https://bugzilla.redhat.com/show_bug.cgi?id=1175005
# prevents NFS mounts from succeeding by default prior to a reboot
systemctl daemon-reload
systemctl start rpcbind.service
systemctl start rpc-statd.service
# Now mount /srv so that we can use $PHD_VAR_env_configdir further down
if grep -q srv /etc/fstab; then
echo /srv is already mounted;
else
mkdir -p /srv
echo "${PHD_VAR_network_internal}.1:/srv /srv nfs defaults,v3 0 0" >> /etc/fstab
mount /srv
fi
....
target=all
....
openstack-config --set /etc/cinder/cinder.conf database connection mysql://cinder:cindertest@vip-mysql/cinder
openstack-config --set /etc/cinder/cinder.conf database max_retries -1
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host vip-keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name services
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password cindertest
openstack-config --set /etc/cinder/cinder.conf DEFAULT notification_driver messaging
openstack-config --set /etc/cinder/cinder.conf DEFAULT control_exchange cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_host vip-glance
openstack-config --set /etc/cinder/cinder.conf DEFAULT memcache_servers ${PHD_VAR_network_hosts_memcache}
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_hosts ${PHD_VAR_network_hosts_rabbitmq}
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_ha_queues true
# rhos6-cinder isn't the name of a real host or an IP
# Its the name which we should advertise ourselves as and for A/P it should be the same everywhere
openstack-config --set /etc/cinder/cinder.conf DEFAULT host rhos6-cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT osapi_volume_listen $(ip addr show dev eth1 scope global | grep dynamic| sed -e 's#.*inet ##g' -e 's#/.*##g')
openstack-config --set /etc/cinder/cinder.conf DEFAULT nfs_shares_config /etc/cinder/nfs_exports
openstack-config --set /etc/cinder/cinder.conf DEFAULT nfs_sparsed_volumes true
openstack-config --set /etc/cinder/cinder.conf DEFAULT nfs_mount_options v3
openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_driver cinder.volume.drivers.nfs.NfsDriver
# NOTE: this config section is to enable and configure the NFS cinder driver.
# Create the directory on the server
mkdir -p $PHD_VAR_env_configdir/cinder
cat > /etc/cinder/nfs_exports << EOF
${PHD_VAR_network_internal}.1:$PHD_VAR_env_configdir/cinder
EOF
chown root:cinder /etc/cinder/nfs_exports
chmod 0640 /etc/cinder/nfs_exports
....
target=$PHD_ENV_nodes1
....
su cinder -s /bin/sh -c "cinder-manage db sync"
# create services in pacemaker
pcs resource create cinder-api systemd:openstack-cinder-api --clone interleave=true
pcs resource create cinder-scheduler systemd:openstack-cinder-scheduler --clone interleave=true
# Volume must be A/P for now. See https://bugzilla.redhat.com/show_bug.cgi?id=1193229
pcs resource create cinder-volume systemd:openstack-cinder-volume
pcs constraint order start cinder-api-clone then cinder-scheduler-clone
pcs constraint colocation add cinder-scheduler-clone with cinder-api-clone
pcs constraint order start cinder-scheduler-clone then cinder-volume
pcs constraint colocation add cinder-volume with cinder-scheduler-clone
if [ $PHD_VAR_deployment = collapsed ]; then
pcs constraint order start keystone-clone then cinder-api-clone
fi
....