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