Mhvtl GUI: a Tape-library Emulator Server

Download

Here you find virtual machine image ready for import and use of mhvtl (VirtualBox, Vmplayer etc.):

Network Configuration

Start mhvtl Virtual Machine and perform login:

  • User: root
  • Password: mhvtl

Check the IP address fetch by your mhvtl virtual machine. Example:

ifconfig eth0

Or configure a definite static IP for your station. Edit the /etc/network/interfaces file, comment the “iface eth0 inet dhcp” line, and add the other following:

# iface eth0 inet dhcp

iface eth0 inet static
address 10.0.0.50
netmask 255.255.255.0
gatewau 10.0.0.1
dns-nameservers 8.8.8.8

Add a similar bellow line to your “/etc/hosts” file, replacing the IP address for the mhvtl machine one:

10.0.0.50 mhvtl.local.lan mhvtl

Also, modify the hostname for mhvtl (required for proper operation of the emulator). Reset machine:

echo "mhvtl" > /etc/hostname
reboot

First Access

As Figure 1, access the web interface through the Internet browser. The password is mhvtl:

  • http://ip_servidor/mhvtl

Mhvtl GUI: a Tape-library Emulator Server 1

Figure 1: Login Screen.

As shown in Figure 2, there is an already configured HP tape-library. You can remove it later if you want to test other brands, but we need to create another one before.

Mhvtl GUI: a Tape-library Emulator Server 2

Figure 2: Default Tape-Library.

Figure 3 shows the first screen after clicking on the “Setup” button, necessary to “Add” the new equipment.

Mhvtl GUI: a Tape-library Emulator Server 3

Figure 3: New Library Setup

Following the wizard (Figure 4), it will take you to the manufacturer’s choice screens and equipment type.

Mhvtl GUI: a Tape-library Emulator Server 4

Figure 4: Manufacturer Selection Screen

Follow the wizard until the daemons restart to apply the changes. If desired, return to Setup and remove the original HP library.

The figures in this article have been copied from: https://univirt.wordpress.com/2015/12/15/using-mhvtl-to-simulate-a-tape-library-in-your-veeam-lab/


iSCSI Tape-Library Mapping

From your Bacula backup server, install the Linux iSCSI initiator tools.

# Centos / RHEL
yum -y install iscsi-initiator-utils 

# Debian / Ubuntu
apt-get -y install open-iscsi

Test access to the mhvtl iSCSI service and get the IQN of the target, informing your IP as in the example below:

iscsiadm -m discovery -t sendtargets -p 10.0.0.50

Run the following command to log in to iSCSI and be able to use virtual tape-library. The targetname is the IQN obtained from the previous discovery:

iscsiadm -m node --targetname "iqn.2011-04.com.nia:mhvtl:mhvtl:stgt:1" --portal "10.0.0.50:3260" --login

The lsscsi -g and dmesg shell commands should show information of the newly added devices.


Configuring Tape-Library on Bacula

The Storage Daemon contains the configurations of the storage devices (bacula-sd.conf). Bacula calls tape-libraries by a generic name (Autochanger = automatic media changer). You must add an Autochanger , listing the number and name of Tape Drives that will also be added through Device resources. The bacula-sd.conf itself has an example (commented out) like the one below (or through Bweb, Bacula’s Conformation, Storage Daemon):

Autochanger {
 Name = TL2000
  Device = Drive-1
  Device = Drive-2
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/tape/by-id/changer_device_path
}

Device {
  Name = Drive-1                      #
  Drive Index = 0
  Media Type = LTO
  Archive Device = /dev/tape/by-id/tape_drive_1_path-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
}

Device {
  Name = Drive-2                      #
  Drive Index = 1
  Media Type = LTO
  Archive Device = /dev/tape/by-id/tape_drive_2_path-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
}

According to this example, the main thing here is to modify the values of ChangerDevice and ArquiveDevice, as presented for the Linux operating system. The following path shows the static paths (which are not modified after server reboot):

ls /dev/tape/by-id

Then, tie the new Bacula Storage Daemon Autochanger to the Director. Edit the bacula-dir.conf and add a block similar to the one below. The Device and MediaType values must necessarily match the values set in the bacula-sd.conf:

Storage {
  Name = TapeLibrary
  Address = bacula_server_ip
  SDPort = 9103
  Password = "iDnQ0d2OJEgSlVltJlLZQwC9Yb9iA/j3cikw4cfDku8N"
  Device = TL2000
  Media Type = LTO
  Maximum Concurrent Jobs = 10 
}

Still in bacula-dir.conf, you can associate a new Pool with the new TapeLibrary device. Thus, every Job executed in this Pool will be written to this new device. Example:

Pool {
  Name = Tapes
  Pool Type = Backup
  Recycle = yes                       
  AutoPrune = yes                  
  Volume Retention = 365 days     
  Storage = TapeLibrary
}

Save and exit. Restart the Storage Daemon and Director to apply the changes:

service bacula-sd restart
service bacula-dir restart

Initialize Bacula Volumes on the robot tapes (according to your virtual bar codes!):

echo "label barcodes storage=RoboFitas pool=Fitas" | bconsole

Run Backup Jobs through bconsole to the new Pool (or through the favorite graphical interface). You may need to rename the Backup Job to one that is set up on your Bacula Director:

echo "run job=BackupClient1 Pool=Fitas yes" | bconsole

Follow the execution of the Job through the messages command, inside the bconsole. Example:

echo "messages" | bconsole

The end!


 

Disponível em: pt-brPortuguês (Portuguese (Brazil))enEnglishesEspañol (Spanish)

Leave a Reply