📜 ⬆️ ⬇️

Connect the HP tape library via Fiber Channel to an ESXi 5.5 host



In today's Mythbreakers series, we will cover the topic of connecting the HP StoreEver tape library via the Fiber Channel protocol to an ESXi 5.5 host without additional maps and Direct path IO Passthrough.
Note: VMware does not support Tape Drives directly to ESXi 5.x.

VMware, KB1016407

Does not support - does not mean does not work.
Yes, all the same, nothing will work for you! Once VMware said - not supported, do not even try. I'd rather connect it directly to my favorite HP DL 580.
')
Incredulous administrator

This is not entirely true. Yes, we will create an unaccompanied configuration that works on an honest word, but passes tests in the utilities of the HPE Library and Tape Tools, is recognized and works in Veeam Backup and Replication . It is good to be healthy and rich when there is a physical server with FC HBA for backup. If, however, you need to make “to work” out of emptiness, if you want to understand a little how the ESXi storage subsystem is arranged - welcome under cat.

Let's start with a small introduction.

How the ESXi Storage Subsystem Works


Before you begin to understand why nothing works, you should refresh something in memory. How the hypervisor storage subsystem is arranged, what utilities are used when configuring and where to look for errors - this is what we will devote a few lines.


The VMware Pluggable Storage Architecture Framework loads the Multipath Plugin, which is generally responsible for I / O operations of certain classes of devices.
Included with the hypervisor are two plugins - the Native Multipath Plugin (NMP) and the “MASK_PATH” plug-in hiding unnecessary devices . Some vendors develop their own MP plugins, such as EMC PowerPath / VE or Symantec / Veritas DMP.

NMP turn implements its functionality through plugins Path Selection Plugin (PSP) and Storage Array Type Plugin (SATP).

The PSP deals directly with I / O and implements a policy of balancing traffic between multiple active paths. Branded PSP ( hence the policy ) only three = MRU , RR , Fixed. There are vendorskie PSP. If an error occurs during an I / O operation, the PSP sends it to the SATP and the SATP responds to it .

SATP is responsible for selecting active (optimal) paths when working with a specific array, monitoring the state of the paths; it responds to the SCSI Sense codes returned by the array (some of the codes are the same, and some may vary from vendor to vendor). It is the SATP that polls the ALUA arrays with the RTPG command to select the optimized paths. The behavior of the plugin is "tuned" with additional options.

For devices, rules have been created that determine how exactly MP and SATP handle this or that device.
It sounds intricate, but in reality everything is much simpler.

To work, you need to enable SSH on an ESXi host.

Get the list:
MP Plugins:


SATP plugins:


PSP plugins:


And here is the complete puzzle:


Each detected storage device is “run” through a set of rules to select the MP and SATP plugins.

MPP selection rules:


SATP selection rules:
esxcli storage nmp satp rule list 

The list of rules is very long, I will give a useful excerpt from the list:


Little military trick
Please note that you can gain additional benefits from the rules. HCL for ESXi 5.5 says that the HP EVA array with the HV200 controller is not supported . In fact, the plugin and rules are in place, and the array works great.

There are no PSP selection rules, for most SATPs, the PSP is specified by default and can be changed manually from the interface.
The prologue is finished, let's proceed to the first part - connecting the library.

Why not so easy to take and connect the library


The HP SCSI library is represented by a set of LUNs of one SCSI Target, for example:
LUN 0 - HP Fiber Channel Tape
LUN 1 - HP Fiber Channel Medium Changer

Check with the training manual:
Note: ESXi / ESX supports SCSI tape drives and tape drives only. If you are using a stand-alone tape drive, it’s a multi-LUN. If you want to use your device

VMware, KB1016407

Again, not by the rules. HP StoreEver is a multi-LUN library, not a multi-target. But this will not stop us.

We connect the drive


We connect the library to the SAN switch, configure the zoning so that the library can only be seen by one host and only by one card. If you fail to do this - do not worry, disguise the plugin.

Check that ESXi saw the streamer:

Immediately record its identifier of the form naa. {Your identifier} .

Go to Manage Paths to understand which plugin for working with arrays is selected for our device:


In our case, this is VMW_SATP_ALUA. At the same time, the plugin works so well with the streamer that all paths to it at the same time are marked as dead. It is logical to assume that the streamer is somewhat alien to both ALUA and multipassing. Therefore, we will turn it into a simple local device.
Note: Since the VMW_SATP_LOCAL plugin is being used.

VMware, KB1026157

That is necessary.

Let's look at the NMP settings for tape drive:

That's right, using VMW_SATP_ALUA. Recall that the esxcli storage nmp satp rule list rules are responsible for choosing the SATP plug-in.

If the device does not fall under a specific rule, then it will be processed by one of the “default” rules:


Logically, the device should have come under the rule of “Fiber Channel Devices”, since the transport is “fc”, but in fact the plug-in is assigned by the rule “Any array with ALUA support”. Somewhere here there is a catch, but it is not crucial. Our task is to write such a rule for tape drive so that it is processed by the VMW_SATP_LOCAL plugin (usually processing local devices like usb, ide, block).

Let's look carefully at our device with the help of the command:
 esxcli storage core device list 


To create a rule, take the following unique properties of a tape drive:
Vendor : HP
Model : Ultrium 5-SCSI

We write the rule:
 esxcli storage nmp satp rule add --satp=VMW_SATP_LOCAL --vendor="HP" --model="Ultrium 5-SCSI" 

Now you need to reinitialize all available paths to the streamer:
 esxcli storage core claiming reclaim -d naa.{ } 

As a result, the host will use only one path to the device and only on one HBA:


If the host has several HBAs
It would be nice to disguise the streamer on other maps.

In the virtual machine, add a new device:


Device type "Tape HP":


Now you need to carefully select the Virtual Device Node. The rules are as follows :
- Target number must match the real number. In our case, this is Target 2.

- on the adapter port should not be disk devices. Hard disks of the virtual machine are usually associated with port 0, so the first suitable port is 1: 2 (1 is the SCSI controller port number, 2 is the tape drive target number). VMware Virtual SCSI Controllers - Dual Port. If you specify port 3 or 4, a new controller will be automatically added.

Download driver package HP StoreEver Tape Drivers for Windows . In a virtual machine, the package just does not install:


Unpack it with 7zip and run setup.exe:

In the device manager, the streamer is ready!


We connect library



It is not enough to connect a streamer, for normal operation you will need to see in the operating system and the library itself, also known as a “changer” or “robot”.

As we see from the list, the path to the library is missing:


Referring to the magazine ESXi:
 tail -n 100 vmkwarning.log 

 NMP: nmp_SatpClaimPath:2093: SATP "VMW_SATP_ALUA" could not add path "vmhba1:C0:T2:L1" for device "Unregistered Device". Error Not found 

The SCSI Target ID of this unknown device matches the streamer, but the LUN number is 1. Obviously, our library cannot be recognized. NMP tried to connect the library with the VMW_SATP_ALUA plugin, but it didn't work out.
This is a SATP rule that has been taken for a SATP rule.
VMware, KB1026157

Identify the device model:
 esxcfg-rescan vmhba1 grep ScsiScan /var/log/vmkernel.log 

 016-07-20T06:30:37.502Z cpu6:33063)ScsiScan: 976: Path 'vmhba2:C0:T1:L1': Vendor: 'HP ' Model: 'MSL G3 Series ' Rev: '6.20' 

The parameters we need are:
Vendor: HP
Model: MSL G3 Series

Add a new rule for SATP:
 esxcli storage nmp satp rule add --satp=VMW_SATP_LOCAL --vendor="HP" --model="MSL G3 Series" 

Make unclaim for the path
 esxcli storage core claiming unclaim -t location -A vmhba2 -C 0 -T 1 -L 1 

Rescan devices:
 esxcfg-rescan vmhba 

The path to the Medium Changer has been successfully added:


We add it to the virtual machine as “Media HP” on the same SCSI Target ID as the drive, but on a different controller port (2: 2).

Changer appeared in the virtual machine:


This is victory.

If you need to mask the drive (the changer is not necessary, it will not be detected, as we have already seen) on other ESXi hosts, then we act as in KB1029786 . In short, we add rules so that our device is processed instead of NMP with the MASK_PATH plugin.
 esxcli storage core claimrule add -r 192 -t location -A vmhba{N} -C {C} -T {T} -L {0} -P MASK_PATH esxcli storage core claimrule load esxcli storage core claiming reclaim -d naa.{ } 


Thanks for attention.
Do you know what you can now prioritize?
Pluggable Storage Architecture (PSA) Deep-Dive
If timeouts occur in Veeam Backup: https://www.veeam.com/kb1887

Source: https://habr.com/ru/post/306026/


All Articles