Professional Documents
Culture Documents
It’s usual students of mine to decide to study some backup software and, in the middle
of way, they always complaint of the lack of a good environment to test all concepts and
procedures, mainly because there’s not free robot and just making backup on disk is boring. ;)
Actually, there´s a very good VTL software named mhVTL (
http://sites.google.com/site/linuxvtl2 ) which could be used in a perfect way and emulating
great brands like StorageTek (nowadays, Oracle). By the way, in this example, I’m going to
explain how to setup a VTL (using first a very nice Web interface) and, after everything is
working and accessable from another remote host, I’m going to show you details about the
configuration files.
To show you these step-by-step, I’m using VMware Workstation 8 and my virtual
network have three virtual machines: the first running CentOS 6.0 64 bits (our VTL), the second
running CentOS 6.0 64 bits too (supposedly our backup machine) and the third running
Windows 7 ( supposedly another backup machine – it could be a Windows 2008). Let´s see the
procedure.
a) In your first CentOS 64 bits you should prepare your system to download the packages
from Web. As a root user, do:
b) Now that your CentOS is configured with the new repository, execute the following
command to install the mhVTL software:
# sestatus
# vi /etc/selinux/config
http://alexandreborges.org Página 1
How to configure a free VTL software
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
e) Open the port 3260 (iscsi) in the iptables firewall file and save the rule:
# reboot
Unfortunately, configuring the VTL in the command line is hard, so you can install a web
interface to help you in this task. Let’s do it:
1) mkdir /guivtl
2) Download the Web Manage Console GUI from:
https://github.com/niadev67/mhvtl-gui/tarball/master/
3) cp niadev67-mhvtl-gui-1.4.7-3-g9f3bde0.tar.gz /guivtl
4) cd /guivtl
5) tar zvxf niadev67-mhvtl-gui-1.4.7-3-g9f3bde0.tar.gz
6) cd niadev67-mhvtl-gui-9f3bde0/
7) yum install httpd
8) chkconfig httpd on
9) cp -r * /var/www/html/
10) yum install php
Dependencies Resolved
===============================================================================
=
Package Arch Version Repository Size
===============================================================================
=
http://alexandreborges.org Página 2
How to configure a free VTL software
Installing:
php x86_64 5.3.3-23.el6_4 updates 1.1 M
Installing for dependencies:
php-cli x86_64 5.3.3-23.el6_4 updates 2.2 M
php-common x86_64 5.3.3-23.el6_4 updates 524 k
Transaction Summary
===============================================================================
=
Install 3 Package(s)
Installed:
php.x86_64 0:5.3.3-23.el6_4
Dependency Installed:
php-cli.x86_64 0:5.3.3-23.el6_4 php-common.x86_64 0:5.3.3-23.el6_4
Complete!
11) Now, it´s needed to allow the web server user to run all commands as root:
12) Edit /etc/sudoers and comment out the line “Defaults requiretty” (highlighted
below):
http://alexandreborges.org Página 3
How to configure a free VTL software
## This file must be edited with the 'visudo' command.
## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias FILESERVERS = fs1, fs2
# Host_Alias MAILSERVERS = smtp, smtp2
## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem
## Command Aliases
## These are groups of related commands...
## Networking
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net,
/sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool
## Services
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig
## Storage
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount,
/bin/umount
## Delegating permissions
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp
## Processes
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
## Drivers
# Cmnd_Alias DRIVERS = /sbin/modprobe
# Defaults specification
#
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
# You have to run "ssh -t hostname sudo <cmd>".
#
# Defaults requiretty
#
# Refuse to run if unable to disable echo on the tty. This setting should also be
# changed in order to be able to use sudo without a tty. See requiretty above.
#
Defaults !visiblepw
#
# Preserving HOME has security implications since many programs
# use it when searching for configuration files. Note that HOME
# is already set when the the env_reset option is enabled, so
# this option is only effective for configurations where either
http://alexandreborges.org Página 4
How to configure a free VTL software
# env_reset is disabled or HOME is present in the env_keep list.
#
Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
#
# Defaults env_keep += "HOME"
## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
apache ALL=(ALL) NOPASSWD: ALL
http://alexandreborges.org Página 5
How to configure a free VTL software
# /etc/init.d/httpd restart
Done. It´s time to test if our steps has worked. Please, open a browser and type the following
url: http://localhost. You should see this image:
Figure 1
http://alexandreborges.org Página 6
How to configure a free VTL software
The login password is “mhvtl”. After the login, you’ll see this screen:
Figure 2
The mhVTL framework already has a configured robot, then we’re going to erase the current
configuration to prepare for our tests. Go to “Setup” page and click on “Remove” button:
Figure 3
http://alexandreborges.org Página 7
How to configure a free VTL software
Figure 4
Figure 5
On “Select Library to remove” combo box, take one library at time, toggle “Remove All Tape
Media Also ?” option to “YES” and click on “Continue” button. However, it’s impossible to
remove the last robot. No problem because we’re going to create our robot so soon and after
that it’ll be possible to remove this “default robot” ;)
http://alexandreborges.org Página 8
How to configure a free VTL software
Figure 6
Figure 7
Second, as we’ll will choose to create a StorageTek L700 tape library, then we must press
“STK” (StorageTek) and fill all required settings. Basically, my choices were:
http://alexandreborges.org Página 9
How to configure a free VTL software
Figure 8
Now, you must press “Submit Query” button, “Finish” twice and then “Return”. From there,
you should return to “Console” and start the mhVTL engine clicking on green “Start” button:
http://alexandreborges.org Página 10
How to configure a free VTL software
Figure 9
Please, you notice that we have two VTLs now and, if you want to erase the old one, feel free
to do it.
It’s time to configure the robot STK L700 as an iSCSI target to make it ready to be connected by
one host initiator using iSCSI. Go to the “iSCSI (tgt)” section, press “Enable” and then
“Return” button :
http://alexandreborges.org Página 11
How to configure a free VTL software
Figure 10
To make things easier, click on “Quick Start” , “Start” and finally on “Return” button:
Figure 11
Figure 12
http://alexandreborges.org Página 12
How to configure a free VTL software
Figure 13
Figure 14
To confirm that the iSCSI target robot is configured, you should press on “Target”:
http://alexandreborges.org Página 13
How to configure a free VTL software
Figure 15
We’ve finished the robot configuration. Now the reader are able to check some interesting
details about this configuration. For example, we can verify that robot tapes drives are
configured in /opt/mhvtl directory:
The robot STK L700 and and its tape drives are configured in /etc/mhvtl/device.conf:
http://alexandreborges.org Página 14
How to configure a free VTL software
VERSION: 5
http://alexandreborges.org Página 15
How to configure a free VTL software
Backoff: 400
http://alexandreborges.org Página 16
How to configure a free VTL software
Windows 7
Connecting a Windows system to VTL robot it’s very easy. First, we need to find out what’s the
IP address of robot system.
Moving to Windows system (Windows 7), go to “Windows Start” button, search for iSCSI and
click it. At first tab, type the IP address of system where is running the mhVTL (192.168.1.190)
on “Target” textbox and press “Quick Connect….”:
http://alexandreborges.org Página 17
How to configure a free VTL software
Figure 16
http://alexandreborges.org Página 18
How to configure a free VTL software
Figure 17
It’s recommended to confirm that our VTL is recognized (at least seen) by Windows system:
http://alexandreborges.org Página 19
How to configure a free VTL software
Figure 18
http://alexandreborges.org Página 20
How to configure a free VTL software
…….
…….
scsi 4:0:0:1: Medium Changer STK L700 0016 PQ: 0 ANSI: 5
ch1: type #1 (mt): 0x100+1 [medium transport]
ch1: type #2 (st): 0x400+25 [storage]
ch1: type #3 (ie): 0x200+5 [import/export]
ch1: type #4 (dt): 0x1+5 [data transfer]
ch1: dt 0x1: ID/LUN unknown
ch1: dt 0x2: ID/LUN unknown
ch1: dt 0x3: ID/LUN unknown
ch1: dt 0x4: ID/LUN unknown
ch1: dt 0x5: ID/LUN unknown
ch1: INITIALIZE ELEMENT STATUS, may take some time ...
ch1: ... finished
ch 4:0:0:1: Attached scsi changer ch1
ch 4:0:0:1: Attached scsi generic sg13 type 8
scsi 4:0:0:2: Sequential-Access STK T10000A 1.27 PQ: 0 ANSI: 5
st 4:0:0:2: Attached scsi tape st4
st 4:0:0:2: st4: try direct i/o: yes (alignment 1 B)
st 4:0:0:2: Attached scsi generic sg14 type 1
scsi 4:0:0:3: Sequential-Access STK T10000A 1.27 PQ: 0 ANSI: 5
st 4:0:0:3: Attached scsi tape st5
st 4:0:0:3: st5: try direct i/o: yes (alignment 1 B)
st 4:0:0:3: Attached scsi generic sg15 type 1
scsi 4:0:0:4: Sequential-Access STK T10000A 1.27 PQ: 0 ANSI: 5
st 4:0:0:4: Attached scsi tape st6
st 4:0:0:4: st6: try direct i/o: yes (alignment 1 B)
st 4:0:0:4: Attached scsi generic sg16 type 1
scsi 4:0:0:5: Sequential-Access STK T10000A 1.27 PQ: 0 ANSI: 5
st 4:0:0:5: Attached scsi tape st7
st 4:0:0:5: st7: try direct i/o: yes (alignment 1 B)
st 4:0:0:5: Attached scsi generic sg17 type 1
scsi 4:0:0:6: Sequential-Access STK T10000A 1.27 PQ: 0 ANSI: 5
st 4:0:0:6: Attached scsi tape st8
st 4:0:0:6: st8: try direct i/o: yes (alignment 1 B)
st 4:0:0:6: Attached scsi generic sg18 type 1
http://alexandreborges.org Página 21
How to configure a free VTL software
http://alexandreborges.org Página 22
How to configure a free VTL software
If someday you want to log out and persistently disconnect from mhVTL:
Oracle Solaris 11
Finally, let’s configure the iSCSI initiator on the fantastic Oracle Solaris 11:
root@solaris11:~# dmesg
Sep 5 01:43:47 solaris11 iscsi: [ID 559844 kern.info] NOTICE: iscsi session(6) iqn.1994-
05.com.redhat:3274326c6df:mhvtl:stgt:1 online
Sep 5 01:43:47 solaris11 genunix: [ID 408114 kern.info] /iscsi/array-
controller@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,0 (nulldriver0) online
Sep 5 01:43:47 solaris11 vga_arbiter: [ID 197929 kern.info] vga_arbiter: device added:
PCI:0:0:f.0,decodes=io+mem+IO+MEM,owns=io+mem+IO+MEM,legalocks=none,norml
ocks=none
Sep 5 01:43:47 solaris11 vga_arbiter: [ID 254375 kern.info] 1 vga device(s) found
Sep 5 01:43:47 solaris11 rootnex: [ID 349649 kern.info] vga_arbiter0 at root
Sep 5 01:43:47 solaris11 genunix: [ID 936769 kern.info] vga_arbiter0 is /vga_arbiter
Sep 5 01:43:47 solaris11 isa: [ID 202937 kern.info] ISA-device: ecpp0
Sep 5 01:43:47 solaris11 genunix: [ID 936769 kern.info] ecpp0 is
/pci@0,0/isa@7/lp@1,378
Sep 5 01:43:47 solaris11 isa: [ID 202937 kern.info] ISA-device: asy0
Sep 5 01:43:47 solaris11 genunix: [ID 936769 kern.info] asy0 is
/pci@0,0/isa@7/asy@1,3f8
Sep 5 01:43:47 solaris11 isa: [ID 202937 kern.info] ISA-device: asy1
http://alexandreborges.org Página 23
How to configure a free VTL software
http://alexandreborges.org Página 24
How to configure a free VTL software
http://alexandreborges.org Página 25
How to configure a free VTL software
[root@solaris11:~# ls /dev/rmt/*
total 120
lrwxrwxrwx 1 root root 91 Sep 5 01:43 0 ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:
lrwxrwxrwx 1 root root 92 Sep 5 01:43 0b ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:b
lrwxrwxrwx 1 root root 93 Sep 5 01:43 0bn ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:bn
lrwxrwxrwx 1 root root 92 Sep 5 01:43 0c ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:c
lrwxrwxrwx 1 root root 93 Sep 5 01:43 0cb ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:cb
lrwxrwxrwx 1 root root 94 Sep 5 01:43 0cbn ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:cbn
lrwxrwxrwx 1 root root 93 Sep 5 01:43 0cn ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:cn
lrwxrwxrwx 1 root root 92 Sep 5 01:43 0h ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:h
lrwxrwxrwx 1 root root 93 Sep 5 01:43 0hb ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:hb
lrwxrwxrwx 1 root root 94 Sep 5 01:43 0hbn ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:hbn
lrwxrwxrwx 1 root root 93 Sep 5 01:43 0hn ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:hn
lrwxrwxrwx 1 root root 92 Sep 5 01:43 0l ->
../../devices/iscsi/tape@0000iqn.1994-
05.com.redhat%3A3274326c6df%3Amhvtl%3Astgt%3A10001,2:l
That’s it. Now, it’s up to you. You can install an excellent backup software (for example,
Symantec NetBackup or Symantec Backup Exec) and to point it to this VTL. Good lucky.
Alexandre Borges.
http://alexandreborges.org Página 26