-
Notifications
You must be signed in to change notification settings - Fork 2
/
infortrend-cinder-volume-iscsi.yaml
executable file
·244 lines (204 loc) · 9.05 KB
/
infortrend-cinder-volume-iscsi.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
- job-template:
name: 'infortrend-cinder-volume-iscsi'
node: '{node}'
wrappers:
- timeout:
timeout: 300
fail: true
- timestamps
#properties:
# - build-blocker:
# use-build-blocker: true
# blocking-jobs:
# - "reset-iscsi-slave"
builders:
- link-logs
- net-info
- devstack-checkout
- shell: |
#!/bin/bash -xe
# environment variables
# TODO: check all these value are correct
export CINDER_CLONE_DRIVER=0
export CINDER_REPO=https://github.com/infortrend-openstack/infortrend-cinder-driver.git
export CINDER_DRIVER_BRANCH=master
export CINDER_DRIVER_DIR=/home/jenkins/eonstor-ds-cinder-driver
export IFT_RAID_BACKEND_NAME=infortrenddriver-1
export IFT_RAID_POOLS_NAME=LV-1
export IFT_RAID_LOG_IN=infortrend
export IFT_RAID_PASSWORD=drowssap
export IFT_RAID_IP=10.10.10.200
export IFT_RAID_CHL_MAP=4,5
export IFT_CLI_PATH=/opt/bin/Infortrend/raidcmd_ESDS10.jar
export IFT_CLI_RETRY=5
export IFT_CLI_TIMEOUT=60
export VOLUME_SCAN_RETRIES=15
export TEMPEST_NOVA_BUILD_TIMEOUT=1200
export DEVSTACK_BUILD_TIMEOUT=21600000 #360*60*1000(ms)
export DEVSTACK_LOG_FILE_PATH=/opt/stack/logs/*
export APACHE_LOG_PATH=/var/log/apache2
export RESET_SCRIPT_EXECUTE=0
export RESET_SCRIPT_DIR=/home/ift/Documents/reset_script
export IFT_CLI_CACHE=True
# infortrend storage link check
# ping -q -c1 $IFT_RAID_IP > /dev/null
until ping -q -c1 $IFT_RAID_IP > /dev/null
do
echo "Infortrend RAID not online yet, try again later.."
sleep 60 # wait raid ready
done
echo "Infortrend RAID online, keep going!"
# workaround 20151207: could not determine a suitable URL for the plugin
if [ -f /etc/openstack/clouds.yaml ]; then
sudo rm /etc/openstack/clouds.yaml
fi
if [ -f /opt/stack/new/.config/openstack/clouds.yaml ]; then
sudo rm /opt/stack/new/.config/openstack/clouds.yaml
fi
# install infortrend driver to cinder project, copy to workspace later
if [[ "$CINDER_CLONE_DRIVER" -eq "1" ]]; then
rm -rf $CINDER_DRIVER_DIR
git clone $CINDER_REPO $CINDER_DRIVER_DIR -b $CINDER_DRIVER_BRANCH
if [ ! -d "$CINDER_DRIVER_DIR" ]; then
echo "Not find infortrend driver"
exit 0
fi
fi
# setup pre_test_hook (It will pre hook before setup openstack environment)
function pre_test_hook {{
echo "Install infortrend driver libraries"
# If CINDER_CLONE_DRIVER set to 1, overwrite our driver!
if [[ "$CINDER_CLONE_DRIVER" -eq "1" ]]; then
rm -rf $BASE/new/cinder/cinder/volume/drivers/infortrend
mkdir -p $BASE/new/cinder/cinder/volume/drivers/infortrend
cp $CINDER_DRIVER_DIR/src/* $BASE/new/cinder/cinder/volume/drivers/infortrend -r
fi
#20170123 pull the Gerrit changes from zuul-merger
if [ -n "$ZUUL_REF" ]; then
temp_dir=$PWD
cd $BASE/new/cinder/
sudo git pull ift@master:/var/lib/zuul/git/$ZUUL_PROJECT $ZUUL_REF
cd $temp_dir
fi
echo "Configure the local.conf file to properly setup hp lefthand driver in cinder.conf"
cat <<EOF >$BASE/new/devstack/local.conf
[[local|localrc]]
CINDER_ENABLED_BACKENDS=$IFT_RAID_BACKEND_NAME
# Services
ENABLED_SERVICES=rabbit,mysql,key,tempest
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
#Neutron Services
ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
#Swift Services
#ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
#Glance Services
ENABLED_SERVICES+=,g-api,g-reg
#Cinder Services
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
#Horizon Services
ENABLED_SERVICES+=,horizon
# config cinder.conf
[[post-config|\$CINDER_CONF]]
[DEFAULT]
enabled_backends=$IFT_RAID_BACKEND_NAME
default_volume_type=$IFT_RAID_BACKEND_NAME
num_volume_device_scan_tries=$VOLUME_SCAN_RETRIES
[infortrenddriver-1]
volume_driver=cinder.volume.drivers.infortrend.infortrend_iscsi_cli.InfortrendCLIISCSIDriver
volume_backend_name=$IFT_RAID_BACKEND_NAME
infortrend_pools_name=$IFT_RAID_POOLS_NAME
san_ip=$IFT_RAID_IP
infortrend_slots_a_channels_id=$IFT_RAID_CHL_MAP
infortrend_slots_b_channels_id=""
infortrend_cli_path=$IFT_CLI_PATH
infortrend_cli_max_retries=$IFT_CLI_RETRY
infortrend_cli_timeout=$IFT_CLI_TIMEOUT
infortrend_cli_cache=$IFT_CLI_CACHE
num_volume_device_scan_tries=$VOLUME_SCAN_RETRIES
#infortrend_provisioning=0
#infortrend_tiering=0,2
#san_login=$IFT_RAID_LOG_IN
#san_password=$IFT_RAID_PASSWORD
# Use post-extra because the tempest configuration file is
# overwritten with the .sample after post-config.
[[post-extra|\$TEMPEST_CONFIG]]
[volume]
storage_protocol=iSCSI
vendor_name=Infortrend
[compute]
build_timeout=$TEMPEST_NOVA_BUILD_TIMEOUT
#Other services that do not define build_timeout will inherit this value
[compute-feature-enabled]
attach_encrypted_volume=false
[volume-feature-enabled]
backup=false
#multi_backend = false
#snapshot = true
#clone = true
#api_extensions = all
#api_v1 = true
#api_v2 = true
#api_v3 = false
#bootable = true
#volume_services = false
EOF
# echo "Configure localrc file to properly setup CINDER_ENABLED_BACKENDS"
# cat <<EOF >>$BASE/new/devstack/localrc
#CINDER_ENABLED_BACKENDS=$IFT_RAID_BACKEND_NAME
#EOF
# set FORCE=yes to prevent not support DISTRO
#sudo sed -i 's/vivid|/vivid|wily|/g' $BASE/new/devstack/stack.sh
}}
export -f pre_test_hook
# To keep our CINDER_ENABLED_BACKENDS configuration in localrc
export KEEP_LOCALRC=true
# setup TEMPEST environment variables
export PYTHONUNBUFFERED=true
#export DEVSTACK_GATE_TIMEOUT=180 ---2016/2/5 change to BUILD_TIMEOUT in milliseconds
export BUILD_TIMEOUT=$DEVSTACK_BUILD_TIMEOUT
export DEVSTACK_GATE_TEMPEST=1
#export DEVSTACK_GATE_TEMPEST_REGEX="volume"
#20160923 skip all tempest scenario tests
#export 'DEVSTACK_GATE_TEMPEST_REGEX=^(?=.*volume*)(?!tempest.scenario.*)'
#We don't support manage/unmanage snapshots
export 'DEVSTACK_GATE_TEMPEST_REGEX=^(?=.*volume)(?!.*test_unmanage_manage_snapshot)'
# set tempest concurrency to ?
export TEMPEST_CONCURRENCY=1
# Let's use the http protocol instead of git protocol
export GIT_BASE="https://review.openstack.org/p"
if [ -z "$ZUUL_PROJECT" ]; then
export ZUUL_PROJECT=openstack/cinder
fi
if [ -z "$ZUUL_BRANCH" ]; then
export ZUUL_BRANCH=master
fi
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
# in safe-devstack-vm-gate-wrap, move logs to jenkins workspace
sed -i 's#exit_handler $RETVAL# \
sudo mv $BASE/logs/* $WORKSPACE/logs \
if [[ "$RESET_SCRIPT_EXECUTE" -eq "1" ]]; then \
sudo python $RESET_SCRIPT_DIR/reset.py \
java -jar $RESET_SCRIPT_DIR/raidcmd_ESDS10.jar $IFT_RAID_IP reset controller -y \
fi \
sudo rm $PWD/logs/libvirt/libvirtd.log* \
sudo rm -rf $BASE/new/* \
exit_handler $RETVAL#g' safe-devstack-vm-gate-wrap.sh
#2017/04/05 fix bug for functions.sh line:521
sed -i 's# local cache_dir=$BASE/cache/files/# local cache_dir=$BASE/cache/files/\
sudo mkdir -p $cache_dir\
sudo chown -R $USER:$USER $cache_dir#g' devstack-gate/functions.sh
# clear log if exist previous job's log
sudo rm -rf $DEVSTACK_LOG_FILE_PATH
sudo rm -rf $APACHE_LOG_PATH
sudo mkdir $APACHE_LOG_PATH
# execute jobs!
./safe-devstack-vm-gate-wrap.sh
#- trigger-builds:
# - project: "reset-iscsi-slave"
# block: false
publishers:
#- reset-iscsi-slave-node
#- wait-reset-iscsi
- review-devstack-logs
- review-console-log
- post-build-iscsi