Using mhVTL to simulate a tape library in your Veeam lab

(Note: Since writing up this post and its follow-up on upgrading the mhVTL appliance, I have run into issues getting the current mhVTL code to work with Veeam v9. As a result I have switched to using an alternative solution, QuadStor VTL, in my lab. Please go here to read my new series on how to integrate QuadStor VTL with Veeam.)

Have you ever wanted to test the backup to tape functionality in Veeam Backup and Replication in your lab but not been able to because of lack of physical kit? Recently I went digging for a solution and found mhVTL, an open source effort that seems to be driven largely by Mark Harvey, a technical support engineer in Symantec, now Veritas. I’ve been using it to simulate a 2 drive Dell PowerVault iSCSI tape library and I’ve found it really useful, allowing me to test all sorts of scenarios that I simply would not have been able to consider otherwise.

The main mhVTL website is at https://sites.google.com/site/linuxvtl2/. Here you can download the RPMs if you feel like building your own virtual appliance for scratch. Me being a bit lazy however, I went looking for a prebuilt appliance that I could use in my vSphere environment and found one at http://www.sightunseen.org/files/mhvtl.zip. This appliance is based on Ubuntu and uses version 1.4.7 of the mhVTL binaries, which is a slightly older version than the current release but it still works well and you should have it up an running in no time. The appliance supports a range of emulated tape libraries including models by StorageTek, Spectra Logic, Sony, IBM, Quantum, Dell, HP, ADIC and Overland and for each model you can specify the number and type of drives, the numbeer of full and empty slots, the capacity of the media, etc. For my purposes I found that the Dell PV-136T emulation worked best and was instantly picked up and recognised correctly by my Windows 2012 backup server.

Note that the device works as an iSCSI SAN-attached device so some familiarity with iSCSI targets and initiators is helpful.

Also, familiarity with the basic Linux vi commands is necessary.

After you download and unzip the file, you’ll see that it comprises an OVF bundle with 2 VMDK files, one for the operating system and mhVTL binaries and one for the tape repository.

As a prerequisite (although it’s not strictly required) I’ve created forward and reverse DNS entries for my appliance.

The screenshots show the deployment of the OVF using the traditional vSphere client here, but you will probably want to use the vSphere Web Client.

First, I start the “Deploy OVF Template” wizard and browse to the unzipped mhvtl.ovf file:

image03

Click next to view the OVF Template Details. 2 things to note here. The first is that the VM will require 270GB of disk space if thick provisioned. In my own lab I thin provision everything to save on space. The second thing to note is that the default configuration is for a HP MSL2024 tape library. I have had difficulties getting Windows 2012 to recognise this type of library natively and attempting to install drivers for it in a VM has proved very problematic. I’ll be changing the library configuration to a Dell PowerVault model later in the deployment.

image02

Click next and give the appliance a name. This is the inventory name as it will appear in the vsphere client. Later I’ll change the appliance’s internal host name to match.

image03

Click Next and choose a datastore. Note that in my cased I get a disk space warning. I’ll get over this problem by thin provisioning.

image04

Click Next and choose your disk format:

image05

Click Next and change the network mapping, if necessary. This should be a network that you use for iSCSI traffic. For the purposes of this lab environment I mix all networking types on a single network.

image06

Click Next and review your settings. Check the box to power on after deployment and click Finish.

image07

Once the appliance has fully powered up you will want to change a few settings, such as the IP address and host name. Since I have had some issues getting the standard vi commands to work in a vSphere Client console, I’m going to use putty instead. But first I need to find out what IP address has been assigned to my appliance by DHCP. Use the vSphere console to log in to the appliance (username = root, password = mhvtl)and run “ifconfig eth0”.

image09

Here we can see that my DHCP server has leased 10.0.0.101 to the appliance. Now use Putty to open an SSH session on the appliance.

image10

Since this is the first time I’ve opened an SSH session on this particular appliance, I get a warning that this host may not be the one I think it is. I think I can trust it so I’m going to click Yes to add the servers host key to my cache.

image11

Type “vi /etc/network/interfaces” to change the appliance from using DHCP to using a static IP address.

Comment out the line “iface eth0 inet dhcp” with a leading #. This will disable dhcp.

Remove the # signs from the start of the lines that define the statis IP address settings as shown. Save your settings by hitting Esc followed by wq (enter). If you make a mistake and want to exit without saving, just hit Esc followed by q! (enter).

image13

Now we’ll change the host name. This is important as it avoids error messages from appearing when changing VTL settings later. The hostname must be changed in 2 files. First, type “vi /etc/hosts” and hit enter. Create an entry in the hosts file that specifies “mhvtl” as the host name (in this case 10.0.0.26 mhvtl.local.lan mhvtl). Again, hit Esc followed by wq (enter) to save your work.

Now type “vi /etc/hostname” and enter the correct hostname, saving the work as before.

Finally, enter “reboot” to restart the mhVTL appliance with the new settings.

When the appliance has restarted, you can log in again using Putty and use the ifconfig and uname commands to verify your changes:

image55

Now let’s configure the tape library. mhVTL has a nice simple GUI that we can use to make all our changes. Open a browser and point it either to the IP address we have just given to the appliance or, better yet, to the FQDN that we should have created on our DNS server:

http:///mhvtl/

The default password is mhvtl.

image18

The console shows us that the mhVTL and iSCSI target daemons are running and that the appliance is configured as a 2-drive HP MSL G3 Series library. We’re going to have to change this so first stop mhVTL by clicking on the red Stop icon.

image19

Click Yes to confirm.

image20

The GUI will confirm that the MHVTL daemons have stopped.

image21

Now we’ll change the tape library emulation. Note that you cannot delete the existing library until after the new one has been added. Click Setup and then click Add.

image22

Choose the Standard configuration type:

image23

Click Next to launch the wizard:

image24

Select Dell from the list of brands:

image25

Next we will change the library settings as needed. You could leave the defaults. In my case I have reduced the number of drives to 2 and the number of maps to 2. When you have made your changes click Submit Query:

image26

Here we can see that the library and drives have been configured as specified. Scroll to the bottom of this screen.

image27

Click Finish.

image28

On the next screen we are given the option to restart the mhvtl daemons. In our case we have already stopped the daemons and will not start them again until we have removed the HP MSL G3 Series library, so we will simply click Finish:

image29

Now we return to the Setup screen and click Remove in order to delete the HP tape library. Select the library from the drop down list and also choose Yes to remove all of its tape media. Click Continue:

image31

Confirm that you really do want to do this by clicking Continue:

image32

The system will confirm that the library and all its media have been deleted. As this is the last change, we can click “Start MHVTL” to start the daemons:

image33

Returning to the console we can see that the configuration changes have been successful:

image34

Finally, we will want to check that the iSCSI target configuration is OK. Go to the iSCSI (tgt) section:

image35

Click on Targets and verify that a target exists. If not, you may need to click on New to create one (I have had to do this on occasion):

image36

So that’s the mhVTL appliance fully configured and ready to go.

Note: If you are using mhVTL with Veeam v9, you will need to update your mhVTL appliance at this stage, otherwise you will run into problems when trying to backup to tape. I’ve prepared a run-through of the procedure here. For Veeam v8 you can skip the update procedure.

Now we need to go to our backup server and connect it to the library. In this case I’m running Veeam v8 on a Windows 2012 Standard server. Launch Server Manager and go to Tools->iSCSI Initiator.

image37

When the iSCSI Initiator configuration tool launches, enter the IP address (or DNS name) of the mhVTL appliance and click Quick Connect:

image38

All going well, you should see this and you’re done:

image41

If you see this, you may have a problem. But don’t worry – often a reboot of the mhVTL appliance (using the linux “reboot” command, of course) and a retry of the Quick Connect will get you back on course:

image39

You can now check the Targets, Discovery and Favorite Targets tabs of the iSCSI Initiator Properties to check that the correct entries for the mhVTL appliance appear in each.

image42

image43

image44

Now, go to the Device manager in Windows and you should see the Dell PV136T autoloader and 2 IBM Ultrium tape drives listed:

image45

Going to my Veeam console, I run the wizard to add tape infrastructure and then I can now see the devices listed under the Tape Infrastructure section as expected.

image46

We’re ready to start configuring tape jobs in Veeam now. In a later post I’ll show how how that’s done.

Advertisements

11 thoughts on “Using mhVTL to simulate a tape library in your Veeam lab

    • Thanks Gerard. Did the iSCSI initiator pick up the target without errors? If so, you should at least see the changer and tape drives in device manager. Have you tried rescanning for changes in hardware manager?

      Liked by 1 person

      • It did.

        I went over your instructions 100 times. I spent all day on it.

        All of the iSCSI stuff is identical to your setup but I’m not getting any changer or drives in device manager (nor am I getting any unidentified devices).

        I’ve tried on Windows 2012 and 2016 Server and Windows 10.

        If I look on the web interface I can see all 3 machines as connections.

        Like

  1. Sorry you didn’t have much luck Gerard. Al I can say is that the screenshots are taken from my own deployment which I ran through twice, the first time when I was trying out mhVTL for the first time and the second time to prove to myself that it really did work. Beyond that, I can’t really provide support. One thing you could try is to add different libraries to mhVTL until you find one with native Windows drivers. That’s how I came upon the Dell PV136-T as a good choice. Also, a reboot of the mhVTL appliance after making changes and then reconfiguration of the Windows iSCSI initiator may help..

    Like

  2. Hi Gerard. I just got back to my lab and retried my procedure using all new VMs and again I was able to detect the Dell PowerVault 136T Autoloader and IBM Ulrium drives in Windows 2012 device manager. For clarity, I am running Windows 2012 R2 Standard on a vSphere ESXi 6 host. The VM hardware version is 11. Both autoloader and drives were picked up using native Microsoft drivers.

    One small change I’ve made to my procedure – there is a second file that needs to be edited on the mhVTL appliance in order to set the hostname which I’ve included above. In my lab it worked before I made the change and after.

    Like

  3. The change is that you also need to edit a file on the mhVTL appliance called /etc/hostname so that it has the correct hostname.

    the iqn bit is what’s known as an iSCSI qualified name. It’s equivalent to a Fibre Channel WWPN. It’s generated automatically by each node on the iSCSI network and shouldn’t need to be changed. You can find an explanation of it here:

    https://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.vsphere.storage.doc/GUID-686D92B6-A2B2-4944-8718-F1B74F6A2C53.html

    There’s a decent iSCSI tutorial here:

    http://www.windowsnetworking.com/articles-tutorials/windows-server-2012/configuring-iscsi-storage-part1.html

    Like

Comments are closed.