[one-users] iscsi datastore with Dell Equallogic arrays -- partial solution hack

Francesco Camisa francesco.camisa at policlinicosanmarco.it
Thu Apr 19 22:01:14 PDT 2012


Hi,

even though I am a bit ashamed for the inelegance here it is what I have done so far.

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.

So far I had to hard-code the ip address of the equallogic arrays (TARGET_HOST). In the manuals I read that in the iscsi datastore definition is possible to pass the parameter: HOST which is described as follows "The tgt server host. Defaults to localhost". I am not sure how I can reference it in the /var/lib/one/remotes/tm/iscsi/ln script. 

The other modifications applied so far are those suggested by Jaime Miles which I quote thanking him again for the input:

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). 

With all this said I am happy to report that volumes are correctly linked and template instantiated.

Francesco Camisa
Vice Direttore Generale
Policlinico San Marco
via Zanotto 40
30173 Mestre-VE
Italy


More information about the Users mailing list