Home » VTL Open Source sobre iSCSI

VTL Open Source sobre iSCSI

La instalación se hará en cuatro fases:

 

1.- Obtener las fuentes del núcleo de Linux

2.- Compilar un núcleo con el proyecto SCST

3.- Compilar proyecto mhvtl

4.- Configurar dispositivos para mhvtl



El escenario:

Se ha elegido la instalación sobre un Sistema Operativo Centos versión 5.4 de 64 bits. En nuestro AA Labs hemos elegido una máquina virtual  hospedada en un VMWARE Server sobre OpenSuse 11.2.

1.- Obtener las fuentes del núcleo de Linux

Documentación:

Wiki CentOS: http://wiki.centos.org/HowTos/I_need_the_Kernel_Source

Foros de nimsa

Procedimiento:

Instalar entorno de compilación y todos los paquetes necesitados para las cuatro fases junto con todas sus dependencias:

# yum install make gcc hmaccalc openssl openssl-devel zlib-devel lsscsi mt-st mtx rpm-build redhat-rpm-config unifdef kernel-headers subversion

Crear usuario vtl y asignar contraseña:

# useradd vtl
# passwd vtl

 

Crear directorios /opt/mhvtl y /etc/mhvtl y se hace propietario a nuevo usuario:

# mkdir /opt/mhvtl
# chown -Rf vtl:vtl /opt/mhvtl

# mkdir /etc/mhvtl
# chown -Rf vtl:vtl /etc/mhvtl

Loguearse como usuario vtl:

#su – vtl

Conocer la versión del núcleo Linux que corre en tu sistema:

$ uname -a

Linux centos.ferras.local 2.6.18-194.3.1.el5 #1 SMP Thu May 13 13:08:30 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

Desempaquetar y preparar los archivos Fuentes:

[vtl@centos ~]$ cd

[vtl@centos ~]$ mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

[vtl@centos ~]$ echo '%_topdir %(echo $HOME)/rpmbuild' > .rpmmacros

Descargar el paquete de Fuentes que corresponde a la versión de Kernel de tu CentOS/RHEL desde aquí e instalarlo:

$ rpm -i http://mirror.centos.org/centos/5/updates/SRPMS/kernel-2.6.18-194.3.1.el5.src.rpm

$ cd ~/rpmbuild/SPECS

$ rpmbuild -bp --target=`uname -m` kernel-2.6.spec

 

Comprobar que el árbol de fuentes del kernel esté en /home/vtl/rpmbuild/BUILD/:

 

$ ls ~/rpmbuild/BUILD/

kernel-2.6.18[vtl@centos SPECS]$ cp -Rf /home/vtl/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 /usr/src/kernels/

Copiarlos como root a /usr/src/kernels:

 

#cp -Rf /home/vtl/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 /usr/src/kernels/

2.- Compilar un núcleo con el proyecto SCST

Documentación:

Howto ISCSI-SCST: http://iscsi-scst.sourceforge.net/iscsi-scst-howto.txt

Foros de nimsa

Procedimiento:

Como usuario root descargar proyecto scst con subversion y añadir los parches indicados:

# cd /root

# svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst

# cd /usr/src/kernels/linux-2.6.18.x86_64

# patch -p1 < /root/scst/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch

# patch -p1 < /root/scst/scst/kernel/scst_exec_req_fifo-2.6.18.patch

Compilar la imagen del kernel:

# make clean
# make && make modules
# make modules_install && make install

Comprobar que ha creado entrada el el grub de nuevo kernel vmlinuz-2.6.18-prep:

# cat /boot/grub/menu.lst

(…)

title CentOS (2.6.18-prep)

root (hd0,0)

kernel /vmlinuz-2.6.18-prep ro root=/dev/VolGroup00/LogVol00

initrd /initrd-2.6.18-prep.img

Reiniciar sistema con nuevo kernel y comprobarlo:

# uname -a

Linux centos.ferras.local 2.6.18-prep #1 SMP Thu May 20 21:13:48 CEST 2010 x86_64 x86_64 x86_64 GNU/Linux

Crear e instalar módulo scst:

#cd /root/scst
#make scst scst_install iscsi iscsi_install scstadm scstadm_install

3.- Compilar proyecto mhvtl

Documentación:

Proyecto Linux Virtual Tape Library

Foros de nimsa

Procedimiento:

Descargar proyecto mhvl en formato tgz desde aquí, se ha elegido la versión de desarrollo mhvtl-2010-05-08 (0.18-7):

# wget http://sites.google.com/site/linuxvtl2/mhvtl-2010-05-08.tgz?attredirects=0

Descomprimir y compilar:

# tar xzvf mhvtl-2010-05-08.tgz

# cd mhvtl-0.18/

# make distclean

# cd kernel

# make

# make install

# cd ..

#make

# make install

4.- Configurar dispositivos para mhvtl

 

Documentación:

Foros de nimsa

Procedimiento:

En el foro de nimsa se ha publicado un script para la creación automática de los ficheros de configuración iscsi-scstd.conf y scst.conf. De esta forma crea una configuración particular de librerías y drives emulados por iSCSI:

[root@centos ~]# cat make_scst_config.sh

#!/bin/ksh

# Customize your own

IQN=iqn.2010-05.es.ferras

# Build /etc/iscsi-scstd.conf

lsscsi -g | grep -e tape -e mediumx| awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each; do

echo "Target $IQN:$each" >>/tmp/iscsi-scstd.tmp

done

if [ -f /etc/iscsi-scstd.conf ]; then

cp -f /etc/iscsi-scstd.conf /etc/iscsi-scstd.conf_`date +%m%d%y%H%M%S`

echo Created backup of existing /etc/iscsi-scstd.conf as /etc/iscsi-scstd.conf_`date +%m%d%y%H%M%S`

fi

cat /tmp/iscsi-scstd.tmp >/etc/iscsi-scstd.conf

echo Created new /etc/iscsi-scstd.conf

rm -f /tmp/iscsi-scstd.tmp

echo ——-

# Build /etc/scst.conf

echo "[HANDLER changer]" >/tmp/scst.tmp

lsscsi -g| grep mediumx | awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each1; do

echo DEVICE $each1 >>/tmp/scst.tmp

done

echo "[HANDLER tape]" >>/tmp/scst.tmp

lsscsi -g| grep tape | awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1 | while read each2; do

echo DEVICE $each2 >>/tmp/scst.tmp

done

lsscsi -g | grep -e tape -e mediumx|awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each3; do

echo "[GROUP Default_$IQN:$each3]" >>/tmp/scst.tmp

done

lsscsi -g | grep -e tape -e mediumx| awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each4; do

echo "[ASSIGNMENT Default_$IQN:$each4]" >>/tmp/scst.tmp

echo "DEVICE $each4,0" >>/tmp/scst.tmp

done

if [ -f /etc/scst.conf ]; then

cp -f /etc/scst.conf /etc/scst.conf_`date +%m%d%y%H%M%S`

echo Created backup of  existing /etc/scst.conf as /etc/scst.conf_`date +%m%d%y%H%M%S`

fi

cat /tmp/scst.tmp >/etc/scst.conf

echo Created new /etc/scst.conf

rm -f /tmp/scst.tmp

echo — Done —

Ejecutarlo:

# sh make_scst_config.sh

Arrancar mhvtl:

/etc/init.d/mhvtl start

Cargar los módulos scst:

modprobe scst
modprobe scst_tape
modprobe scst_changer

Si hemos llegado hasta aquí sin errores deberíamos ver los nuevos dispositivos SCSI del sistema:

# lsscsi

[0:0:0:0]    disk    VMware,  VMware Virtual S 1.0   /dev/sda

[1:0:0:0]    mediumx SPECTRA  PYTHON           550V  –

[1:0:1:0]    tape    IBM      ULT3580-TD4      550V  /dev/st0

[1:0:2:0]    tape    IBM      ULT3580-TD4      550V  /dev/st1

[1:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2

[1:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3

[1:1:0:0]    mediumx SPECTRA  PYTHON           550V  –

[1:1:1:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4

[1:1:2:0]    tape    IBM      ULT3580-TD4      550V  /dev/st5

[1:1:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st6

[1:1:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st7

# cat /proc/scsi_tgt/scsi_tgt

Device (host:ch:id:lun or name)                             Device handler

0:0:0:0                                                     dev_disk

1:0:1:0                                                     dev_tape

1:0:2:0                                                     dev_tape

1:0:3:0                                                     dev_tape

1:0:4:0                                                     dev_tape

1:1:1:0                                                     dev_tape

1:1:2:0                                                     dev_tape

1:1:3:0                                                     dev_tape

1:1:4:0                                                     dev_tape

1:0:0:0                                                     dev_changer

1:1:0:0                                                     dev_changer

Una comprobación de que los targets iSCSI están correctamente levantados puede ser la siguiente: Desde un Windows XP con el initiator iSCSI instalado se hace un scan a la IP del servidor mhvtl. Se deberán detectar todos los dispositivos iSCSI:

initiator xp

Y desde el  Administrador de dispositivos:

El el siguiente capítulo vamos a poner a prueba la mhvtl creada desde un software de backup, Symantec Backup Exec.

4 Responses to “VTL Open Source sobre iSCSI”

  1. What i do not realize is actually how you are no longer really a lot more
    neatly-liked than you may be right now. You are very intelligent.
    You know thus considerably in terms of this topic, produced me personally imagine
    it from numerous numerous angles. Its like women and men are not interested except it is one thing to do with Girl gaga!
    Your own stuffs great. At all times care for it up!

  2. Very nice post. I just stumbled upon your weblog and wanted
    to mention that I’ve really loved surfing around your blog posts.

    After all I will be subscribing to your feed and I hope you write again very soon!

  3. hi!,I love your writing very a lot! proportion we be in contact more approximately your article on AOL?
    I require a specialist on this area to resolve my problem.

    May be that is you! Having a look forward to look you.

  4. Right away I am going to do my breakfast, later than having my breakfast coming yet again to read additional news.

  5. Attractive section of content. I just stumbled upon your website and in accession capital to assert that I get actually enjoyed
    account your blog posts. Anyway I’ll be subscribing to your feeds and even I achievement you access
    consistently quickly.

  6. I’m really inspired together with your writing talents and also with the structure
    to your blog. Is this a paid theme or did you modify it your self?
    Either way stay up the excellent quality writing, it’s rare to see a
    nice blog like this one today..

  7. mttcoin.com dice:

    Hello! Someone in my Facebook group shared this website with us so
    I came to check it out. I’m definitely loving the information. I’m
    bookmarking and will be tweeting this to my followers!
    Excellent blog and brilliant style and design.

  8. I have read so many posts regarding the blogger lovers except this paragraph is really a fastidious article, keep it up.

  9. discuss dice:

    It’s an remarkable post in favor of all the online visitors; they will take advantage from it I am sure.

  10. 25565 dice:

    I’m truly enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your
    theme? Excellent work!

  11. At this moment I am going away to do my breakfast, after having my breakfast coming over again to read
    more news.

  12. Fantastic beat ! I would like to apprentice while you amend your
    website, how can i subscribe for a blog website?
    The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

  13. Excellent blog here! Also your web site so much up very fast!
    What web host are you the usage of? Can I get your associate link in your host?

    I want my site loaded up as quickly as yours lol

  14. Hello my family member! I wish to say that this article is amazing, great written and
    include approximately all important infos.
    I would like to see more posts like this .

  15. If some one desires to be updated with latest technologies therefore he must be go to see this website and be up to date all the time.

  16. After looking over a handful of the blog articles on your web page,
    I really appreciate your way of writing a blog.
    I added it to my bookmark webpage list and will be checking back in the
    near future. Please visit my website too and tell me your opinion.

  17. I am really impressed with your writing skills and also with the layout on your blog.
    Is this a paid theme or did you customize it yourself?
    Either way keep up the excellent quality writing, it is rare to
    see a great blog like this one these days.

  18. Excellent beat ! I would like to apprentice while you
    amend your web site, how can i subscribe
    for a blog web site? The account aided me a acceptable deal.
    I had been a little bit acquainted of this your broadcast provided bright clear concept

  19. Its like you read my mind! You appear to know so
    much about this, like you wrote the book in it or something.

    I think that you could do with some pics to drive the message home a bit, but other
    than that, this is great blog. An excellent read.
    I’ll definitely be back.

  20. Write more, thats all I have to say. Literally, it seems as though you relied on the video
    to make your point. You definitely know what youre talking
    about, why waste your intelligence on just posting videos to your site when you could be giving
    us something informative to read?

  21. Attractive element of content. I just stumbled upon your blog
    and in accession capital to claim that I acquire actually enjoyed account your blog posts.
    Any way I’ll be subscribing on your feeds or even I fulfillment you get entry to consistently fast.

  22. Thanks designed for sharing such a nice idea, post is nice,
    thats why i have read it entirely

  23. I always used to study paragraph in news papers but now as I am a user of internet thus from now I am using net for articles, thanks
    to web.

  24. brnk.in.ua dice:

    Hey! I could have sworn I’ve been to this website before but after checking through some
    of the post I realized it’s new to me. Anyways, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

  25. Thanks for your marvelous posting! I truly enjoyed reading it, you might be a great author.
    I will always bookmark your blog and will often come
    back from now on. I want to encourage that you continue
    your great work, have a nice morning!

  26. We are a gaggle of volunteers and starting a brand
    new scheme in our community. Your web site offered us with helpful info to work
    on. You have performed a formidable activity and our entire community will likely be grateful to you.

  27. Hi there would you mind sharing which blog
    platform you’re using? I’m planning to start my own blog soon but I’m having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking
    for something completely unique.
    P.S My apologies for getting off-topic but I had to ask!

  28. magnificent issues altogether, you simply gained a new reader.

    What could you recommend about your put up that you simply made some days
    in the past? Any certain?

  29. imoodle.win dice:

    You can definitely see your expertise within the article you write.
    The arena hopes for even more passionate writers such as you who are not afraid to say how they believe.

    All the time go after your heart.

  30. atdh.cn dice:

    I am really inspired along with your writing skills as smartly
    as with the layout for your weblog. Is this a paid topic or did you customize it yourself?
    Anyway keep up the nice high quality writing, it is
    uncommon to see a great blog like this one these days..

  31. Hi there, I check your blogs like every week.
    Your humoristic style is awesome, keep it up!

  32. I am truly thankful to the owner of this web site who has shared this fantastic paragraph at at
    this place.

  33. It’s awesome for me to have a website, which is good in support of my knowledge.
    thanks admin

  34. Woah! I’m really digging the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s tough to get that «perfect balance» between user friendliness and
    appearance. I must say that you’ve done a great job with this.
    Also, the blog loads super fast for me on Safari. Superb Blog!

  35. This is very interesting, You’re an overly professional blogger.
    I have joined your feed and look forward to seeking more of your excellent post.
    Additionally, I’ve shared your web site in my social networks

  36. I loved as much as you will receive carried out right here.
    The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get got an impatience over that you wish be delivering the following.
    unwell unquestionably come more formerly again since exactly the same nearly very often inside case you shield this increase.

  37. Definitely believe that which you said. Your favorite
    reason appeared to be on the net the simplest thing to be aware of.
    I say to you, I definitely get irked while people consider worries that they just don’t know about.

    You managed to hit the nail upon the top and defined
    out the whole thing without having side-effects ,
    people can take a signal. Will probably be back to get more.
    Thanks

  38. When I originally commented I clicked the «Notify me when new comments are added»
    checkbox and now each time a comment is added I get four emails with the same comment.
    Is there any way you can remove me from that service?
    Thanks!

  39. Good day! I know this is kinda off topic nevertheless
    I’d figured I’d ask. Would you be interested in trading
    links or maybe guest authoring a blog article or vice-versa?

    My site covers a lot of the same topics as yours and I believe we could greatly benefit from each
    other. If you might be interested feel free to send me an email.
    I look forward to hearing from you! Terrific blog by the way!

  40. Aw, this was an extremely good post. Spending some time and actual effort to create
    a good article… but what can I say… I procrastinate a whole lot and never seem to get anything done.

  41. We are a group of volunteers and opening a new scheme in our community.
    Your website offered us with useful information to work on. You have done a formidable
    process and our entire community will be thankful to you.

  42. Good day! This is my first visit to your blog!
    We are a collection of volunteers and starting a new initiative in a
    community in the same niche. Your blog provided
    us beneficial information to work on. You have done
    a wonderful job!

  43. Superb website you have here but I was curious if you knew of any user discussion forums that cover the same topics discussed
    in this article? I’d really like to be a part of online community
    where I can get advice from other experienced people
    that share the same interest. If you have any recommendations, please let me know.

    Appreciate it!

  44. My spouse and I stumbled over here coming from a different
    web address and thought I should check things out.
    I like what I see so i am just following you. Look forward to looking over your web
    page again.

  45. Thanks for sharing your info. I really appreciate your efforts and I am waiting for
    your next post thank you once again.

  46. Remarkable! Its really remarkable paragraph, I have got much clear idea regarding from this article.

  47. discuss dice:

    Magnificent beat ! I wish to apprentice while you amend your site,
    how could i subscribe for a blog web site? The account aided me a acceptable
    deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea

  48. Greetings from Florida! I’m bored at work so I decided to browse your site on my iphone
    during lunch break. I enjoy the info you provide here and can’t
    wait to take a look when I get home. I’m amazed at how
    fast your blog loaded on my phone .. I’m not even using WIFI, just 3G ..
    Anyhow, awesome site!

  49. Wow! This blog looks exactly like my old one! It’s on a completely different
    subject but it has pretty much the same page layout and design. Excellent choice
    of colors!

  50. Whoa! This blog looks just like my old one!
    It’s on a completely different topic but it has pretty much the same page layout
    and design. Outstanding choice of colors!

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *