Changes RSS

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

guides:bacup:mhvtl [2010/10/30 16:29]
fishy Changed the tool-set..
guides:bacup:mhvtl [2010/10/31 12:11] (current)
fishy Intro, links.
Line 1: Line 1:
 +====== Virtual Tape Library using linuxvtl2/mhvtl on Debian ======
 +
 +===== About VTL =====
 +
 +This segment is stolen from the [[http://en.wikipedia.org/wiki/Virtual_tape_library|Wikipedia article on VTL]]:
 +
 +> A virtual tape library (VTL) is a data storage virtualization technology used typically for backup and recovery purposes. A VTL presents a storage component (usually hard disk storage) as tape libraries or tape drives for use with existing backup software.
 +
 +> Virtualizing the disk storage as tape allows integration of VTLs with existing backup software and existing backup and recovery processes and policies. The benefits of such virtualization include storage consolidation and faster data restore processes.
 +
 +For linux, we have an experimental implementation of file-based VTL in the form of [[http://sites.google.com/site/linuxvtl2/|linuxvtl2]], thanks to the work of Mark Harvey. It is based on the work done with the [[http://sg.danny.cz/sg/sdebug26.html|scsi_debug]] adapter driver, and consists of a combination of a kernel character device driver and userspace tools.
 +
 +I will in general reference this implementation by its "official" name, linuxvtl2, and more often by its in-use name, mhvtl (obviously named after Mark Harvey).
 +
 +===== About this install walk-through =====
 +
 +There is no package for linuxvtl2 in the official package trees, and
 +linuxvtl2 is to be considered "experimental" as data-formats may change
 +between versions. This means that it will have to be installed from source.
 +
 In this how-I-did blurb, I was working as 'root' (shrug), and as such, In this how-I-did blurb, I was working as 'root' (shrug), and as such,
 I have not used 'sudo' to perform commands that need root-like permissions. I have not used 'sudo' to perform commands that need root-like permissions.
 If you are doing this properly, add 'sudo' to your commands as needed. If you are doing this properly, add 'sudo' to your commands as needed.
 +
 +===== Pre-requisites for compiling and "tape" administration =====
  
 After installing a base Debian system, pull in essential packages After installing a base Debian system, pull in essential packages
 for compiling C/C++ and kernel related code. The shortest route: for compiling C/C++ and kernel related code. The shortest route:
-<code>  + 
-apt-get install build-essential +<code> 
-apt-get install linux-headers-`uname -r`+apt-get -y install build-essential 
 +apt-get -y install linux-headers-`uname -r`
 # Because of brainfart in either mhvtl or the XenServer package: # Because of brainfart in either mhvtl or the XenServer package:
 ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
-apt-get install zlib1g-dev+apt-get -y install zlib1g-dev
 </code>  </code> 
  
 Prepare the environment for tape-library use, by installing the two most Prepare the environment for tape-library use, by installing the two most
 essential packages for handling SCSI and autochangers. essential packages for handling SCSI and autochangers.
-<code>  +<code> 
-apt-get install lsscsi mtx mt-st scsitools sg3-utils --no-install-recommends +apt-get -y install lsscsi mtx mt-st scsitools sg3-utils --no-install-recommends
 </code>  </code> 
 +
 +===== Downloading and compiling =====
  
 Pull down the source for linuxvtl2/mhvtl, and unpack it. Pull down the source for linuxvtl2/mhvtl, and unpack it.
Line 43: Line 67:
 </code> </code>
  
-The defaul configuration file contained a lot more devices and stuff than I wanted, so I stripped down the config a bit. First, this is my resulting+===== Configuration ===== 
 + 
 +Configuration files are not __installed__ by default. Rather, they get __generated__ when mhvtl is first started. So, before progressing, start and then stop the "service". 
 + 
 +After this, I started up the daemon, and ran some testing commands: 
 +<code> 
 +/etc/init.d/mhvtl start 
 +sleep 10 
 +/etc/init.d/mhvtl shutdown 
 +rm /opt/vtl/* 
 +</code>  
 + 
 +The default configuration file contained a lot more devices and stuff than I wanted, so I stripped down the config a bit. First, this is my resulting
 /etc/mhvtl/device.conf file: /etc/mhvtl/device.conf file:
 <code> <code>
Line 160: Line 196:
 Slot 22: CLN001L4 Slot 22: CLN001L4
 </code> </code>
 +
 +===== Testing the setup =====
  
 After this, I started up the daemon, and ran some testing commands: After this, I started up the daemon, and ran some testing commands:
Line 254: Line 292:
 </code>  </code> 
  
 +===== Finalizing =====
 +
 +The startup-script gets added to /etc/init.d, but is not added
 +to any runlevels during installation. So, so make it start on boot,
 +you'll have to add it yourself, preferablu using update-rc.d
 +
 +<code>
 +update-rc.d mhvtl defaults
 +</code> 
 +
 +===== Note =====
 +
 +In this walk-through, I did not touch the mhvtl.conf file. As a result,
 +the "tapes" will be limited to the default "volume-size" of 500MB per tape-file,
 +regardless of what tape-type and drive-type you describe in your devices.conf and library_contents.conf. If you want to simulate "realistic" volume-sizes, take a look at the mhvtl.conf file, and be aware that the tape-images are stored as continous files of the size you set up. Your filesystem may choke on huge files, your kernel may choke on huge files, and finally, mhvtl may even do the same.