1. Field of the Invention
The present invention relates to a method of accessing a remote logic device, and more particularly to a method of multi-path accessing a remote logic device under a Linux system.
2. Related Art
Storage area network (SAN) refers to a technology for connecting a plurality of distributed storage devices in Internet into a large-scale virtual storage device according to the communication protocol standard of an internet Small Computer Systems Interface (iSCSI). A user accesses data in a remote logic disk through the SAN, like accessing data in a local hard disk. Compared with the conventional Redundant Arrays of Independent Disks (RAID) technology, the SAN established through using the iSCSI technology has both the high-speed transmission characteristic of a small computer system interface (SCSI) and a high expandability superior to a conventional storage device. Therefore, the SAN has gradually become a hot technology in the relevant field of information storage. The SAN includes two parts, i.e., an initiator and a target. The so-called initiator may be considered as the one requesting for the access service, whereas the target may be considered as the one for providing a storage device. The target generates a plurality of logic unit numbers (LUNs). Those LUNs are respectively corresponding to physical storage devices in the network. Once a session is established between the initiator and the target, the LUNs may be obtained at once and then assigned to the users. The user visits the LUNs and accesses the aforementioned physical storage devices through an iSCSI command. Generally, only one session may be established between the initiator and the target. If multi-path input/output is allowed to be established between the initiator and target, the efficacies of fault tolerance, backup and load balancing may be achieved.
Generally, a server installed under a Linux operating system is superior to that under the Windows operating system in the efficiency and stability. It means high system stability, if a service server adopting a Linux operating system. In addition, if the service server supports multi-path input/output and avoids data repetition, the system availability and data reliability may be enhanced. However, under the Linux operating system, some initiators and targets of the SAN cannot support the multi-path input/output at all. Moreover, although some initiators and targets do provide multi-path input/output, it may be found that the accessed data are identical when visiting different LUNs. Therefore, how to make the SAN support multi-path access under the Linux system and how to avoid the circumstance that two logic devices have the same content have become important issues in the field of SAN.
In view of the above problems that the Linux system does not support multi-path access of remote logic devices, or the same data is obtained when accessing different LUNs, the present invention is directed to a method of multi-path accessing a remote logic device under a Linux system, in which all the connected devices in the connected hosts that access the same LUN are found out, and then grouped into a unique mapping device, so that each mapping device is mapped into a different LUN, so as to solve the above problem of accessing the same data.
In order to support the multi-path access of a remote logic device and to avoid the circumstance that the same data is obtained when accessing different LUNs, the present invention provides a method of multi-path accessing a remote logic device under a Linux system, which includes the following steps. Firstly, a communication is established between an initiator and a target. Next, the initiator requests to establish plurality of sessions with the target. Then, the initiator obtains at least one iSCSI-connected host assigned by the target. Then, the initiator obtaining a connected device messages from the corresponding iSCSI-connected host, through transmits a report LUN command. Finally, the initiator configures a device mapper, and the device mapper generates information about redundant devices according to the obtained connected device and the corresponding LUN, and maps the redundant connected devices into a unique mapping device (i.e., a mapped LUN). The so-called redundant connected devices refer to a plurality of connected devices that access the same LUN.
According to a preferred embodiment of the present invention, the communication may be a communication established according to a TCP communication protocol or an UDP communication protocol. The steps for establishing the link session are listed as follows. Firstly, the initiator transmits an iSCSI login request packet to the target; then, the target determines whether to permit an access request of the initiator or not according to a security authentication and a password parameter parsed from the iSCSI login request packet; and finally, the target feeds back an iSCSI login response packet to the initiator and establishes the link session.
According to a preferred embodiment of the present invention, the piggyback information of the iSCSI login response packet includes a connection permission instruction and a connection status. In addition, the report LUN command is loaded in a command description block of the iSCSI packet.
According to a preferred embodiment of the present invention, when one of the sessions is flow congestion, the device mapper performs a network diffluence means, so as to switch part of the flow to another mapping device for balancing the traffic load. In addition, when these sessions are interrupted, the device mapper switches to another mapping device to transmit a data packet.
Based upon the above, in the present invention, after the link session has been established, the target transmits a report LUN command to obtain the message about the connection devices of the iSCSI-connected host. Then, the initiator configures the device mapper to map the connected devices of the same LUN into a unique mapping device, thereby avoiding the circumstance that, when accessing different connected devices, it connects to the same LUN and accesses the same data.
The present invention will become more fully understood from the detailed description given herein below for illustration only, which thus is not limitative of the present invention, and wherein:
The objectives and the method provided in the present invention will be illustrated below in detail through the following preferred embodiments. However, the concept of the present invention may also be used in other scopes. The following embodiments are merely intended to illustrate the objectives and implementation manner of the present invention, but not intended to limit the scope of the present invention.
Accordingly, a communication between the initiator and the target further is established through the following steps. Firstly, the initiator transmits an iSCSI logon request to the target. Next, the target parses a security authentication and a password parameter in the iSCSI login request packet. Once it is determined to be legal, an access request from the initiator is permitted. At this time, the target feeds back an iSCSI login response packet to the initiator, so as to establish a link session. In this embodiment, the communication is established through using a TCP communication protocol or a UDP communication protocol, which is not limited here.
The piggyback information of the iSCSI packet (such as the iSCSI login request packet or the iSCSI login response packet) transmitted by the initiator and the target usually includes information such as a connection permission instruction and a connection status. Once the communication is established, the initiator loads a report LUN command in a command description block of the iSCSI packet.
Since each mapping device includes a plurality of connected devices, and the LUNs of the target may be accessed through different sessions, the network diffluence purpose may be achieved. For example, through the mapping device 332, the same LUN 322 may be accessed via different sessions established by different connected hosts (312 and 314), thereby achieving the network diffluence purpose. In addition, when one session is congestion, a network diffluence means is performed, so as to switch part of the flow to another mapping device for balancing the traffic load. When the link session is interrupted, another redundant connected device in the mapping device is used to access the original LUN in another path, and resumes the transmission of data packets, thereby avoiding the interruption of the connection.
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.