I frequently use tape devices, libraries and drives, in my daily course of work. Unfortunately it isn’t possible to have every type of device in a lab or in many cases any physical devices available for testing, etc. When it comes to VTLs (Virtual Tape Libraries) there are a handful of vendors and options ranging from thousands of dollars to free. Luckily I work with the developer of what may be the most popular open-source VTL available, mhVTL, which is very scalable.
More information about the mhVTL can be found here:
For this example I am using a CentOS 7 minimal installation with network configuration completed, the steps are the same for CentOS 6.
Preparing the system
Upgrade current packages and kernel to the latest version
(I prefer to do this prior to any software installation or configuration on new systems):
Install required packages
Install CentOS Development Tools for GCC, make, Perl, etc.:
yum groupinstall "Development Tools"
Install additional required packages; kernel-devel, LZO, wget:
yum install kernel-devel lzo wget
Install option packages
Common tape/SCSI utilities:
yum install mtx lsscsi sg3_utils
Installing the mhVTL
Current mhVTL packages can be found at (for this example using build 1.5-4):
Download to temp location
wget http://www.mhvtl.com/downloads/mhvtl-utils-1.5-4.x86_64.rpm wget http://www.mhvtl.com/downloads/mhvtl-utils-1.5-4.src.rpm
Install RPM packages
rpm -Uvh mhvtl-utils-1.5-4.x86_64.rpm mhvtl-utils-1.5-4.src.rpm
(RPM files can now be removed if wanted)
Build kernel module
cd /root/rpmbuild/SOURCES/ tar xvfz mhvtl-2016-03-10.tgz cd mhvtl-1.5/kernel/ make make install
Start the mhVTL
On first start the mhVTL will generate needed configuration files in /etc/mhvlt/.
You now have a working VTL, confirmation can be done using:
When editing the configuration files, I recommend making a copy of the files so you can restore back should your edited configuration not work.
Set to start on boot
chkconfig mhvtl on
Note on iSCSI Integration
CentOS 7 / RHEL 7
With CentOS 7 and RHEL 7 there is a big change in the management of iSCSI targets. Switching from TGT to LIO moves the target from user space into the kernal. targetcli is the front-end for viewing, editing, and saving the configuration of the Linux-IO Target (without the need to manipulate the kernel target’s configuration directly).
After a lot of searching there currently there appears to be a limitation with PSCSI (Linux pass-through SCSI devices) Backstores. “”Note that the pscsi dev= parameter in targetcli assumes a block device (/dev/sdX or /dev/sr), so this currently does not work with SCSI medium changers or tapes that use character devices..”” – http://www.spinics.net/lists/target-devel/msg03940.html
CentOS 6 / RHEL 6
See my guide to setup the mhVTL-GUI web interface and TGTd iSCSI at: Adding a Web GUI to the mhVTL