blob: dbdb96c5a1f78b1f6e347fb3adcc758f0c440888 [file] [log] [blame]
Alon Marxd178cf42014-07-30 23:44:33 +03001# Copyright 2014 IBM Corp.
2# Copyright (c) 2014 OpenStack Foundation
3# All Rights Reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16#
17# Authors:
18# Alon Marx <alonma@il.ibm.com>
19
20# lib/cinder_plugins/xiv
21# Configure the xiv_ds8k driver for xiv testing
22
23# Enable xiv_ds8k driver for xiv with:
24#
25# CINDER_ENABLED_BACKENDS+=,xiv:<volume-type-name>
26# XIV_DRIVER_VERSION=<version-string>
27# SAN_IP=<storage-ip-or-hostname>
28# SAN_LOGIN=<storage-admin-account>
29# SAN_PASSWORD=<storage-admin-password>
30# SAN_CLUSTERNAME=<cluster-name>
31# CONNECTION_TYPE=<connection-type> iscsi|fc
32# XIV_CHAP=<chap-type> disabled|enabled
33
34# Dependencies:
35#
36# - ``functions`` file
37# - ``cinder`` configurations
38
39# configure_cinder_backend_xiv - Configure Cinder for xiv backends
40
41# Save trace setting
42XIV_XTRACE=$(set +o | grep xtrace)
43set +o xtrace
44
45# Defaults
46# --------
47# Set up default directories
48
49
50# Entry Points
51# ------------
52
53# configure_cinder_backend_xiv - Set config files, create data dirs, etc
54function configure_cinder_backend_xiv {
55
56 local be_name=$1
57
58 python -c 'from xiv_ds8k_openstack.xiv_nova_proxy import XIVNovaProxy'
59 if [ $? -ne 0 ]; then
60 die $LINENO "XIV_DS8K driver is missing. Please install first"
61 fi
62
63 # For reference:
64 # XIV_DS8K_BACKEND='IBM-XIV_'${SAN_IP}'_'${SAN_CLUSTERNAME}'_'${CONNECTION_TYPE}
65 iniset $CINDER_CONF DEFAULT xiv_ds8k_driver_version $XIV_DRIVER_VERSION
66
67 iniset $CINDER_CONF $be_name san_ip $SAN_IP
68 iniset $CINDER_CONF $be_name san_login $SAN_LOGIN
69 iniset $CINDER_CONF $be_name san_password $SAN_PASSWORD
70 iniset $CINDER_CONF $be_name san_clustername $SAN_CLUSTERNAME
71 iniset $CINDER_CONF $be_name xiv_ds8k_connection_type $CONNECTION_TYPE
72 iniset $CINDER_CONF $be_name volume_backend_name $be_name
73 iniset $CINDER_CONF $be_name volume_driver 'cinder.volume.drivers.ibm.xiv_ds8k.XIVDS8KDriver'
74 iniset $CINDER_CONF $be_name xiv_ds8k_proxy 'xiv_ds8k_openstack.xiv_nova_proxy.XIVNovaProxy'
75 iniset $CINDER_CONF $be_name xiv_chap $XIV_CHAP
76}
77
78# Restore xtrace
79$XIV_XTRACE
80
81# Local variables:
82# mode: shell-script
83# End:
84