From a881b887211a6bc9ce24a9b42400dffe88abdb67 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 19 Apr 2017 15:42:34 +1000 Subject: [PATCH] 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 --- files/rpms/cinder | 3 ++- lib/cinder | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/files/rpms/cinder b/files/rpms/cinder index 0274642fd6..2c7b45baaf 100644 --- a/files/rpms/cinder +++ b/files/rpms/cinder @@ -1,4 +1,5 @@ iscsi-initiator-utils lvm2 qemu-img -scsi-target-utils # NOPRIME +scsi-target-utils # not:rhel7,f24,f25 NOPRIME +targetcli # dist:rhel7,f24,f25 NOPRIME \ No newline at end of file diff --git a/lib/cinder b/lib/cinder index 9fc25c75bb..3c182ccb26 100644 --- a/lib/cinder +++ b/lib/cinder @@ -109,7 +109,16 @@ CINDER_VOLUME_CLEAR=$(echo ${CINDER_VOLUME_CLEAR} | tr '[:upper:]' '[:lower:]') # https://bugs.launchpad.net/cinder/+bug/1180976 CINDER_PERIODIC_INTERVAL=${CINDER_PERIODIC_INTERVAL:-60} -CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-tgtadm} +# Centos7 switched to using LIO and that's all that's supported, +# although the tgt bits are in EPEL we don't want that for CI +if is_fedora; then + CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-lioadm} + if [[ ${CINDER_ISCSI_HELPER} != "lioadm" ]]; then + die "lioadm is the only valid Cinder iscsi_helper config on this platform" + fi +else + CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-tgtadm} +fi # Toggle for deploying Cinder under HTTPD + mod_wsgi CINDER_USE_MOD_WSGI=${CINDER_USE_MOD_WSGI:-False} @@ -443,12 +452,10 @@ function init_cinder { function install_cinder { git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH setup_develop $CINDER_DIR - if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then - if is_fedora; then - install_package scsi-target-utils - else - install_package tgt - fi + if [[ "$CINDER_ISCSI_HELPER" == "tgtadm" ]]; then + install_package tgt + elif [[ "$CINDER_ISCI_HELPER" == "lioadm" ]]; then + install_package targetcli fi if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then