iSCSI datastore with Dell Equallogic arrays

Overview

This guide, pulled out from these two threads by Francesco Camisa: Import iscsi images and iscsi datastore with Dell Equallogic arrays -- partial solution hack, shows how to integrate the iSCSI datastore subsystem with Dell Equallogic arrays.

It's not meant as a definite solution, but a guide on how to achieve integration.

Guide

I modified this relevant parts of /var/lib/one/remotes/tm/iscsi/ln:

IQN=$SRC
TARGET=`arg_path $SRC`
DST_PATH=`arg_path $DST`
DST_HOST=`arg_host $DST`
DST_DIR=`dirname $DST_PATH`
 
BASE_IQN=`echo $IQN|$CUT -d: -f1`
TARGET=`echo $IQN|$CUT -d: -f2`
#LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'`
#VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'`
#TARGET_DEV="/dev/$VG_NAME/$LV_NAME"
TARGET_HOST=192.168.XXX.XXX
 
DISCOVER_CMD=$(cat <<EOF
    set -e
    mkdir -p $DST_DIR
    $SUDO $(iscsiadm_discovery "$TARGET_HOST")
    $SUDO $(iscsiadm_login "$IQN" "$TARGET_HOST")
    sleep 5
    DISK_EQL_MULTIPATH=/dev/mapper/eql-$TARGET
    ln -s "\$DISK_EQL_MULTIPATH" "$DST_PATH"
EOF
)

I had to modify the DISK_BY_PATH with DISK_EQL_MULTIPATH since we use Equallogic Multipath Host Integration Tools for linux which dramaticalliy increase performance.

General tips

Keep in mind that you need to be careful with the oneimage delete action. If you do oneimage delete, this snippet of code will get called: https://github.com/OpenNebula/one/blob/release-3.4/src/datastore_mad/remotes/iscsi/rm

RM_COMMAND=$(cat <<EOF
   $SUDO $(tgtadm_target_delete "$TID")
   $SUDO $LVREMOVE -f $VG_NAME/$LV_NAME
EOF
)
log "Removing $DST_HOST:$DEV from the image repository"
ssh_exec_and_log "$DST_HOST" "$RM_COMMAND" \
   "Error removing $DST_HOST:$DEV"

Which would fail. I suggest you can either substitute the iscsi/rm file with an a simple 'exit 0' and manually delete the image. Or you could modify it to really remove your device, which would be the best approach.

Also, I think it would be wise to substitute iscsi/mkfs with 'exit 1' so it will always fail since it won't be supported either (this will be called when doing 'oneimage create' for a TYPE = DATABLOCK image). Or same as before you could modify the script to really create an empty datablock. The same applies for the iscsi/cp command ('oneimage create' when using PATH). You could also modify it to really create an equallogic device.

If you do adapt the iscsi drivers to really take action on equallogic devices, so you can create a new image, an empty datablock and delete images, please let us know so we can upload the code to the ecosystem. The files you need to modify are:

Migration

Francesco Camisa has contributed this premigration script to log into the iscsi before performing the migration. It is made for OpenNebula 3.8.1.

#!/bin/bash
 
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             #
#                                                                            #
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
# not use this file except in compliance with the License. You may obtain    #
# a copy of the License at                                                   #
#                                                                            #
# http://www.apache.org/licenses/LICENSE-2.0                                 #
#                                                                            #
# Unless required by applicable law or agreed to in writing, software        #
# distributed under the License is distributed on an "AS IS" BASIS,          #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
# See the License for the specific language governing permissions and        #
# limitations under the License.                                             #
#--------------------------------------------------------------------------- #
# PREMIGRATE SOURCE DST remote_system_dir vmid dsid template
#  - SOURCE is the host where the VM is running
#  - DST is the host where the VM is to be migrated
#  - remote_system_dir is the path for the VM home in the system datastore
#  - vmid is the id of the VM
#  - dsid is the target datastore
#  - template is the template of the VM in XML and base64 encoded
 
# To access the vm_template you can use the xpath.rb utility. Check the
# datastore drivers for an example.
 
DST=$1
SRC=$2
RSD=$3
VMID=$4
DSID=$5
TMPL=$6
 
if [ -z "${ONE_LOCATION}" ]; then
    TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
else
    TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
fi
 
. $TMCOMMON
 
DRIVER_PATH=$(dirname $0)
 
source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf
 
TARGET_HOST=192.168.10.2
IQN=$(onevm show $VMID|grep SOURCE|cut -f2 -d "\""|cut -f1 -d "\"")
 
DISCOVER_CMD=$(cat <<EOF
    set -e
    $SUDO $(iscsiadm_discovery "$TARGET_HOST")
    $SUDO $(iscsiadm_login "$IQN" "$TARGET_HOST")
    sleep 10
EOF
)
 
ssh_exec_and_log "$DST" "$DISCOVER_CMD" \
        "Error registering $DST_HOST:$DEV"
exit 0
iscsi_dell_equallogic · Last modified: 2013/01/09 10:24 by Javi Fontan
Admin · Login