Browse code

Switch to lioadm for centos cinder

Centos/RHEL 7 doesn't support tgtd. While the packages are still in
EPEL, there's no point in testing because nobody runs like this.
Switch cinder to use lioadm which uses LIO, and update package
installations.

Depends-On: I964917d13d9415223845ac17eb804ee7faceaf6f
Change-Id: Idc5a4e856bfc93e9dc650d565a98a8e9b3df3481

Ian Wienand authored on 2017/04/19 14:42:34
Showing 2 changed files
... ...
@@ -1,4 +1,5 @@
1 1
 iscsi-initiator-utils
2 2
 lvm2
3 3
 qemu-img
4
-scsi-target-utils # NOPRIME
4
+scsi-target-utils # not:rhel7,f24,f25 NOPRIME
5
+targetcli # dist:rhel7,f24,f25 NOPRIME
5 6
\ No newline at end of file
... ...
@@ -109,7 +109,16 @@ CINDER_VOLUME_CLEAR=$(echo ${CINDER_VOLUME_CLEAR} | tr '[:upper:]' '[:lower:]')
109 109
 # https://bugs.launchpad.net/cinder/+bug/1180976
110 110
 CINDER_PERIODIC_INTERVAL=${CINDER_PERIODIC_INTERVAL:-60}
111 111
 
112
-CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-tgtadm}
112
+# Centos7 switched to using LIO and that's all that's supported,
113
+# although the tgt bits are in EPEL we don't want that for CI
114
+if is_fedora; then
115
+    CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-lioadm}
116
+    if [[ ${CINDER_ISCSI_HELPER} != "lioadm" ]]; then
117
+        die "lioadm is the only valid Cinder iscsi_helper config on this platform"
118
+    fi
119
+else
120
+    CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-tgtadm}
121
+fi
113 122
 
114 123
 # Toggle for deploying Cinder under HTTPD + mod_wsgi
115 124
 CINDER_USE_MOD_WSGI=${CINDER_USE_MOD_WSGI:-False}
... ...
@@ -443,12 +452,10 @@ function init_cinder {
443 443
 function install_cinder {
444 444
     git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
445 445
     setup_develop $CINDER_DIR
446
-    if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
447
-        if is_fedora; then
448
-            install_package scsi-target-utils
449
-        else
450
-            install_package tgt
451
-        fi
446
+    if [[ "$CINDER_ISCSI_HELPER" == "tgtadm" ]]; then
447
+        install_package tgt
448
+    elif [[ "$CINDER_ISCI_HELPER" == "lioadm" ]]; then
449
+        install_package targetcli
452 450
     fi
453 451
 
454 452
     if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then