This chapter provides programmers with an introduction to the OpenVault languages for controlling removable media libraries, and includes the following sections:
Section 3.1 describes the language in which the MLM server sends directives to an LCP, and responds to requests sent by an LCP.
Section 3.2, tells how an LCP sends configuration and status to the MLM server, and responds to directives from the MLM server.
The following sections describe the abstract library interface (ALI), including objects, object attributes, naming conventions, and the ALI command repertoire.
ALI is a language that provides an abstraction of a removable media library that is managed by OpenVault. ALI hides details of the underlying library and control methods without compromising the ability of OpenVault as a whole to manage its resources effectively. The MLM server communicates with an LCP using the ALI.
The ALI language manipulates the following objects:
Bay | A location for cartridges, with locality determined by similar access (mount) time. Typically, a bay is a physical grouping of cartridges in a common unit of housing, where cartridges are stored. A bay contains storage locations for cartridges, optional drives, and one or more transfer agents to move cartridges between storage locations and drives or other storage locations. In a multibay library, each bay in the library is attached to at least one other bay in the same library. For each cartridge in the library, there is some path for moving that cartridge from its current bay to any other bay, with one or more transfer agents to move that cartridge. |
Cartridge | A physical container for storage media. Each cartridge in the OpenVault system should have some kind of external identifying label (a physical cartridge label) that the library or an operator can verify. Part of the external label should be human readable. For automated libraries, another part of the label is machine readable--typically a barcode label that a laser scanner can interpret. Cartridges can have multiple sides. If they do, their containing library should be able to move or mount cartridges to achieve a particular orientation, for example, “side A” up. |
Command | ALI commands are objects as far as ALI is concerned. When the MLM server sends an ALI command, it associates a task ID with that command. The sender may refer to that command later by using the same task ID, but only to cancel the command. When an LCP receives a command, it includes the task ID in command responses. |
Drive | A device for accessing media inside a cartridge that has been mounted. |
Library control program (LCP) | Each LCP knows the details of a removable media library, including its configuration and control procedures. An LCP is responsible for accomplishing tasks that the MLM server asks it to perform, primarily managing library resources. An LCP communicates with its library using some device-specific language. An LCP can be seen as a black-box language translator, or a device management module. See Chapter 4, “Programming a Library Control Program (LCP)” for details about writing an LCP. |
Port | A door or opening where cartridges may be inserted into or removed from the library. |
Removable media library | A library contains one or more housing units, called bays, for storing cartridges. Bays contain storage locations for cartridges, optional attached drives, and one or more transfer agents for moving cartridges between storage locations in the same or different bay (using the move command), or between storage locations and drives in the same or a different bay (using the mount and unmount commands). A library provides some way to read or verify external labels affixed to cartridges. A removable media library also provides some means for inserting cartridges into and removing cartridges from the library. Each library has a specific control method. For automated libraries, this is typically some physical control connection from a host. For a human operated library, this might be a connection to an operator console. Typically, a library is a single automated device, with some sort of robotic transfer agent to move cartridges between storage locations and drives. Larger devices may include a number of bays attached with pass-through ports. A human operated vault, where tapes are stored on racks and transported between racks and drives by people, is another type of removable media library. |
Slot | A storage location for a cartridge. It has a shape, or form factor, that determines which kinds of cartridges it can hold. |
OpenVault requires an LCP to maintain library configuration attributes and notify the MLM server when they change. LCPs use the ALI/R config and ready commands to do this. These commands send properties back to the MLM server, where configuration information is kept in the MLM server persistent store. It is potentially recoverable by the LCP using the ALI/R show command. Here are the required configuration attributes:
LCP ready state (Section B.3 in Appendix B)
Library nominal cartridge exchange time (Table 4-3)
Element maps for slot, bay, and drive ( Section 3.1.4)
Cartridge form factor associated with slots, ports, and drives
Number of free slots in each bay, by form factor
![]() | Note: Currently, OpenVault does not support recovery of any attribute or property information stored in the MLM server persistent store by an LCP. However, this may be supported in a future version of OpenVault. |
ALI expresses LCP attributes using the tuple:
object type, object name, attribute name |
Table 3-1. Mandatory LCP Attributes
Object Type | Object Name | Attribute Name | Command |
---|---|---|---|
LCP | "" | Name | ALI show |
LCP | "" | SupportPCLs | ALI show |
LCP | "" | Vendor | ALI show |
LCP | "" | loglevel | ALI show, ALI attribute set |
Element maps are kept in the OpenVault persistent store and refreshed by the LCP when appropriate. There are element maps for the following objects:
Table 3-2 shows element map objects that an LCP supports.
Table 3-2. Element Map Components
Object Type | Object Name | Attribute Name | Command |
---|---|---|---|
Bay | bayID | Description | ALI show |
Slot | slotID | Slot description | ALI show |
Drive | driveID | Description | ALI show |
These names refer to specific ALI objects:
Attribute naming in ALI is different than for CAPI and AAPI, in which an attribute is given as TableName.ColumnName; attributes are just columns in a relational table. In ALI and ALI/R, attributes are named with a tuple:
objectType, objectName, attrName |
The MLM server speaks ALI to the LCP, which in turn speaks ALI/R to the MLM server. The ALI language includes the following commands:
activate | Starts and stops LCP interactions with the library. The activate command includes two variations. Note that once the LCP has established a session with the MLM server using the hello-welcome sequence, it may begin accepting ALI commands from the server. However, until it has successfully been activate enabled and is in ready state, it will resend ready lost state and fail ALI commands requiring access to its library with the error ALI_E_READY. The LCP uses one of the ALI/R ready command variations after processing the current command. These are the variations of the activate command: | |||||||||||||||||||||||||
attribute | Sets and unsets named attributes in the LCP. You can think of attributes in an LCP as named memory locations that may cause operations to happen as a side effect of setting or reading them. Some attributes defined by an LCP may be read-only to the MLM server. A list of mandatory attribute names appears in Table 3-1. | |||||||||||||||||||||||||
barrier | Forces the LCP to complete work on all commands received prior to the barrier command, before it begins working on any commands that might follow. This may require special processing for queued eject and openPort commands. For example, if an LCP normally flushes ejects with the openPort command, barrier should be rejected if the LCP has not already received an openPort command. In general, an LCP is free to execute the commands it receives in any convenient order. Since there might be circumstances where the MLM server requires an explicit order for executing a sequence of commands, the barrier command can be employed to force ordering. | |||||||||||||||||||||||||
cancel | Prevents execution of a command that has been queued in the LCP but which the device has not yet started. The LCP may choose to cancel already started jobs on a best-effort basis.
| |||||||||||||||||||||||||
eject | Pushes, in conjunction with the openPort command, cartridges out of the library. It takes a (slot ID, PCL) pair for the cartridge that is to be operated on. The LCP should send the corresponding changes in its slot and drive maps to the MLM server. The implementation of the eject command may vary from LCP to LCP, but there are three basic cases, as listed in Table 3-3. Table 3-3. Three Cases of eject
When a cartridge is physically ejected, it must immediately disappear from the OpenVault slotmap maintained by the LCP. This implies that an LCP that cannot immediately push a cartridge out of the library must be prepared to inform OpenVault that a particular slot ID (and therefore PCL) has been marked for ejection. The LCP should mark this slot as inaccessible and push the information to the MLM server. The LCP should recall this information from the OpenVault database upon booting, when OpenVault supports retrieval of LCP attributes from the MLM server's persistent storage. | |||||||||||||||||||||||||
exit | Tells the LCP to clean up and exit. The LCP should store any persistent LCP or library information in the OpenVault database, complete or cancel any pending ALI commands, send or abort any pending ALI/R commands, do shutdown processing as required by its interface to the library, send ready lost and goodbye commands to the MLM server, and exit. | |||||||||||||||||||||||||
goodbye | Tells the communicating LCP to end this session. | |||||||||||||||||||||||||
mount | Places a cartridge into a drive. The arguments to mount are a list of tuples (slot ID, PCL, side) and a drive name. The operation involves taking a cartridge from one of the given slots and putting it into the specified drive. For multisided cartridges, placement is according to a specified side orientation, for example “side A” up. The slot list may have just one element; if more than one is specified, the LCP decides which slot to use. The LCP should send the corresponding changes in its slot and drive maps to the MLM server.
| |||||||||||||||||||||||||
move | Transfers a cartridge from one physical slot in the library to another physical slot. The move source is a slot ID, PCP pair, and the destination is a slot ID. The LCP should send the corresponding changes in its slot and drive maps to the MLM server. | |||||||||||||||||||||||||
openPort | Removes or allows, in conjunction with the eject command, cartridges to be removed from the library. It may also be used on its own to allow cartridges to be inserted into the library. The function of the openPort command is to prepare the library for an operator to gain physical access to cartridges. Once access is granted, cartridges may be removed from and inserted into the library. The implementation of openPort may vary from LCP to LCP, and a given library might be in a different class for export than for import, but there are three basic cases, as listed in Table 3-4. Table 3-4. Three Cases of OpenPort
See the description of the ready and ready not commands under ALI/R for more information on how an LCP becomes not ready, permitting its library to be temporarily not available during an openPort operation. | |||||||||||||||||||||||||
reset | Asks the LCP to try and force the library to reinitialize. This may cause the library to perform internal diagnostics. If a reset makes the library unavailable to process other requests for an extended time, the LCP should use the ready not command to tell the MLM server that its library is temporarily not available, followed by a ready command when the library becomes available again. | |||||||||||||||||||||||||
response | Acknowledges and indicates success or failure of an ALI/R command. The optional text portion of the response contains error details or command results. | |||||||||||||||||||||||||
scan | Forces the LCP to verify or recheck the PCLs of all cartridges in the library. These are variations of the scan command: If the library will be unavailable to process other requests during this time, the LCP should use the ready not command to tell the MLM server that the library is temporarily not available for other motion commands (such as mount, unmount, move, or eject), followed by a ready command when the library becomes available again. | |||||||||||||||||||||||||
show | Obtains the current value of an attribute. Some of the attributes defined by an LCP may be write-only to the MLM server. For more information about LCP attributes, see Section 3.2.3. | |||||||||||||||||||||||||
unmount | Takes a cartridge out of a drive and returns it to a slot. The arguments to unmount are a drive name and a slot ID. The operation involves taking the cartridge from the drive and putting it into the given slot. Optionally, you can specify any for slot ID, and let the LCP choose where to return a cartridge. The LCP should send the corresponding changes in its slot and drive maps to the MLM server. |
The following sections describe the ALI/R language, including objects, object attributes, naming conventions, and the ALI/R command repertoire.
ALI/R is primarily the response language for ALI. In addition to giving the matching acknowledgment and final response to an ALI command, ALI/R provides the means for an LCP to send its configuration and status to the MLM server.
The ALI/R language manipulates the following objects:
Currently, ALI/R attributes are not supported by OpenVault, except for attributes stored by the ALI/R config and ready commands in the MLM server persistent store. Currently, OpenVault supports setting and unsetting of config and ready attributes only.
These names refer to specific ALI/R objects:
The LCP reads ALI commands from the MLM server, and replies to the server in ALI/R. The ALI/R language includes the following commands:
attribute | Sets and unsets named attributes in the MLM server, thereby creating persistent storage for whatever the LCP deems necessary. The MLM server simply stores these attributes; there are never any side effects of setting them. For background, see Section 3.1.3. | ||
cancel | Prevents execution of a command that has already been queued in the MLM server but not yet started. The cancelled command returns response cancelled status, and the response for the cancel command itself follows.
| ||
config | Copies configuration information, especially about element map changes, from the LCP to the MLM server. The MLM server stores a non-authoritative copy of all the element map information for all the LCPs it controls. Each LCP must use the config command in ALI/R to update the MLM server's copy of the element map information whenever it changes. The element map should change only as a result of administrator or operator actions. In the full scope option, all information that the MLM server associates with the LCP is deleted and replaced with information listed in the config command. In the partial scope option, the MLM server replaces only pieces of LCP information that are listed in the config command. Normally, the full scope option is employed at startup and when major changes to the library configuration occur, whereas partial scopeis employed when a cartridge movement operation happens. Very large libraries can initially use a partially populated full scope option followed by a series of partial scope commands, if this proves easier. The config command does the following:
| ||
goodbye | Tells the MLM server to end this session and clean up its end of the session. This protects against the accumulation of idle connections, since the MLM server has no way of detecting that an LCP exited other than the TCP/IP keepalive option. keepalive helps recover from process failures, but an LCP should send a goodbye before exiting to prevent unnecessary continuation of connection resources. | ||
message | Sends a message of some severity level to the MLM server. The LCP loglevel attribute determines a limit on the severity level of messages sent to the MLM server. This command provides a mechanism for the LCP to send messages that the MLM server can convey to an operator and possibly a system administrator.
| ||
ready | Tells the MLM server, along its variations, the current status of the library, and whether it is available for cartridge operations. Like the config command, the ready command is just a shorthand way of conveying attributes about ALI objects to the MLM server. These are variations of the ready command: See Section B.3 in Appendix B, for more information about ready states. | ||
response | Acknowledges and indicates success or failure of an ALI command. The optional text portion of the response contains error details or command results. | ||
show | Obtains the value of an attribute that the LCP previously stored in the MLM server. |
For some ALI commands, the matching ALI/R response command for a successful response contains a text portion, which must have a particular format and ordering. This section describes these requirements.
The text portion of a successful response to the show command depends on the specified mode for the show command, and on the number of attributes to be queried. There are three possible modes:
ALI_show_name | Shows name only. | |
ALI_show_value | Shows value only. | |
ALI_show_namevalue | Shows name and value, in that order. |
For each attribute to be queried, the text portion of the response includes name-value information, as dictated by this mode, and is ordered according to the specified attribute list. So, for example, if a show command requested a query of LCP loglevel and vendor attributes, with the ALIR_show_namevalue mode, the corresponding text portion of the response would look something like this:
text[ 'loglevel' 'debug' 'vendor' 'EXABYTE' ] |
The text portion of a success response for mount and unmount includes the value tuple:
source slotID, PCL, and OpenVault drive name |
The values are not tagged with a name, and must appear in this order. The corresponding text portion of the response would look something like this for source slotID slot 1, for PCL AB1234, and for drive fred:
text[ 'slot 1' 'AB1234' 'fred' ]; |
The text portion of a success response for a move command includes the value tuple:
source slotID, PCL, destination slotID |
The values are not tagged with a name, and must appear in this order. The corresponding text portion of the response would look something like this for source slotID slot 2, for PCL AB5432, and for destination slotID slot 5:
text[ 'slot 2' 'AB5432' 'slot 5' ]; |
The text portion of a success response for an eject command includes the value pair slotID, PCL. The values are not tagged with a name, and must appear in this order. The corresponding text portion of the response would look something like this for slotID slot 10 PCL AB9999:
text[ 'slot 10' 'AB9999' ]; |
See Appendix B, “Return Values and Ready States”, for a list of return values and detailed information about ready states.