The Drive Control Program (DCP) is the OpenVault component that manages the configuration of drives and handles drive control tasks associated with CAPI-mount and CAPI-unmount requests for drives that are under OpenVault management.
There is at least one DCP associated with each OpenVault-managed drive. The main purpose of the DCP is to expose the drive configuration to the MLM Server and optionally to control the drive.
If there is a DCP that implements drive control in addition to exposing drive configuration, then the drive is said to have an OpenVault-accessible control interface. In this case, the MLM Server can access drive control through that DCP. OpenVault-managed drives may include both those with and without an OpenVault-accessible control interface.
Most commonly, drives are host-attached and a DCP on a host to which the drive is attached implements drive control through a host interface to the drive. A drive that is attached to multiple hosts may have multiple OpenVault-accessible control interfaces and associated DCPs -- one for each host to which that drive is attached.
Typically, if a drive is not host-attached, so that a DCP cannot control it through a host interface, the DCP does not implement drive control, so there would be no OpenVault-accessible control interface to such a drive. An example of a drive that may lack an OpenVault-accessible control interface is a video drive that is like a VCR machine, where the only way to control the drive is through an external control panel with stop, play, rewind, forward and pause control buttons.
Design goals for the DCP are to allow implementations for any:
The MLM Server interface to DCP is called the Abstract Drive Interface (ADI). ADI provides a common drive interface for the MLM Server, thus abstracting away all of the details of whether and how a DCP implements drive control. ADI is distinct from the underyling drive control interface -- it is a higher level, abstract interface. A DCP maps between ADI and the underlying drive control interface.
The use of canonical capabilities and modes of access is what permits DCP to hide implementation details such as the underlying local control and access methods for the device.
---------------------------------------------
| |
| OpenVault-accessible |
| Control Interface |
| |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
| | |
| Control Path | Data Path |
| | |
---------------------|---------- ----------
| | | |
| | | |
Mount | Load | | |
cartidge-> ===== drive -> ===== |
Mount Point Media Access Point|
| |
| |
---------------------------------------------
Figure 1 - DCP conceptual view of a drive
Once media is engaged at the media access point, media data may be accessed via the drive data path, if one exists.
A drive media access point may lack a data path. An example of a media access point that lacks a host connection and to which applications do not have access is a set of RGB lines that attach a video drive to a display device.
Currently, IRIX has limited device driver support for removable media drives that support partitioning of media. While ADI provides the required interface, the initial IRIX implementations of DCP may not support partitioned media.
The ADI and ADI/R use the same full-duplex, bi-directional, peer to peer low level communications as the CAPI and ALI languages.
The ADI language pair is similar to the ALI language pair.
Following is a description of the commands and command semantics of ALI and ALI/R.
It selects the appropriate logical instance of the drive according to the mode of access that is specified by the MLM Server. It creates the logical instance of the drive, as necessary, binds an opaque drive handle to this logical instance (i.e., in UNIX environment, this equates to creating or linking to a dev node). The drive handle may either be generated by DCP or specified by the MLM Server. It must be unique on the DCP host. DCP will return an error if it detects that the drive handle is in use on the local host. Generally, the MLM Server invokes this command as part of drive selection for a CAPI-mount, after load.
In the case that the drive is partitioned (eg: a CDROM or a high-end tape), the drive handle that will be created may be dependent on the partition. For example, most disks on UNIX platforms have the partition to be accessed encoded in the drive handle (i.e., dev node) that is created. The loaded media will be positioned to the specified partition. For drives that don't support partitioned media, a request to position to other than partition START will return an error.
Attaching to partition START means position to the physical beginning of the recordable media surface (i.e., for tape, this is a rewind to BOT). If no partition is specified, the default is the same as attaching to position START.
Partition names have been canonicalized, see Pre-Defined Tokens and Descriptions for more examples of partition names.
Note that positioning the media may require the DCP to have access to a data path to the drive, and otherwise may not be supported.
Typically, a drive has a shared control/data path. In this case, the drive handle that is passed back to the MLM Server is ultimately passed back to an OpenVault Client Application. The application uses the drive handle to establish access to the drive control/data path.
The attach command allows the MLM Server to change the drive mode of access multiple times, without changing its name from an OpenVault Client Application point of view. However, in order for the change to affect the application, the application must re-establish its access after each attach.
The MLM Server ensures that the specified mode of access is consistent with the drive capabilities.
It removes the logical instance, as necessary, and the binding created by an attach command (i.e., in a UNIX implementation, this may equate to removing a dev node entry or a link to a dev node entry associated with this device). This invalidates a drive handle returned by a prior attach command. For drives with a shared control/data path, this disables an OpenVault Client Application from establishing access to drive control and data paths through this handle. Generally, the MLM Server invokes this command as part of drive deselection for an CAPI-unmount, before the unload command.
The MLM Server and DCPs should try to ensure that applications do not continue to access drive control or data through a drive handle that has been invalidated by detach. Note that detach/attach may have no immediate impact on an application that was already accessing the drive control and data paths. Once the application has established its access, it may be able to proceed to access the drive control and data paths, without being affected by subsequent invocations of the attach/detach command. A case in point is with random access media and UNIX applications that perform an open-read/write-close system call sequence in which the drive handle is passed by the application as an argument only to open. In this case, the effects of the attach/detach command may only be realized upon open. The detach/attach commands may have no effect on the reads and writes that occur between open-close.
If there is a cartridge present at the drive mount point, this moves the cartridge to the media access point, and the engages its such that the media is accessible at the media access point. The drive is said to be loaded at this point. Minimally, load verifies that the drive is loaded. This command does not identify which media is engaged. It is invoked by the MLM Server as part of an CAPI-mount.
Normally, the ALI mount command associated with the CAPI-mount causes the drive to be loaded (i.e., the library causes the load to happen) so the DCP load command need only verify that the drive is loaded.
If the drive is loaded, this command disengages the media, returns it to its cartridge as necessary, and returns the cartridge to the drive mount point. The drive is said to be unloaded at this point. This command rewinds media before disengaging, as necessary. Minimally, it detects whether the drive is already unloaded. It is invoked by the MLM Server as part of a CAPI-unmount.
This command is supported for all OpenVault-managed drives, but is a no-op for drives that lack an OpenVault-accessible control interface.
Note that activate enable may require the DCP to have access to a data path to the drive, in addition to a control path, and may otherwise be a no-op.
In the case that multiple DCPs are associated with the same drive (i.e., drives attached to multiple hosts), the MLM Server ensures that only one DCP at a time is actively controlling the drive.
Note that activate disable may require the DCP to have access to a data path to the drive, in addition to a control path, and may otherwise be a no-op.
Attributes are a mechanism by which information that is not contained in the normal configuration data passed to the MLM Server can be accessed. Examples include data that is unique to that drive type or data that varies over time.
Attributes may read/write or read-only. If the attributes represent internal information or settings associated with the drive itself, the DCP would send corresponding requests to the drive, then return that information.
Note that show commands that query information directly from a drive may require that DCP have access to a data path to the drive, and otherwise may return an error.
The config command copies configuration information, especially the offered capabilities of the drive, from the DCP up to the MLM Server for use. The MLM Server stores a non-authoritative copy of all such information for all the DCPs it controls. Each DCP must use the config command in ADI/R to update the copy of the configuration information in the MLM Server whenever it changes.
In a full scope, all information associated with the DCP should be deleted and replaced with the information listed in the config command. In a partial scope, only the pieces of information about the DCP that are listed in the config command should be replaced. It is expected that the norm will be to use the full scope option only on startup and/or major changes to drive configuration.
The config command is used to copy a list of each of the modes of access that the drive may be used in to the MLM Server. Each mode has a name and will have additional characteristics:
The config command is additionally used to provide the core with information regarding the state of the drive (i.e. whether or not the drive is loaded). This is accomplished by using a drive clause.
Syntactic conventions are the same as for CAPI, including that single quotes may be used in place of double quotes.
| commands |
attachStmt detachStmt loadStmt unloadStmt activateStmt resetStmt exitStmt attributeStmt showStmt cancelStmt responseStmt |
| attachStmt |
attach attachArgs ; |
| attachArgs |
/* empty */ task [ string ] attachArgs modename [ string ] attachArgs drivehandle [ string ] attachArgs partition [ string ] attachArgs |
| detachStmt |
detach detachArgs ; |
| detachArgs |
/* empty */ task [ string ] detachArgs drivehandle [ string ] detachArgs |
| loadStmt |
load task [ string ] ; |
| unloadStmt |
unload task [ string ] ; |
| activateStmt |
activate activateArgs ; |
| activateArgs |
/* empty */ task [ string ] activateArgs enable activateArgs disable activateArgs |
| resetStmt |
reset task [ string ] ; |
| exitStmt |
exit task [ string ] ; |
| attributeStmt |
attribute attributeArgs ; |
| attributeArgs |
/* empty */ task [ string ] attributeArgs type [ string ] attributeArgs name [ string ] attributeArgs set [ string string ] attributeArgs unset [ string ] attributeArgs |
| showStmt |
SHOW showArgs ; |
| showArgs |
/* empty */ task [ string ] showArgs type [ string ] showArgs name [ string ] showArgs report [ listOfStrings ] showArgs reportmode [ string ] showArgs |
| cancelStmt |
cancel cancelArgs ; |
| cancelArgs |
/* empty */ task [ string ] cancelArgs whichtask [ string ] cancelArgs |
| responseStmt |
response responseArgs ; |
| responseArgs |
/* empty */ whichtask [ string ] responseArgs accepted responseArgs unacceptable responseArgs success responseArgs error [ string ] responseArgs cancelled responseArgs text [ listOfStrings ] responseArgs |
| listOfStrings |
/* empty */ string listOfStrings |
| string |
STRING |
| commands |
configStmt messageStmt readyStmt attributeStmt showStmt cancelStmt responseStmt |
| configStmt |
config configArgs ; |
| configArgs |
/* empty */ task [ string ] configArgs scope [ string ] configArgs config [ string ] configArgs cap [ string configCapArgs ] configArgs |
| configCapArgs |
/* empty */ attr [ string string ] configCapArgs caplist [ listOfStrings ] configCapArgs |
| messageStmt |
message messageArgs ; |
| messageArgs |
/* empty */ task [ string ] messageArgs who [ string ] messageArgs severity [ string ] messageArgs text [ listOfStrings ] messageArgs |
| readyStmt |
ready readyArgs ; |
| readyArgs |
/* empty */ task [ string ] readyArgs disconnected readyArgs not [ listOfStrings ] readyArgs |
| attributeStmt |
attribute attributeArgs ; |
| attributeArgs |
/* empty */ task [ string ] attributeArgs type [ string ] attributeArgs name [ string ] attributeArgs set [ string string ] attributeArgs unset [ string ] attributeArgs |
| showStmt |
show showArgs ; |
| showArgs |
/* empty */ task [ string ] showArgs type [ string ] showArgs name [ string ] showArgs report [ listOfStrings ] showArgs reportmode [ string ] showArgs |
| cancelStmt |
cancel cancelArgs ; |
| cancelArgs |
/* empty */ task [ string ] cancelArgs whichtask [ string ] cancelArgs |
| responseStmt |
response responseArgs ; |
| responseArgs |
/* empty */ whichtask [ string ] responseArgs accepted responseArgs unacceptable responseArgs success responseArgs error [ string ] responseArgs cancelled responseArgs text [ listOfStrings ] responseArgs |
| listOfStrings |
/* empty */ STRING listOfStrings |
| string |
STRING |
| Error String | Meaning | ADI Commands |
|---|---|---|
| ADI_E_NONE | no error | |
| ADI_E_PART | unknown/unsupported partition | attach |
| ADI_E_MODE | unknown/unsupported mode | attach |
| ADI_E_HANDLE | unknown/in use handle | detach |
| ADI_E_NOATTR | unknown attribute | attribute, show |
| ADI_E_NOTYPE | unknown type | attribute, show |
| ADI_E_NOCMD | unknown command | |
| ADI_E_NOTASK | unknown task id | cancel |
| ADI_E_ACCESS | access denied/object inaccessible | attach, detach, attribute, show |
| ADI_E_BADVAL | bad attribute value | attribute |
| ADI_E_AGAIN | retry recommended | |
| ADI_E_READY | target not ready | attach, detach, load, unload, attribute, show, cancel, reset |
| ADI_E_SEQUENCE | command sequence error | |
| ADI_E_DRIVE | drive/device failure | activate, attach, load, unload, attribute, show, reset |
At least one DCP is associated with each drive that is under OpenVault management. Normally, a drive is controlled through a host to which it is physically attached. The associated DCP resides on that host and interfaces to the drive through an underlying local device driver. For a multi-hosted drive, multiple DCPs are associated with the drive, one for each host to which the drive is attached. The DCP associated with a drive that has no OpenVault-accessible access interface may reside on any host so long as it can communicate with the MLM Server.
The underlying interprocess communication and authentication mechanisms for ADI are the same as for CAPI.
A DCP may only support or be used by one MLM Server, so a DCP must have a means to authenticate the MLM Server.
DCP may have to run with privileges in order to implement the binding of a drive handle to a logical instance of a drive (i.e., under UNIX, a DCP must run as root in order to perform setuid & setgid ops so it can create and remove dev nodes).
Administration and coordination of drives and DCPs is centralized within the MLM Server. The MLM Server maintains in a database information about drives that are under its management. Some of this information is persistent, such as the drives that the MLM Server manages and the DCP that is currently controlling the drive. Other information is collected by the MLM Server from DCPs, including DCP communication address and configuration. The MLM Server consults its database to assist it with drive selection and routing requests to the correct DCP.
The MLM Server ensures that only one DCP at a time is actively controlling a drive that is attached to multiple hosts. If the MLM Server switches the controlling DCP, it sends an activate disable command to the old controlling DCP to force it to stop communicating with the drive hardware, then it sends an activate enable command to the new controlling DCP to force it to resynchronize with the drive hardware.
A legal mode of access is expressed a combination of a set of capabilities, and a DCP may have several legal modes of access for its drive. At boot time, the DCP reports its legal modes of access to the MLM Server as part of its configuration.
OpenVault uses this information to assist with drive selection. It has a mechanism by which it can compare the desired or requested mode of access with the legal modes of access for a DCP.
There will be a canonicalized list of capability names that applications can request and DCPs may advertise, thereby allowing the MLM Server to match application requrements against DCP abilities.
A key OpenVault goal that impacts the strategy of its slave control programs for managing state is that a control program should maintain minimal persistent state in order to accelerate crash recovery for control programs. A DCP-specific goal for fault tolerance is that DCP should avoid interfering with application access to the drive whenever possible, including across DCP reboots. The DCP strategy for managing internal state attempts to balance these two somewhat conflicting goals. In order to support continuous application access to the drive, a DCP must maintain some persistent state.
Consider that once it has a drive handle for a host-attached drive, an OpenVault Client Application may establish access to the drive independent of the state of the DCP. Even if the DCP crashes, so long as the application/DCP-host remains up and the drive control and data paths remain available, the application may continue to access the drive. The DCP should not interrupt this access unnecessarily.
There is a back-channel protocol from the DCP to the MLM Server, called ADI/R, which includes the means to create/access persistent attributes stored in the OpanVault database. When a DCP boots, it queries the OpanVault database to recover any state it deems neccessary from those attributes.
The following drive configuration attributes will be maintained by DCP for its drive. These attributes will be maintained persistently, such as in a configuration file on the machine where DCP resides.
A single DCP may service only one MLM Server.
While DCP may be tested in a standalone mode, it cannot be operated in a standalone mode. It must be front-ended by the MLM Server.
All drives under OpenVault management have an associated DCP, minimally to manage drive configuration. However, drive-control is exercised only for drives that have an OpenVault-accessible control interface. For these drives, a current requirement is that the OpenVault Client Application reside on the same host as the controlling DCP. The drive handle issued by a controlling DCP is assumed to be meaningful only in the context of the host on which that DCP resides. The drive control and data paths are directly accessible by an application on the same host as the controlling DCP. Once the application has a drive handle, it may access drive control and data paths directly, independently of the DCP.
A decision regarding drives that have an OpenVault-accessible access interface is to require the OpenVault Client Application and controlling DCP to reside on the same host. While multiple quasi-standards for remote access to drives exist, currently, there is no standard mechanism that works across all operating system and network environments. OpenVault does not attempt to provide such a mechanism. This decision limits the types of failures from which a DCP can recover on its own in order to achieve high availability. Specifically, it makes no sense to failover a DCP alone. Failover would only be effective at the host level, so that the application and DCP are failed over together to another host to which the drive is connected. Given that DCP hosts may be from different vendors, and running different OSs, it is not clear how host failover will be handled, or whether a generic mechanism is required. IRIS FailSafe may be sufficient to achieve high availability for DCP on paired IRIX systems.
The MLM Server must ensure that
Not all ADI abstractions and commands are supported for all drives. For example, drives that have no OpenVault-accessible control interface have no underlying control and access methods on the DCP host. For these drives, only the attribute and show commands are supported.
Not all DCP attributes and modes of access apply to all drives.
No drive name is passed in commands or responses, since this is implicit in the DCP that was selected by the MLM Server.
The modeName argument to the attach command is intended to be extensible in the sense that new capabilities may be added as needed to support new drives.
Drive mode is only included in the attach command. If an MLM Server wants to leave a drive mounted, allow the application to access the drive through the same drive handle, but with different settings or access permissions, it must do another attach. An application must re-establish access to a drive (i.e., under UNIX, close and then open the drive) after attach in order for new mode or access permissions to have effect.
The attach command intentionally allows media positioning only at the granularity of partition, since the DCP view of media is that it is divided into one or more physical partitions. Positioning to finer granularity (i.e., tape file or record marks) is handled by the OpenVault Client Application.
For some drive types that support partitioned media, the unload command need not, in fact should not, cause a rewind. This is to reduce average seek time.
It is assumed that DCP is the only reliable authority with respect to drive configuration.
It is assumed that there will be an authority (either under OpenVault or the IRIX operating system) for the canonical lists of the devices and media that are supported under the IRIX operating system. Names used within OpenVault to identify device and media types are consistent with the information maintained by this authority.
It is assumed that the MLM Server performs access checks to enforce access control specified in DCP configuration.
The following operations were intentionally left out of the DCP specification. It is expected that these will be implemented by OpenVault Client Applications, as necessary.
Need to explore state management, autoconfiguration, crash recovery and high availability in more detail. A point that is unique to DCPs and drives that have an OpenVault-accessible control interface is that OpenVault Client Applications have direct access to the device. A high-availability implementation needs to take into consideration that the application resides on the same host as this DCP.
The attach (with a position argument) command has performance implications. For high capacity media, such as D2, that need not be rewound between mount/unmount, and for which the average search or position time is relatively long, it would be undesirable to position back to the beginning of the media for each mount.
Need to define canonically the default modes of access to different types of drives.
Need to expand upon idea and implementation of authority for devices supported under IRIX.