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

Jaime Melis jmelis at opennebula.org
Fri Apr 20 03:35:56 PDT 2012


Hi Francesco,

that's great news. I'm glad it worked out. I understand it's a big task to
integrate these drivers, so I'm happy to learn that you made it work.

In order to guide people if they have questions on this subject, we have
created the "iSCSI datastore with Dell Equallogic arrays" article in
http://wiki.opennebula.org/#images_and_storage

Please feel free to modify it and improve it.

Regarding your question:

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.


This is a very good question actually. There's no simple way to do this in
3.4.0, but there's a really nice way to do this in the upcoming 3.4.1
release (it will be realeased next week or so) , because we realised it
would be nice to be able to access template values of the datastore or of
the VM from the TM scripts, which is exactly what you want. So what we did
is to add the VM id and the DATASTORE id as parameters to all of the TM
scripts, which means that in particular, for the 'ln' scripts $3 will be
the VM_ID and $4, will be the DATASTORE_ID.

In your particular case you want to look up the 'TARGET_HOST' parameter of
the datastore template, so you can use it inside your TM script. What you
will need to do is from within the 'ln' script do 'onedatastore show
$DATASTORE_ID' => process it and extract the "TARGET_HOST" attribute.

We have done something similar with the upcoming lvm drivers, so you may
want to take a look:
https://github.com/OpenNebula/one/blob/one-3.4/src/tm_mad/lvm/clone
In that script you can see how we extracted 'SIZE' from "onevm show -x".
You would need to do something similar replacing "SIZE" with "TARGET_HOST"
and onevm with onedatastore.

However, if you only have a single TARGET_HOST for all the datastores, I
reckon it's ok to keep it hardcoded :-)

Thank you for your feedback, it really helps us to know what difficulties
or challenges people find when integrating OpenNebula to their
infrastructure.

cheers,
Jaime

On Fri, Apr 20, 2012 at 7:01 AM, Francesco Camisa <
francesco.camisa at policlinicosanmarco.it> wrote:

> 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
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Jaime Melis
Project Engineer
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | jmelis at opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120420/f57ae6bb/attachment-0003.htm>


More information about the Users mailing list