.rh SCSI-2 Medium Changer Device Class Model -- October 1987 .rh Document 87-187, Revision 1 Gary Stephens, IBM Corp. .fo on :h3.Medium Changer Device Class Model .* :h4.Introduction :p The Medium Changer device class provides an auxillary device to perform operations normally handled by a human operator. Defined activities include mounting and dismounting removeable volumes for various read/write device classes currently defined in SCSI and called primary devices in this model. :p The primary devices must have a removeable medium attribute indicated in response to an INQUIRY command. A Primary device is accessible via the interface in the manner defined for its device class. Candidate device classes for primary devices are direct access, sequential, and all optical device classes. :p Activity to standardize the physical location of the volume entry port of a primary device or of a storage area is outside the scope of this model or this interface. :p However, some standardization does exist relative to some removeable volume form factors. This level of standardization should permit physical interchange of volumes between Medium Changer devices supporting compatible removeable volume types. :p Format compatability of the medium data content is outside the scope of this model. Sequential access devices do have some physical and logical recording format standardization which has been in place for many years which should enhance the portability of both the physical and the logical content of sequential access device volumes. :p Some existing data interchange formats which are de facto or defined standards should permit data portability in some areas (e.g., graphics, spreadsheets, data bases). .* .* :h4.Physical Elements .* .* The medium used is defined uniquely for each primary device class and device type within each class. :p A volume is a complete unit composed of a container and the medium. The physical characteristics of a volume are defined for the device type, not the device class. :p A removeable volume is a volume which shares a single primary device with other volumes or is used on different devices. Some device classes define a command to logically prevent removal of the medium but that function does not change the removeable attribute of a volume. :p A Volume Accessor is an active element used to transport removeable volumes. A Volume Accessor must support at least one removeable volume type; it may support multiple removeable volume types (e.g., a robot with a set of interchangeable adapters available). If a Volume Accessor is of this complex type it is the responsibility of the Medium Changer device to perform adapter changes without explicit initiator action. :p A volume label is an external machine readable identification of a volume to permit volume inventory management and error checking for volume accessor actions. :p A Storage Area is a defined place where volumes are stored in a logical and orderly manner. A Storage Area must be accessible by at least one Volume Accessor. A Storage Area contains only one removeable volume type. If a Volume Accessor has access to a Storage Area, it must have physical access to all volumes in that Storage Area. :p A Primary Device is an active element accessible to a Medium Changer device which controls access to the medium for reading and optionally writing once a volume is mounted. Not all candidate primary device classes permit writing to the medium. A Primary Device must be accessible by at least one Volume Accessor. The Primary Device need not be aware that it is serviced by a Medium Changer device. :p The domain of a Volume Accessor is the set of all storage areas and primary devices, and volumes present in Storage Areas, Volume Accessors, and Primary Devices which it can service. The minimum defined function for a Volume Accessor is that it be capable of transporting compatible removeable volumes between a Storage Area and a Primary Device. :p. A Medium Changer device is an electro-mechanical mechanism which, minimally, :ul :li. has access to at least one storage area with a minimum capacity of one volume of one removeable volume type, :li. has access to at least one primary device of a compatible removeable volume type, :li. controls at least one volume accessor capable of transporting a volume between a storage area and a primary device of a compatible removeable volume type, :li. responds to commands to transport volumes from one place to another within its domain through at least one SCSI ID. :eul :p The domain of a Medium Changer is the set of domains of all Volume Accessors which it controls. A device outside the domain of a Medium Changer device is called a remote device. :p Options permitted for physical implementations include multiple primary devices mixing the same or differenct classes; multiple volume accessors with single or multiple removeable volume type support; and multiple storage areas mixing the same or different removeable volume types. Additionally, import and export stations for each removeable medium type supported may be imlemented. These stations are treated as special storage positions for the Medium Changer. Each pair of Import/Export stations are assigned a Storage Area name just as other Storage Areas. :p This diversity of implementations is achieved by masking most if not all medium changer physical attribute selection from initiators. That is, only logical addressing of volumes, volume accessors, storage areas, and primary devices is permitted. This type of referencing is consistent with current device support in SCSI. .* .* :h4.Logical Elements .* .* :p.Certain logical constructs are required to support the physical elements defined above. They are defined below. :p Each volume has a set of attributes associated with it which are similar to those for a device. The Primary Device acquires two additional status reports when reports are sent from the Medium Changer device. .fo off .sp VOLUME PRIMARY DEVICE Available Powered On Unavailable Powered Off Unavailable (MCD Only) No Longer Unavailable (MCD Only) Mounted Ready Dismounted Not Ready Busy Busy Not Busy Not Busy No Longer Busy Label PATH ID/SCSI ID/LUN/Sub-LUN .fo on :p Volume Available indicates that the selected Medium Changer device has access to the volume. :p Volume Unavailable is a state where a volume is not found in the domain of the selected Medium Changer Device. :p Volume Mounted indicates that a volume is under the control of a primary device where the primary device is capable of executing commands that cause the medium to be moved or spun. When a volume is inserted in an import station, its status changes from Volume Unavailable to Volume Dismounted (See definition below). When a volume is placed in an export station, its status changes from Volume Dismounted to Volume Unavailable. :p Volume Dismounted is the state when a volume resides in the Stroage Area or is under the control of a Volume Accessor. When a volume is placed in an export station it status changes from Volume Dismounted to Volume Unavailable. :p Volume Busy is a state when a volume is mounted or scheduled for mounting. :p Volume Not Busy is a state when a volume resides in the Storage Area or is under control of a Volume Accessor, but not scheduled for immediate mounting. :p The Volume No Longer Busy state results from a previous attempt to access a volume that was in the Volume Busy state. This report is best implemented through Asynchronous Event Notification. :p The Primary Device Unavailable status is unique to the Medium Changer device class. This status indicates that a requested Primary Device currently cannot mount the requested volume. :p The Primary Device No Longer Unavailable status reports that a Primary Device, which was given Primary Device Unavailable status at an earlier time, is now available. This is best implemented through Asynchronous Event Notification. :p Path ID (identification) is a unique, but arbitrary name assigned to each unique interface connected to the set of Primary Devices. Primary devices in the same "daisy chain" are on the same path. :p Each Volume Accessor in the domain of a Medium Changer is assigned a unique name that need have no relationship to its physical location. For configuration purposes, a Medium changer must be able to report the following items for each Volume Accessor in its domain: number of storage areas to which it has access; a list of the storage area names to which it has access; the number of primary devices to which it has access; a list of the names of the primary devices as known to the initiators when sending commands to the primary devices (including the Path ID). :p If the volume types of the storage areas and/or primary devices are not all the same, the Medium Changer is responsible to detect mismatches in type between source and destination names. In addition, if multiple volume types are present, it is the responsiblity of the Medium Changer device to select a proper Volume Accessor and to reconfigure the Volume Accessor to correctly transport each volume type when required. :p Each Storage Area has a name associated with it that has no necessary relationship to its physical location. A unique default name is assigned to each storage area within the domain of a medium changer, including each set of import/export stations. The Medium Changer device must be able to report the number of storage areas available, the name and type of each storage area relative to removeable volume type, and the capacity, in volumes, of each storage area. In addition, the current inventory count of volumes must be available. :p The location of each storage position in each Storage Area is assigned a logical storage address. The logical storage address begins at zero for each storage area and increments by one for each available storage position. The logical storage address of an available storage position must be available upon request. An exception occurs when a storage area is full and the next available position is requested. Two report forms are required: 1) next available storage position by removeable medium type for the Medium Changer device to include Storage Area name and Storage Position, and, 2) next storage position for each Storage Area name. :p The Medium Changer device must keep a catalog of volumes referencable by volume label and, independently, by the Storage Area/Storage Position. The mechanism for lookup is not defined for either reference method. The preferred method of reference for motion-type operations is by volume label. Reports based on volume label or Storage Area/Storage Position must be available for one volume label name or storage position at a time if requested. :p .fo off .sp STORAGE AREA REPORTING ELEMENT SUMMARY .sp Storage Area/Position Volume Label Volume Status .sp ABC / 00001 MYDISK Available/Mounted/Busy ABC 00003 PAYROL Available/Dismounted/Busy Capacity = 4 Removeable Medium Type = Optical 3.5 In Volumes Present = 2 Storage Area Type = Storage Next Avail Posn = ABC/00000 .fo on :p Primary Device attributes listed in the first table above may be determined by an initiator independent of the Medium Changer device except for the Primary Device Available, Unavailable, and No Longer Unavailable attributes. The definitions of the Primary Device terms, other than these two attributes, are found in the device model for the appropriate device class. :p The Medium Changer device must be able to report the following about the primary devices in its domain: number of primary devices, complete SCSI identification of each primary device and its device type, and each devices current capability to accept a volume. :p The mechanism for assigning the physical location of a primary device to the SCSI identification is outside the scope of this model and is left as an implementation detail during installation. :p Since duplication of SCSI identification is possible with multiple interfaces attached to the set of primary devices, the Medium Changer must report a new addressing element called a Path ID. Path IDs must be unique across the set of interfaces having access to the Medium Changer device primary devices. :p The mechanism for assigning Path IDs to the primary devices is not a SCSI data requirement and so it is outside the scope of this model and is left as an implementation detail during installation. :p The intelligent elements above the initiators must be able to recognize which reported Path IDs it has access to (one or more). When commands are issued through an initiator, the Path ID is not used since the path to the primary device was resolved when choosing a particular initiator to issue a command. :p All of the required reporting permits an initiator with access to a Medium Changer device to determine which storage areas and primary devices it has access to as well as the state of the various Storage Areas, Primary Devices, and removeable volumes in the domain of a single Medium Changer device. Multiple Medium Changer devices may be accessible to a single initiator with overlapping Storage Areas, Volume Accessors, and Primary Device identifications. Analysis of the reports would indicate a redundant path to the same Medium Changer domain which is permitted in this model. :p The method of operation for the Medium Changer device is similar to that performed by a third party COPY manager. The device receives the command, verfies the status of the selected volume, appropriate Volume Accessor, and the selected Primary Device. If there is no logical conflict, the command is executed and then the initiator is informed of the result. :p If the Medium Changer device is implemented with an initiator mode, it could conceivably mount and access its own volumes. The Medium Changer device could perform third party COPY manager functions or performing other operations independent of or at the direction of the primary initiators. :p The elements of the command set are outlined below without descriptions of each command or function within a command. :p .fo off R = M (Mandatory) or O (Optional) Command R COMMAND R COMMAND O COMPARE M REPORT/ALTER FOR STORAGE AREAS O COPY M REPORT/ALTER FOR VOLUME ACCESSORS O COPY AND VERIFY M REPORT/ALTER FOR PRIMARY DEVICES M INQUIRY M REPORT STORAGE POSITION M REQUEST SENSE M REPORT VOLUME M SEND DIAGNOSTIC O VERIFY STORAGE AREA M TEST UNIT READY O COMPRESS STORAGE AREA M PREVENT/ALLOW DISMOUNT MOVE M STORAGE TO DEVICE M DEVICE TO STORAGE O STORAGE TO STORAGE O DEVICE TO DEVICE O IMPORT TO EXPORT O IMPORT TO DEVICE O DEVICE TO EXPORT O IMPORT TO STORAGE O STORAGE TO EXPORT ASSIGN/UNASSIGN M PRIMARY DEVICE TO PATH ID O VOLUME TO PATH ID O STORAGE AREA TO PATH ID O VOLUME ACCESSOR TO PATH ID O VOLUME ACCESSOR TO STORAGE AREA O VOLUME TO STORAGE AREA/POSITION O PERMIT ACCESS BY ALTERNATE PATH ID Storage References require Storage Area Name and Logical Storage Position Primary Device References require Path ID, SCSI ID, LUN, SubLUN Valid Flag, SubLUN .fo on :p The common SCSI commands apply to this device class just as they apply to other device classes. :p The right column lists functions and does not necessarily require one command code for each name. For example, it might be possible to place all reporting function in one command with several modifier values. :p The Verify Storage Area function requires that the Medium Changer device be capable of verifying that each volume reported exists in its domain and that it is in the correct storage location. :p The Compress Storage Area function requires that the Medium Changer device move volumes from high logical storage addresses to low logical storage addresses such that the count of volumes is located in contiguous logical storage addresses in each Storage Area, beginning with logical storage address 0. :p The Prevent/Allow Dismount function allows an initiator to "permanently" mount a volume until allowed to be dismounted by the same initiator. This permits a stable volume configuration for selected applications and prevents accidental or deliberate dismount by any other initiator. :p The MOVE group of functions defines the mandatory and optional volume transport operations allowed within a Medium Changer device. Note that only two of the functions are mandatory, consistent with less complex implementations. :p The ASSIGN/UNASSIGN group of functions permits some partitioning of volumes, Storage Areas, Volume Accessors, and Primary Devices between the hosts. The method of control for changing these attributes is not defined at this time. They should function like Reserve/Release in that once an Assighment is made, it cannot be overridden by another initiator until it is Unassigned. Some level of function where two distinct paths share the same set of resources will probably be required (See Permit Access by Path). .* .* .pa :h4.Sample Configurations using the Model .* .* :p Medium Changer Device with Independent SCSI ID :p The first sample configuration is the basic Medium Changer device model. It consists of a single initiator sharing the SCSI bus with the primary devices and the Medium Changer device. This represents a minimum configuration for the Medium Changer device. The Medium Changer device is accessed with its own independent SCSI ID of 7 while the Primary Device is accessed using SCSI ID 1. SCSI IDs 2 through 6 are remote devices. (The SCSI ID allocation is arbitrary.) .kp on .fo off .sp 2 Independent SCSI ID Configuration - One Initiator PATH ID = A 7 |------------------------| 0 |-----|-----| | |---------| | MEDIUM | |-----------| |--|INITIATOR| | CHGR CTRL | |-| 1/0/x |--| |---------| |-----|-----| | |-----------| | | | | 2 |--| Digits = | | |-----------| | SCSI ID/ |-----------| |---|---| | | 3 |--| LUN/ | |--<->| |<->| |-----------| | SubLUN |-----------| |-------| | 4 |--| One |-----------| | Volume | 5 |--| Accessor |-----------| | | 6 |--| <-- SCSI Bus |-----------| One One Storage Area Primary Device One Position Five with Remote Devices One Volume .sp 2 .fo on .kp off :p The initiator, by polling or Asynchronous Event Notification, discovers the existence of a Medium Changer device type. It then queries the Medium Changer device for it Storage Area attributes, Volume Accessor attributes and its Primary Device attributes. :p From the information returned, the initiator is able to determine that a single Primary Device with the name (PATH=A, SCSI ID =1, LUN = 0, SubLUN = not defined) has access to 5 removeable volumes through one Volume Accessor. The initiator also discovers the 5 remote devices. :p The initiator proceeds to request a volume be mounted on the only Primary Device. Completion of the mount command by the Medium Changer device will be followed by a Unit Attention condition for the Primary Device when the device is ready. Normal operation with the Primary Device may then commence. :p At some later time, the initiator unloads, or voluntarily quiesces operations to, the Primary Device. It then commands the Medium Changer device to dismount the volume and place it in the Storage Area. .* .* .pa Two Initiator Congifuration :p This is similar to the first configuration with the fifth remote device converted to an Initiator, one of the remote devices converted to a second Primary Device, and the Storage Area increased to 5 Storage Positions. Both initiators discover the hardware configuration as described above. :p If Initiator 0 proceeds as described above, it will have a volume mounted on Primary Device (A/1/0/x). Initiator 6 can discover the busy state of the Primary Device through normal SCSI operations. However, if it issues a mount command for the same Primary Device to the Medium Changer device, the Medium Changer device may indicate Primary Device Unavailable or queue the command. :p If the Device Unavailable status is returned, when the volume is dismounted, the Medium Changer device sets a Unit Attention condition or performs Asynchronous Event Notification to inform Initiator 6 that the Primary Device is No Longer Unavailable. AEN reduces bus activity that would result from polling in a Unit Attention implementation. .kp on .fo off .sp 2 Independent SCSI ID Configuration - Two Initiators PATH ID = A 7 |------------------------| 0 |-----|-----| | |---------| |-----------| | MEDIUM | |-----------| |--|INITIATOR| | |-| | CHGR CTRL | |-| 1/0/x |--| |---------| |-----------| | |-----|-----| | |-----------| | | |-| | |-| 2/0/x |--| Digits = |-----------| | | | |-----------| | SCSI ID/ | |-| |---|---| | | 3 |--| LUN/ |-----------| |<->| |<->| |-----------| | SubLUN | |-| |-------| | 4 |--| |-----------| | One |-----------| | <-- SCSI Bus | |-| Volume | 5 |--| |-----------| Accessor |-----------| | 6 | |---------| |--|INITIATOR| One Two |---------| Storage Area Primary Devices Five Positions Three with Remote Devices Five Volumes .sp 2 .fo on .kp off .* .* .pa Integrated Medium Changer Congifuration :p This configuration shows how an integrated Medium Changer device might be implemented using the model with a single SCSI ID. The Medium Changer device has been assigned function through LUN 0, Sub-Logical Unit Number 0; only one SCSI ID is used; and, all remote devices have been converted to Primary Devices as Logical Units under the one SCSI ID. The resulting configuration is discovered as before by polling or AEN. :p The single Volume Accessor can physically handle only one motion operation at a time. However, it may queue additional requests per LUN for other Primary Devices or even for a Busy Primary Device LUN. :p Operations function as described in the preceeding examples with the addition of the Extended Identify message being required to send the Medium Changer device commands. .kp on .fo off .sp 2 Integrated Medium Changer Configuration - Two Initiators 1/0/0 |-----------------------| 0 |-----|-----| | |---------| |--------| | MEDIUM | |-----------|-|-| |--|INITIATOR| | |-| | CHGR CTRL | |-| 1/0/x | | | |---------| |--------| | |-----|-----| | |-----------| S | | | |-| | |-| 1/1/x | C | | |--------| | | | |-----------| S | | | |-| |---|---| |-| 1/2/x | C | | |--------| |<->| |<->| |-----------| |--| PATH ID = A | |-| |-------| |-| 1/3/x | I | | |--------| | One | |-----------| D | | <-- SCSI Bus | |-| Volume |-| 1/4/x | | | |--------| Accessor | |-----------| 1 | | 6 |-| 1/5/x | | | |---------| |-----------|---| |--|INITIATOR| One Six |---------| Storage Area Primary Devices Five Positions No Digits = with Remote Devices SCSI ID/ Five Volumes LUN/ SubLUN .sp 2 .fo on .kp off .* .* .pa Extended Primary Device Class Congifuration :p This configuration eliminates the need for a separate device class designation by adding the Medium Changer device command set to SCSI as optional commands for each appropriate Primary Device class. The primary device receives the Medium Changer command and passes it through an internal non-SCSI defined interface for execution. :p Operations function as described above with all commands sent to a Primary Device. .kp on .fo off .sp 2 Extended Primary Device Class Congifuration Undefined Interface to @ LUN |-----------| 0 |-----|-----| | |---------| |--------| | MEDIUM | |-|---------|---| |--|INITIATOR| | |-| | CHGR CTRL | |-| . 1/0/x | S | | |---------| |--------| | |-----|-----| | |-|---------| C | | | |-| | |-| . 1/1/x | S | | |--------| | | | |-|---------| I | | | |-| |---|---| |-| . 1/2/x | | | |--------| |<->| |<->| |-|---------| I |--| PATH ID = A | |-| |-------| |-| . 1/3/x | D | | |--------| | | |-|---------| | | <-- SCSI Bus | |-| One |-| . 1/4/x | 1 | | |--------| Volume | |-|---------| | | 6 Accessor |-| . 1/5/x | | | |---------| |-----------|---| |--|INITIATOR| Five |---------| Storage Areas Six 100 Positions Primary Devices Digits = with No SCSI ID/ 500 Volumes Remote Devices LUN/ SubLUN .sp 2 .fo on .kp off .* .* .pa Complex, High Availability Congifuration :p The last configuration shows one of the more complex configurations possible with the model. The value of the Path ID becomes evident when analyzing this configuration. .kp on .fo off .sp 2 Complex, High Availability Congifuration |---------| PATH E/0/0/x |INITIATOR|-| |-------|-| | | | PATH D/0/0 | | |---------| | | Storage A/7/0/x |-----------------------------|INITIATOR|---| | | Areas/Posns |-----|-----| |---------| ||-|| | |-----------| | MEDIUM | |-----------|---| |I H| | |SA 0 @ 500 |-| | CHGR CTRL | |-| 5/0/x |I S| PATH B/3/0 |D O| | |-----------| | |--|--------| | |-----------|D C| |---------| | S| | |SA 6 @ 750 |-| | |-| 5/1/x | S|--|INITIATOR|--|1 T| | |-----------| | ||------| | |-----------|1 I| |---------| | | | |SA B @ 200 |-| |.VA 0 .| |-| 5/2/x | | |---| | |-----------| |<->||-----||<-->| |-----------|---| | |SA Q @ 375 |-| |.VA 1 .| |-| 5/0/x |I S| PATH C/3/0 |---| | |-----------| | |------|| | |-----------|D C| |---------| |I H| | |SA 9 @ 900 |-| | |-| 5/1/x | S|--|INITIATOR|--|D O| | |-----------| |--------|--| | |-----------|2 I| |---------| | S| | | MEDIUM | |-| 5/2/x | | |1 T| | | CHGR CTRL | |-----------|---| PATH D/4/0 | | | |-----|-----| |---------| ||-|| | D/7/0/x |-----------------------------|INITIATOR|---| | | |---------| | | 2825 Volumes Maximum | | |-------|-| | PATH E/1/0/x |INITIATOR|-| |---------| PHYSICAL ADDRESSES DEFINED HOST 0 HOST 1 PATH A PATH B PATH E PATH E PATH C PATH D 0/0/x 2/0/x 0/0/x 1/0/x 3/0/x 4/0/x 7/0/x 5/0/x 5/0/x 7/0/x 5/1/x 5/1/x 5/2/x 5/2/x .sp 2 .fo on .kp off :p There are two Medium Changer devices which share the same pool of Volume Accessors, Primary Devices and Storage Areas. The Primary Devices have been configured to give each host access to one bank of Primary Devices. If either Path B or Path C fails, the other host continues to function. Similiarly, if either Medium Changer device fails, the other one has access to all volumes and Primary Devices. :p The interface on the far right is a fifth SCSI bus connecting the two hosts through two more initiators. This connection allows cooperation between the hosts in the event of a failure in either bank of Primary Devices or to request mount/dismount operations from the alternate Medium Changer device. Note that this form of operation, while requiring good host cooperation does not require any changes to the Medium Changer device configuration or command set. :p Operation proceeds as before, except that each host may eliminate information reported from its Medium Changer for Path IDs not available to it prior to commencing operations. With this configuration it is possible to accidentally or deliberately cause volumes to be mounted and dismounted for Host 1 from Host 0 or in the opposite manner. Either host could manage all such operations except when its Medium Changer device requires service or fails. .* .*