WO2017066944A1 - 一种存储设备访问方法、装置和系统 - Google Patents
一种存储设备访问方法、装置和系统 Download PDFInfo
- Publication number
- WO2017066944A1 WO2017066944A1 PCT/CN2015/092457 CN2015092457W WO2017066944A1 WO 2017066944 A1 WO2017066944 A1 WO 2017066944A1 CN 2015092457 W CN2015092457 W CN 2015092457W WO 2017066944 A1 WO2017066944 A1 WO 2017066944A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- virtual
- access
- storage device
- virtual machine
- adapter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/109—Address translation for multiple virtual address spaces, e.g. segmentation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45579—I/O management, e.g. providing access to device drivers or storage
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/65—Details of virtual memory and virtual address translation
- G06F2212/657—Virtual address space management
Definitions
- the embodiments of the present invention relate to the field of computers, and in particular, to a storage device access method, apparatus, and system.
- Virtualization technology originated from the need for time-sharing systems. The main goal was to run multiple operating systems on a single host to take advantage of the expensive computing resources on the mainframe. With the performance improvement of x86 processors and the popularity of applications, the development of virtualization technology has begun to enter the field of x86 architecture. Especially in the late 1990s, virtual-level software vendors opened the way for virtualization technology applications on the x86 platform, providing a virtual machine monitor (VMM) as the center for personal computers (Personal Computer) , PC) Software solution for server platform virtualization.
- VMM virtual machine monitor
- a virtual machine (VM) is responsible for virtualizing multiple independent, instruction set architects (ISAs) and virtual hardware systems with the same hardware on a hardware platform, where each virtual hardware system can run. Different operating systems, namely the guest operating system (Guest OS). The user operating system will access the actual physical resources through the virtual machine monitor VMM.
- the virtual machine accesses the peripheral device through a plurality of software layer conversion operations, and the access operation to the storage device has a mechanism redundancy. Therefore, new technologies need to be developed to solve this problem.
- embodiments of the present invention provide a storage device access method, apparatus, and system to simplify access operations of a virtual machine to a storage device.
- an embodiment of the present invention provides a storage device access method, by configuring an I/O adapter on a computer system to manage access operations of a virtual machine running on the computer system to the storage device, and an I/O adapter.
- an access instruction is generated according to the access request, and the access instruction is sent to the storage device target.
- the access instruction carries the virtual address information and the virtual machine
- the virtual channel is used to connect the virtual machine to the storage device target.
- the virtual machine corresponds to the virtual channel.
- the storage device target is used to manage access operations on the storage device.
- the virtual machine corresponds to the virtual channel one by one.
- the virtual channel refers to a data transmission channel that uses a storage transfer protocol to establish a unique connection relationship between the virtual machine and the storage device based on the physical physical medium during the data transmission process.
- the virtual channel and the virtual channel are identified to represent the unique connection relationship between the virtual machine and the storage device (the storage device target).
- Each virtual machine is identified by a unique virtual channel identifier.
- the virtual channel may have multiple implementation forms, for example, may be implemented by time-multiplexing physical connection channels.
- the virtual channel between the virtual machine and the storage device is maintained through the I/O adapter, and the identifier of the virtual channel corresponding to the virtual machine is added to the access command, thereby realizing the access of the virtual machine to the storage device, which simplifies the access process.
- the virtual channel has a one-to-one correspondence with the virtual machine, and one body corresponds to the virtual channel one-to-one, and also corresponds to the virtual machine one by one.
- corresponding to the virtual machine and “Corresponding to virtual channels” can be replaced with each other, and “associated with virtual machines” and “associated with virtual channels” can also be replaced with each other.
- the I/O adapter before the I/O adapter generates the access instruction according to the access request, determining the virtual channel corresponding to the virtual machine by querying the preset first correspondence
- the identifier where the first correspondence includes a correspondence between an identifier of each virtual machine and an identifier of each virtual channel, and the first correspondence may be configured in advance, or determined by negotiation between the I/O adapter and the storage device target.
- the implementation of the corresponding relationship may be various, for example, may be expressed in the form of a data table, or a register may be configured for each virtual machine, and the identifier of the corresponding virtual channel is stored in the register for representation. This is not limited.
- the I/O adapter is configured with at least one cache queue, each cache queue and each virtual channel One-to-one correspondence; after the I/O adapter obtains the access request from the virtual machine, if it is not currently in an idle state, or the load is large, the access request may be further placed in the first cache queue corresponding to the virtual channel of the virtual machine; Before generating an access instruction according to the access request, the access request is taken out from the first cache queue corresponding to the virtual channel of the virtual machine.
- the I/O adapter can be made more flexible, and the access request is not lost under heavy load, using a First In First Out (FIFO) structure.
- FIFO First In First Out
- a cache queue to cache access requests for all virtual machines is also an optional implementation, but the FIFO structure cannot distinguish information such as the priority of the virtual machine.
- the access request can be merged. It can also be combined.
- a third possible implementation manner of the first aspect if the I/O adapter acquires at least two access requests from the at least two virtual machines, The I/O adapter generates an access instruction according to the access request, including: the I/O adapter according to the priority of at least two virtual machines corresponding to the at least two access requests, and the access instruction corresponding to the virtual machine having the higher priority according to the priority order And then generate an access instruction corresponding to the virtual machine with a lower priority.
- the I/O adapter acquires at least two access requests from the at least two virtual machines
- the I/O adapter generates an access instruction according to the access request, including: the I/O adapter obtains the access order corresponding to the access request received according to the chronological order of obtaining the at least two access requests, and then generates the accessed access after the generation. Request the corresponding access instruction.
- the system architecture can be simplified, and only the FIFO cache structure is needed, and the access requests of different virtual machines need not be separately cached.
- the I/O adapter further obtains the access instruction from the storage device after the access instruction is sent to the storage device target device
- the feedback message of the target device includes the execution result of the access instruction and the identifier of the virtual channel of the virtual machine, and determines the virtual machine according to the identifier of the virtual channel, and sends the execution result of the access instruction to the virtual machine.
- the I/O adapter obtains an access request from the virtual machine, including: the I/O adapter receives the The first doorbell notification of the virtual machine is obtained, and the access request is obtained from the I/O shared ring shared by the virtual machine, and the access request is placed in the I/O sharing ring by the virtual machine, and the first doorbell notification is used to refer to The I/O sharing ring has an access request arrival; the I/O adapter sends the execution result of the access instruction to the virtual machine, including: the I/O adapter puts the execution result of the access request into the I/shared with the virtual machine. O shares the ring and sends a second doorbell notification to the virtual machine, and the second doorbell notification is used to indicate that the I/O sharing ring has an execution result arrival.
- the virtual machine runs on a computing device independent of the storage device, and the access instruction is a host bus adapter driver.
- the layer handles the small computer system interface SCSI command; the I/O adapter sends the access command to the storage device target, including: the I/O adapter sends the access command to the storage device target through the host bus adapter driver layer.
- the I/O adapter and the storage device target can transmit messages such as access commands through the HBA driver layer.
- an embodiment of the present invention provides a computer readable medium, comprising: computer executed instructions, when the processor of the computer executes the computer to execute an instruction, the computer performs the first aspect or any possible implementation of the first aspect The method in the way.
- an embodiment of the present invention provides a storage device access device, including: a processor, a memory, a bus, and a communication interface; the memory is configured to store an execution instruction, and the processor is connected to the memory through the bus when storing When the device access device is in operation, the processor executes the execution instructions stored by the memory to cause the device to perform the method of any of the first aspect or the first aspect.
- an embodiment of the present invention provides a storage device access method for managing a virtual machine access operation to a storage device, including: a storage device target device acquiring an access instruction, where the access instruction carries virtual address information and the virtual machine
- the virtual channel is used to connect the virtual machine to the storage device target.
- the virtual machine corresponds to the virtual channel.
- the virtual address information is used to indicate the virtual address of the storage area to be accessed in the virtual machine.
- the storage device target Determining, according to the virtual address information carried in the access instruction and the identifier of the virtual channel of the virtual machine, the physical address of the storage area to be accessed in the storage device; the storage device target is in the storage device according to the access instruction and the storage area to be accessed The physical address in the operation, the storage area to be accessed.
- the storage device target can identify different virtual machines, because the virtual channel represents the unique connection relationship between the virtual machine and the storage device, so even if the virtual machine identifier running on different physical machines has duplicates, the storage The device can also distinguish between different physical machines The virtual machine, thereby determining the physical address of the storage area to be accessed by the virtual machine according to the virtual address information and the identifier of the virtual channel of the virtual machine.
- the storage device target device determines, according to the virtual address information carried in the access instruction and the identifier of the virtual channel of the virtual machine, that the storage area to be accessed is in the storage device
- the physical address of the storage device includes: the virtual device information carried in the access command and the identifier of the virtual channel of the virtual machine, the second corresponding relationship is queried, and the storage area to be accessed is determined to be in the storage device.
- the physical address, wherein the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of a storage area allocated for each virtual channel.
- the second correspondence relationship is implemented in various forms, and may be expressed in the form of a data table, or a register may be configured for each virtual machine, and the identifier of the corresponding virtual channel is stored in the register for representation. This is not limited.
- the storage device target is configured with at least one cache queue, each cache queue and each virtual channel a one-to-one correspondence; after the storage device target obtains the access instruction, the method further includes: the storage device target device inserts the access instruction into the second cache queue corresponding to the virtual channel of the virtual machine; and the storage device target determines that the storage area to be accessed is in the storage Before the physical address in the device, the method further includes: the storage device target extracting the access instruction from the second cache queue corresponding to the virtual channel of the virtual machine.
- the storage device target can work more flexibly, and can respond to certain virtual machine traffic bursts in a targeted manner, and can preferentially process some according to needs.
- the access request of the virtual machine can also be combined for the access request that can be merged.
- the cache queue of the storage device target may also adopt a FIFO structure.
- the storage device target device obtains at least two access commands from the at least two virtual machines, Determining, by the storage device target, the physical address of the storage area to be accessed in the storage device, the storage device target first determining the priority according to the priority order according to the priorities of the at least two virtual machines corresponding to the at least two access instructions The physical address of the storage area of the high virtual machine to be accessed in the storage device, and then the storage area of the virtual machine whose priority is low is to be accessed. The physical address in the storage device.
- the storage device target can preferentially process access requests of virtual machines with important or high user service levels, which increases the flexibility of storage device target management for storage device access. Sex.
- the priority order can be adjusted dynamically.
- the storage device target determines that the storage area to be accessed is in the storage device
- the physical address of the storage device includes: determining, by the storage device target, the physical address of the storage area to be accessed corresponding to the access instruction received in the storage device according to the chronological order of obtaining the at least two access instructions, and then determining The physical address of the storage area to be accessed corresponding to the access instruction received in the storage device.
- the system architecture of the storage device can be simplified, and only the FIFO buffer structure can be used to meet the demand.
- the storage device target device is based on the access instruction and the physical address of the storage area to be accessed in the storage device After the operation of the access storage area, the method further includes: the storage device target returns a feedback message, where the feedback message includes an execution result of the access instruction and an identifier of the virtual channel of the virtual machine.
- an embodiment of the present invention provides a computer readable medium, including a computer executing instruction, when the processor of the computer executes the computer to execute an instruction, the computer performs any possible implementation of the fourth aspect or the fourth aspect.
- the method in the way.
- an embodiment of the present invention provides a storage device access device, including: a processor, a memory, a bus, and a communication interface; the memory is configured to store an execution instruction, and the processor is connected to the memory through the bus when storing When the device access device is in operation, the processor executes the execution instructions stored by the memory to cause the device to perform the method of any of the possible implementations of the fourth aspect or the fourth aspect.
- an embodiment of the present invention provides a storage device access device, configured to manage an access operation of a virtual machine running on a computer system to a storage device, including: an obtaining unit, configured to acquire an access request from the virtual machine.
- the access request carries the virtual address information of the storage area to be accessed;
- the generating unit is configured to generate an access instruction according to the access request, and the access instruction carries the virtual The address information and the identifier of the virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine to the storage device target, the virtual machine and the virtual channel are in one-to-one correspondence, and the storage device target is used to manage the access operation to the storage device;
- the generating unit before generating the access instruction according to the access request, is further configured to: query the preset first correspondence according to the identifier of the virtual machine, and determine the virtual channel The identifier, where the first correspondence includes a correspondence between an identifier of each virtual machine and an identifier of each virtual channel.
- the apparatus is configured with at least one cache queue, each cache queue and each virtual channel one by one Corresponding to: after the obtaining unit obtains the access request from the virtual machine, the acquiring unit is further configured to: put the access request into the first cache queue corresponding to the virtual channel of the virtual machine; and before the generating unit generates the access instruction according to the access request, the generating unit is further configured to: The access request is taken from the first cache queue corresponding to the virtual channel of the virtual machine.
- the acquiring unit acquires at least two access requests from the at least two virtual machines
- the generating unit is configured to: according to the access request
- the generating unit is configured to: according to the priority of the at least two virtual machines corresponding to the at least two access requests, the access instruction corresponding to the virtual machine having the higher priority according to the priority order, The access instruction corresponding to the virtual machine with lower priority is generated.
- the generating unit is configured to generate the access instruction according to the access request, including: generating the unit The access instruction corresponding to the access request received by the sir is firstly generated according to the chronological order of the at least two access requests, and the access instruction corresponding to the received access request is generated.
- the sending unit after the sending unit sends the access instruction to the storage device target, the acquiring unit is further configured to: obtain a feedback message from the storage device target, the feedback message includes an execution result of the access instruction and an identifier of the virtual channel of the virtual machine; the sending unit is further configured to: determine the virtual machine according to the identifier of the virtual channel, and execute the access instruction The result is sent to the virtual machine.
- the obtaining unit is configured to obtain an access request from the virtual machine, where the acquiring unit is configured to receive the first doorbell notification from the virtual machine, and from the I/O sharing ring shared by the virtual machine.
- the access request is placed in the I/O sharing ring by the virtual machine, the first doorbell notification is used to indicate that the I/O sharing ring has an access request, and the sending unit is configured to send the execution result of the access instruction to the
- the virtual machine includes: a sending unit, configured to put an execution result of the access request into an I/O sharing ring shared by the virtual machine, and send a second doorbell notification to the virtual machine, where the second doorbell notification is used to indicate the I/ The O share ring has an execution result arriving.
- the access instruction is a small computer system interface SCSI command that can be processed by the host bus adapter driver layer;
- the sending unit is configured to send the access instruction to the storage device target through the host bus adapter driver layer.
- the seventh aspect is a device implementation corresponding to the method of the first aspect, and the feature description in the first aspect or any possible implementation of the first aspect is applicable to any of the seventh aspect or the seventh aspect. The implementation method will not be described here.
- an embodiment of the present invention provides a storage device access device, which is configured to: manage an access operation of a virtual device to a storage device, and include: an acquiring unit, configured to acquire an access instruction, where the access command carries a virtual address The information and the identifier of the virtual channel of the virtual machine, the virtual channel is used to connect the virtual machine to the device, and the virtual machine is in one-to-one correspondence with the virtual channel, and the virtual address information is used to indicate the virtual address of the storage area to be accessed in the virtual machine.
- a determining unit configured to determine, according to the virtual address information carried in the access instruction and the identifier of the virtual channel of the virtual machine, a physical address of the storage area to be accessed in the storage device; and a processing unit configured to access and access according to the access instruction
- the storage area is the physical address in the storage device and the storage area to be accessed.
- the determining unit is configured to determine, according to the virtual address information carried in the access instruction and the identifier of the virtual channel of the virtual machine, that the storage area to be accessed is in the storage device
- the physical address includes: determining, by the determining unit, the virtual second address corresponding to the virtual channel and the identifier of the virtual channel of the virtual machine, and querying the preset second correspondence, determining that the storage area to be accessed is in the storage device
- the physical address, wherein the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of a storage area allocated for each virtual channel.
- the device is configured with at least one cache queue, and each cache queue and each virtual channel are one by one.
- the acquiring unit is further configured to: put the access instruction into the second cache queue corresponding to the virtual channel of the virtual machine; and the determining unit determines before the physical address of the storage area to be accessed is in the storage device, For: taking an access instruction from a second cache queue corresponding to the virtual channel of the virtual machine.
- the determining unit if the acquiring unit acquires at least two access instructions from the at least two virtual machines, the determining unit And determining, by the determining unit, the priority of the at least two virtual machines corresponding to the at least two access instructions, and determining the priority according to the priority order The physical address of the storage area of the virtual machine to be accessed in the storage device, and then the physical address of the storage area of the virtual machine with a lower priority in the storage device.
- the determining unit if the acquiring unit acquires at least two access instructions from the at least two virtual machines, the determining unit And determining, by the determining unit, the chronological order of acquiring the at least two access instructions according to the acquiring unit, and determining, to be accessed, the access instruction corresponding to the first received access command.
- the processing unit is treated according to the access instruction and the physical address of the storage area to be accessed in the storage device After the accessed storage area is operated, it is further used to: return a feedback message, where the feedback message includes an execution result of the access instruction and an identifier of the virtual channel of the virtual machine.
- the eighth aspect is a device implementation manner corresponding to the method of the fourth aspect, and the feature description in any of the possible implementation manners of the fourth aspect or the fourth aspect is applicable to any of the eighth aspect or the eighth aspect. The implementation method will not be described here.
- an embodiment of the present invention provides a storage device access system, including an I/O adapter and a storage device target, where an I/O adapter is used to obtain an access request from a virtual machine, and the access request carries the storage to be accessed.
- the virtual address information of the area and generates an access instruction according to the access request.
- the access command is sent to the storage device target, and the access command carries the virtual address information and the identifier of the virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine and the storage device target, the virtual machine and the virtual channel.
- the storage device target is configured to obtain an access instruction, determine a physical address of the storage area to be accessed in the storage device according to the virtual address information carried in the access instruction and the identifier of the virtual channel, and according to the access instruction and the to-be-accessed
- the storage area is the physical address in the storage device and the storage area to be accessed.
- the method further includes: determining, according to the identifier of the virtual machine, a preset first correspondence, and determining an identifier of the virtual channel, where the first correspondence is The correspondence between the identity of each virtual machine and the identity of each virtual channel is included.
- the I/O adapter is configured with at least one cache queue, each cache queue and each virtual channel One-to-one correspondence; after the I/O adapter obtains the access request from the virtual machine, it is further used to: put the access request into the first cache queue corresponding to the virtual channel of the virtual machine; the I/O adapter generates an access instruction according to the access request Previously, the method is further configured to: take an access request from a first cache queue corresponding to a virtual channel of the virtual machine.
- the I/O adapter acquires at least two access requests from the at least two virtual machines
- the I/O adapter is configured to generate an access instruction according to the access request, including: the I/O adapter is configured to use the priority of the at least two virtual machines corresponding to the at least two access requests, and the priority is high in the priority order.
- the access instruction corresponding to the machine generates an access instruction corresponding to the virtual machine with a lower priority.
- the I/O adapter acquires at least two access requests from the at least two virtual machines
- the I/O adapter is configured to generate an access instruction according to the access request, including: the I/O adapter is configured to generate an access instruction corresponding to the access request received by the first time according to the chronological order of obtaining the at least two access requests, and then generate the access instruction.
- the access instruction corresponding to the received access request if the I/O adapter acquires at least two access requests from the at least two virtual machines, The I/O adapter is configured to generate an access instruction according to the access request, including: the I/O adapter is configured to generate an access instruction corresponding to the access request received by the first time according to the chronological order of obtaining the at least two access requests, and then generate the access instruction.
- the access instruction corresponding to the received access request if the I/O adapter acquires at least two access requests from the at least two virtual machines, The I/O adapter is configured to generate an access instruction according to the access request, including: the I/O adapter is
- the feedback message contains the access command The result of the row and the identifier of the virtual channel of the virtual machine, and determining the virtual machine according to the identifier of the virtual channel, and transmitting the execution result of the access instruction to the virtual machine.
- the I/O adapter is configured to obtain an access request from the virtual machine, including: an I/O adapter Receiving a first doorbell notification from the virtual machine, and obtaining an access request from an I/O sharing ring shared by the virtual machine, where the access request is placed in the I/O sharing ring by the virtual machine, the first doorbell The notification is used to indicate that the I/O sharing ring has an access request arrival; the I/O adapter is configured to send the execution result of the access instruction to the virtual machine, including: the I/O adapter is configured to put the execution result of the access request into the The I/O shared by the virtual machine shares a ring, and sends a second doorbell notification to the virtual machine, where the second doorbell notification is used to indicate that the I/O sharing ring has an execution result.
- the access instruction is a small computer system interface SCSI command that can be processed by the host bus adapter driver layer;
- the O adapter is configured to send the access instruction to the storage device target, including: the I/O adapter is configured to send the access instruction to the storage device target through the host bus adapter driver layer.
- the storage device target device is configured to use the virtual address information carried in the access instruction and the identifier of the virtual channel Determining the physical address of the storage area to be accessed in the storage device, including: the storage device target is configured to query the preset second correspondence according to the virtual address information carried in the access instruction and the identifier of the virtual channel, and determine the The physical address of the storage area to be accessed is in the storage device, wherein the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of the storage area allocated for each virtual channel.
- the storage device target is configured with at least one cache queue, each cache queue and each virtual channel a one-to-one correspondence; after the storage device target obtains the access instruction, the method further includes: placing the access instruction into the second cache queue corresponding to the virtual channel of the virtual machine; and the storage device target determines that the storage area to be accessed is in the storage device
- the physical address is also used to: take an access instruction from a second cache queue corresponding to the virtual channel of the virtual machine.
- the storage device target device obtains at least the at least two virtual machines The two access instructions, the storage device target is used to determine the physical address of the storage area to be accessed in the storage device, and the storage device target is configured to use the priority of the at least two virtual machines corresponding to the at least two access instructions, The physical address of the storage area to be accessed of the virtual machine with the highest priority is determined in the priority order, and the physical address of the storage area of the virtual machine with the lower priority is determined in the storage device.
- the storage device target acquires at least two access commands from the at least two virtual machines
- the storage device target is used to determine the physical address of the storage area to be accessed in the storage device, and the storage device target is configured to first determine the first received access command according to the chronological order of obtaining the at least two access instructions. Corresponding physical address of the storage area to be accessed in the storage device, and then determining the physical address of the storage area to be accessed corresponding to the access instruction received in the storage device.
- the storage device target device is in the storage device according to the access instruction and the storage area to be accessed
- the physical address, after the operation of the storage area to be accessed, is further used to: return a feedback message, where the feedback message includes an execution result of the access instruction and an identifier of the virtual channel of the virtual machine.
- the ninth aspect is the system implementation corresponding to the method of the first aspect and the fourth aspect, the first aspect or any possible implementation of the first aspect, or any of the fourth aspect or the fourth aspect
- the feature description in the implementation manner is applicable to any possible implementation manner of the ninth aspect or the ninth aspect, and details are not described herein again.
- the storage device target can determine the physical address of the to-be-accessed area uniquely according to the virtual address information and the identifier of the virtual channel of the virtual machine, thereby realizing direct access of the virtual machine to the storage device, simplifying
- the access method of the storage device reduces the I/O access process and reduces the consumption of memory resources and computing resources by the software layer.
- FIG. 1 is a schematic structural diagram of a virtualization system
- FIG. 2 is a schematic structural diagram of a storage device access system according to an embodiment of the invention.
- FIG. 3 is a schematic diagram of a storage device access architecture
- FIG. 4 is a schematic diagram of a storage device access architecture according to an embodiment of the invention.
- FIG. 5 is a signaling diagram of a storage device access method according to an embodiment of the invention.
- FIG. 6 is an exemplary flowchart of a method for accessing a storage device according to an embodiment of the invention.
- FIG. 7 is an exemplary flowchart of a method for accessing a storage device according to an embodiment of the invention.
- FIG. 8 is a schematic diagram showing the logical structure of a storage device access device according to an embodiment of the invention.
- FIG. 9 is a schematic diagram showing the logical structure of a storage device access device according to an embodiment of the invention.
- FIG. 10 is a schematic structural diagram of hardware of a storage device access device according to an embodiment of the invention.
- FIG. 1 is a schematic structural diagram of a virtualization system 100. As shown in FIG. 1, the system 100 includes: physical hardware 106, a virtual machine monitor (VMM), and N virtual machines running on physical hardware. 102, wherein N is a positive integer greater than zero.
- VMM virtual machine monitor
- the Virtual Machine Monitor is a layer of software description between the virtual machine operating system and the physical hardware. It is responsible for processor scheduling and memory allocation between virtual machines. VMM not only abstracts the hardware of the virtual machine, but also controls the execution of each virtual machine.
- VMM can also be used to manage virtual machine creation, destruction, suspension, recovery, and migration, as well as CPU scheduling, memory allocation, and device access between virtual machines.
- the VMM provides an abstraction layer to the virtual machine that contains the Application Programming Interface (API) for management and virtual hardware.
- the VMM provides a virtual central processing unit (VCPU) and virtual memory to the virtual machine.
- the basic virtual hardware such as the Memory Management Unit (MMU) provides the corresponding hardware interface (secure hardware interface) to the virtual machine to ensure that device access is safe.
- MMU Memory Management Unit
- the secure hardware interface provides Direct Memory Access (DMA), Input & Output (I/O), driver, virtual Peripheral Component Interconnect (PCI) address configuration, virtual hardware interrupt, etc. Hardware virtual work.
- DMA Direct Memory Access
- I/O Input & Output
- PCI Peripheral Component Interconnect
- the system 100 can support paravirtualization and full virtualization.
- the paravirtualized (PV) virtual machine running on the VMM runs the operating system of the modified kernel, or the upper operating system installs the paravirtualized driver.
- the system of the program An operating system running a virtualized virtual machine on the VMM runs without modifying the kernel and without installing a paravirtualized driver.
- FIG. 2 is a schematic structural diagram of a storage device access system 200(a) and 200(b) according to an embodiment of the present invention. As shown in FIG. 2, the storage device access system of the embodiment of the present invention includes two structures.
- the system 200(a) includes a storage device 202, and M computing devices 204, wherein each computing device 204 runs the virtualization system 100 shown in FIG. 1, and M is greater than zero.
- a positive integer A positive integer.
- each computing device 204 runs on at least one virtual machine.
- the storage device 202 is shared by virtual machines on the M computing devices 204.
- the computing device 204 and the storage device 202 are separated from each other.
- the computing device 204 and the storage device are separated from each other.
- the 202 can be connected to each other by fiber optic or serial cable or other connection means. The embodiment of the present invention does not limit the connection manner between the storage device 202 and the computing device 204.
- FIG. 2(a) illustrates an application scenario of a computing device 204 and a storage device 202 in a storage area network (SAN).
- SAN storage area network
- the storage device 202 is composed of a storage array 202 of various types including, but not limited to, RAM, ROM, EEPROM, flash memory, other memory technologies, CD-ROM, digital versatile disk, other optical storage, magnetic card. Tape, tape, disk storage, other magnetic storage And any other medium that can be used to store the required information and be accessible by computing device 204.
- the embodiment of the present invention does not limit the implementation manner of the storage device 202.
- Computing device 204 in its basic configuration, typically includes at least one processor and memory.
- the memory can be volatile, such as random access memory (RAM), non-volatile, such as read only memory (ROM), flash memory, or some combination of the two.
- RAM random access memory
- ROM read only memory
- flash memory or some combination of the two.
- This basic configuration can have additional features and functionality.
- it may include storage (removable and non-removable) of peripherals including, but not limited to, magnetic disks and magnetic tapes, as well as optical disks and optical tapes.
- Computer storage media includes both volatile and nonvolatile, removable and non-removable, implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. medium.
- Computing device 204 may also include a communication channel that allows it to communicate with other devices.
- Media for communication channels include, but are not limited to, optical media, wired media such as wired networks and linear connections, wireless media such as voice, RF, infrared, and other wireless media.
- computing device 204 may further include other functional modules, and details are not described herein again.
- the storage device access system 200(b) includes a storage device 202 and M storage controllers 206, and the storage controller 206 runs a map.
- M is a positive integer greater than zero.
- each storage controller 206 runs at least one virtual machine.
- the storage device 202 is shared by virtual machines on the M storage controllers 206.
- the storage controller 206 and the storage device 202 together form a storage integrated machine.
- the storage controller 206 can hot swap the storage device 202.
- FIG. 2(b) illustrates an application scenario of the storage device 202 after the computing device is omitted in the SAN.
- the virtual machine directly runs on the memory controller 206 of the storage device 202, and the data generated by the virtual machine is subjected to storage control. After the specific processing of the device 206, the valid data is stored in the storage array of the storage device 202.
- Storage controller 206 in its basic configuration, typically includes at least one processor and memory.
- the memory can be volatile, such as random access memory (RAM), non-volatile, such as read only memory (ROM), flash Save, or some combination of the two.
- RAM random access memory
- ROM read only memory
- flash Save or some combination of the two.
- Storage controller 206 may also include communication channels that allow it to communicate with other devices.
- Media for communication channels include, but are not limited to, optical media, wired media such as wired networks and linear connections, wireless media such as voice, RF, infrared, and other wireless media.
- the physical hardware 106 in FIG. 1 may be a specific computer, or may be a storage controller of the storage device 202, or any combination of the two, and the implementation of the system in FIG. 2 may be various, and may be the computing device 204 and The storage devices 202 are separated from each other and connected to each other by any means. Alternatively, the storage controller 206 and the storage device 202 may be integrated into one storage device.
- the specific implementation manner of the physical hardware 106 and the system 200 is not limited in the embodiment of the present invention. For convenience of description, in the following description, computing device 204, storage controller 206, or any combination of the two, is collectively referred to as a physical machine.
- FIG. 3 is a schematic diagram of a storage device access architecture. As shown in Figure 3, a kernel-based virtual machine (KVM) is used as an example. The entire storage device access process passes through the virtual machine 102 and the virtual machine. A host target (Vhost target) 302, a block level 304, a small computer system interface level (SCSI level) 306, and a storage device 202.
- KVM kernel-based virtual machine
- a host bus adapter driver of the computing device 204 and the storage device 202 is also required.
- the HBA driver is the operating system SCSI protocol transport layer (also called HBA driver layer) on the physical machine. It connects the internal bus and storage device of the physical machine. As the carrier layer of the SCSI protocol, it completes the packaging between the SCSI protocol and the specific protocol packets. Parsing, in conjunction with the SCSI middle layer completion error handling, is responsible for transmitting SCSI commands issued by the SCSI middle layer.
- the storage array of the storage device 202 can be divided into a plurality of logical unit number (LUN) devices, and each LUN device has one LUN.
- the LUN device of the storage device 202 is allocated to use by multiple virtual machines.
- the multiple virtual machines may be running on the same physical device or may be run on different physical devices. .
- the LUN device configuration process of the physical machine and the storage device 202 Before the entire system is running, there is first a LUN device configuration process of the physical machine and the storage device 202, so that the LUN device of the storage device 202 presents a physical drive letter at the block device layer of the physical machine. Secondly, the user needs to configure the physical drive letter on the block device to the device through the configuration tool. Multiple virtual machines running on a physical machine such that a virtual drive letter is presented inside the virtual machine. For the convenience of description, in the embodiment of the present invention, the drive letter inside the virtual machine is called a virtual drive letter, and the drive letter represented by the physical machine block device layer is called a physical drive letter.
- the virtual machine 102 When the application layer inside the virtual machine 102 has an access requirement for the storage device 202, the virtual machine 102 generates a BLOCK Input and Output Request (BIO), and then you send the BIO to the virtual device's block device ( In the virtual machine, the virtual machine's block device generates a request according to the BIO, and then merges, sorts, caches, and schedules based on Requst, and then sends a Request to the SCSI middle layer (in the virtual machine) of the virtual machine through a scheduling algorithm, and virtualizes The SCSI middle layer generates a SCSI command to send to the virtual disk drive virtio-scsi.
- BIO BLOCK Input and Output Request
- the virtio-scsi generates a virtio_scsi_cmd request based on the SCSI command.
- the virtio_scsi_cmd request contains the SCSI Command Descriptor (CBD), data space description information, and data transfer direction. Information, as well as other IO attributes, etc., virtio_scsi_cmd carries the virtual drive letter information provided by the block level 304 to the virtual machine 102.
- the virtual disk virtual disk driver virtio-scsi sends the virtio_scsi_cmd request to the virtual machine's I/O shared ring vring, and the Vhost target 302 is notified by the doorbell mechanism that a new I/O request arrives.
- the Vhost target 302 After the Vhost target 302 knows the doorbell signal, it extracts the virtio_scsi_cmd from the vring, and parses and processes the request. If it is not a read/write command, it directly simulates the processing in the vhost target 302; if it is a read/write command, it generates a corresponding BIO and sends it to The specified block device layer 304.
- the block device layer 304 generates a request Request according to the BIO, then merges, sorts, caches, and schedules based on Requst, and then sends the Request to the SCSI middle layer 306 of the virtual machine through a scheduling algorithm.
- the SCSI mid-layer 306 maps the virtual drive letter to the physical drive letter and repackages the Request into a SCSI command and sends it to the storage device 202.
- the SCSI command carries the physical drive letter information.
- the SCSI mid-layer sends SCSI commands to storage device 202 via HBA drivers of computing device 204 and storage device 202.
- the mapping of the physical drive letter to the LUN device of the storage array is implemented by the storage device 202.
- FIG. 3 implements the access of the virtual machine 102 to the storage device 202, but the entire access process passes through the inside of the virtual machine 102, the vhost target 302, the block device layer 304, and the SCSI middle layer 306.
- the multi-layer conversion can implement the access operation of the virtual machine 102 to the storage device 202.
- the access request has been cached, merged, sorted, scheduled, and SCSI commanded twice by the block device, once in the virtual machine and once in the physical machine.
- FIG. 4 is a schematic diagram of a storage device access architecture 400 according to an embodiment of the present invention.
- the architecture 400 includes a virtual machine 102, an I/O adapter 402, and a storage device 202.
- the storage device 202 can be used by multiple virtual machines 102 running on multiple physical machines. Before the entire system is running, there is a configuration process of the virtual machine 102 running on the physical machine and the LUN device of the storage device 202, so that the storage device is enabled.
- the LUN device of 202 presents a virtual LUN device in the virtual machine 102 running on the physical machine.
- the LUN device of the storage device 202 can be allocated to multiple virtual machines for use.
- the multiple virtual machines can be run on one physical machine or multiple physical devices, which is not limited by the embodiment of the present invention.
- the LUN device inside the virtual machine is called a virtual LUN, and the virtual LUN is used to identify the virtual LUN device.
- the LUN device of the storage array of the storage device 202 is called a physical LUN device, and the physical LUN is used for physical. The LUN is identified.
- the physical LUN device can be configured as a virtual LUN device in the virtual machine 102 by the I/O adapter 402, or the virtual LUN device of the virtual LUN device to the virtual machine 102 can be configured by the VMM;
- the configuration of the physical LUN device to the virtual LUN device is performed during the subsequent dynamic resource adjustment.
- the embodiment of the present invention does not limit the configuration body and the configuration time.
- the addressing modes of different virtual machines are the same, and the virtual lun device addressing within different virtual machines can be repeated.
- the configuration of the physical lun device to the virtual LUN device can be only the conversion of the physical lun device number to the virtual lun device number.
- the attribute information of the physical lun device can be transparently transmitted to the virtual machine. For example, whether the thin provisioning is supported, whether the cluster persistence is supported. Reserved, whether to support unloading data transmission, and whether to support attribute information such as path switching.
- the configuration process of the physical LUN device to the virtual LUN device may be performed through negotiation between the I/O adapter or the VMM and the storage device target, which is not limited by the embodiment of the present invention.
- the storage device access flow signaling diagram in the architecture 400 is as shown in FIG. 5, and the access process includes:
- the virtual machine 102 generates an access request to the storage device 202.
- the virtual machine 102 When the virtual machine 102 receives the upper-layer application requirement and accesses the storage array in the storage device 202, the virtual machine 102 first generates an access request, where the access request carries the virtual address information of the storage area to be accessed.
- the access request may carry the virtual LUN of the virtual LUN device to be accessed by the virtual machine 102 and the starting address and address length of the virtual LUN device in the storage area to be accessed.
- the virtual machine 102 when an application layer inside the virtual machine 102 has an access requirement for the storage device 202, the virtual machine 102 generates a corresponding block read/write request BIO, and The BIO is sent to the block device (within the virtual machine) of the virtual machine 102.
- the block device of the virtual machine 102 generates a request according to the BIO, and then merges, sorts, caches, and schedules based on the Requst, and then sends the Request to the scheduling algorithm.
- the SCSI middle layer of the virtual machine 102 (inside the virtual machine), the SCSI middle layer of the virtual machine 102 generates a SCSI command according to the Request, and sends the SCSI command to the virtual disk drive virtio-scsi, and the virtio-scsi generates an access request virtio_scsi_cmd according to the SCSI command.
- the access request virtio_scsi_cmd carries a virtual LUN for identifying the virtual LUN device and a starting address and an address length of the storage area to be accessed in the virtual LUN device.
- the virtual machine 102 sends an access request to the I/O adapter 402.
- the virtual machine 102 places an access request into an I/O sharing ring shared with the I/O adapter 402, and sends a first doorbell notification to the I/O adapter, the first doorbell notification being used to indicate the I/O sharing ring.
- the I/O adapter 402 receives the first doorbell notification from the virtual machine, and acquires the access request from an I/O shared ring shared with the virtual machine.
- the KVM virtualization is used as an example.
- the virtual disk driver virtio-scsi of the virtual machine 102 puts the access request virtio_scsi_cmd into the I/O sharing ring vring of the virtual machine 102 and the I/O adapter through the doorbell mechanism.
- the I/O adapter 402 is notified that a new access request has arrived.
- the I/O adapter 402 fetches the access request virtio_scsi_cmd placed in the virtual machine 102 into the corresponding I/O sharing ring.
- the I/O adapter 402 generates an access instruction according to the access request.
- the I/O adapter 402 generates an access instruction according to the access request virtio_scsi_cmd, and the access instruction carries the virtual address information of the storage area to be accessed and the identifier of the virtual channel corresponding to the virtual machine 102.
- the access command may carry the virtual LUN of the virtual LUN device to be accessed by the virtual machine 102, the identifier of the virtual channel corresponding to the virtual machine 102, and the storage area to be accessed in the virtual Start address and address length of the LUN device.
- the virtual channel is used to connect the virtual machine 102 and the storage device 202.
- the virtual machine 102 is in one-to-one correspondence with the virtual channel. More specifically, the virtual channel is used to connect the storage device target of the virtual machine 102 and the storage device 202, and the storage device target.
- the device is used to manage the access operation to the storage device 202, because the storage device 202 can be shared by multiple virtual machines, even shared by multiple virtual machines running on multiple physical machines, and the storage device 202 can be identified for the storage device target. Which virtual machine is accessed by the virtual machine, and the virtual machine and virtual channel need to be established.
- the virtual channel between the virtual machine and the storage array target is unique, that is, the virtual machine and the virtual channel are in one-to-one correspondence, and the virtual channel is The identity identifies the virtual machine uniquely.
- the identifiers of the virtual channel and the virtual channel are used to represent the unique connection relationship between the virtual machine 102 and the storage device 202.
- the virtual channel refers to the storage medium based on the physical physical medium during the data transmission process.
- Each virtual machine is connected to the storage device through a virtual channel identified by the identifier of the unique virtual channel.
- the virtual channel may have multiple implementation forms, for example, may be implemented by time-multiplexing physical connection channels.
- the virtual machine identifiers cannot uniquely represent the virtual machines, and the virtual channels correspond to the virtual machines one by one.
- the essential purpose of the virtual channel identifiers is unique. Characterize the virtual machine connected to the virtual channel.
- the specific implementation of the virtual machine identifier is various, and is not limited by the embodiment of the present invention. Any identifier that can uniquely identify the identity of the virtual machine can be used to achieve the purpose, and is transmitted between the virtual machine and the storage device.
- the only channel that identifies the virtual channel of the virtual machine identity is the unique virtual channel that connects the virtual machine to the storage device.
- the virtual channel can be determined by the I/O adapter 402 and the storage device 202 through negotiation, or can be configured in advance. For example, when creating a virtual machine, virtual channel configuration is performed by a virtual machine manager (VMM) or a privileged domain that creates a virtual machine.
- VMM virtual machine manager
- the embodiment of the present invention does not limit the configuration manner of the virtual channel and the identifier of the virtual channel.
- a virtual channel can have various attributes such as carrying capacity, address space of a corresponding storage array, and troubleshooting methods.
- a one-to-one correspondence between virtual channels and virtual machines is maintained inside the I/O adapter 402, for example, A one-to-one correspondence between a virtual machine and a virtual channel can be recorded in the form of a data table.
- the virtual machine identifier may be used to indicate the virtual machine
- the virtual channel identifier is used to indicate the virtual channel.
- the identifier of the virtual channel corresponding to the virtual machine is determined by querying the preset correspondence, where the correspondence includes the one-to-one correspondence between the identifier of the virtual channel and the virtual machine.
- the storage device target can identify different virtual machines, because the virtual channel represents the unique connection relationship between the virtual machine and the storage device, so even if the virtual machine identifier running on different physical machines has duplicates, the storage The device can also distinguish the virtual machines on different physical machines, so that the physical address of the storage area to be accessed by the virtual machine is uniquely determined according to the virtual address information and the identifier of the virtual channel of the virtual machine.
- the one-to-one correspondence between the virtual channel and the virtual machine can be dynamically adjusted.
- the corresponding relationship between the newly created virtual machine and its corresponding virtual channel can be newly added in the corresponding relationship.
- a virtual machine is deleted, The corresponding relationship between the virtual machine and the virtual channel is also deleted in the corresponding relationship.
- the I/O adapter converts the virtio_scsi_cmd instruction into the standard access instruction scsi_cmnd, and records the identifier of the virtual channel corresponding to the virtual machine 102 by using the scsi_cmnd record high byte of the LUN address field.
- the LUN address format generally does not exceed 6 bytes, and the LUN address field defined in the SCSI model actually has 8 bytes, the high bit of the LUN address field generally has two bytes as an alternate field, so the LUN address field can be used.
- the two alternate high-order bytes carry the identity of the virtual channel to distinguish different virtual channels.
- the access instruction may also use other fields or extension fields to carry the identifier of the virtual channel, which is not limited by the embodiment of the present invention. For example, if the number of virtual channels is less than 256, only one high-order byte of the LUN address field is used. A record of the identification of the virtual channel can be implemented.
- the partial conversion pseudo code from the access request to the access instruction is as follows, using the upper two bits of the LUN address field to record the virtual channel identifier Virtual_Channel_no, specifically implemented as Virtual_Channel_no left shift 48 bits (ie 6 bytes), and then with The LUN performs a bitwise OR operation because the upper two bytes of the LUN address field default to 0, and the two perform a bitwise OR operation.
- the high two-byte record of the LUN address field records the virtual channel identifier Virtual_Channel_no, and two-byte bytes can be used to distinguish 65536 different virtual channels.
- the I/O adapter 402 is configured with at least one cache queue, and each cache queue is associated with one virtual channel, and each cache queue has one-to-one correspondence with each virtual channel; After acquiring the access request from the virtual machine, the I/O adapter 402 further places the access request into a first cache queue corresponding to the virtual channel of the virtual machine; the I/O adapter 402 is configured according to the The access request is fetched from the first cache queue corresponding to the virtual channel of the virtual machine before the access request generates the access instruction.
- the I/O adapter 402 may generate a priority according to the priority of the at least two virtual machines corresponding to the at least two access requests, and the access order corresponding to the virtual machine with the highest priority according to the priority order.
- a low virtual machine corresponds to an access instruction.
- the I/O adapter 402 may further determine the chronological order of the at least two access requests.
- the access command corresponding to the received access request is generated, and the access command corresponding to the received access request is generated.
- I/O adapters 402 respectively process the received multiple access requests according to the virtual machine priority or the order of the acquisition time, which is merely an example.
- the embodiment of the present invention does not refer to the I/O adapter 402.
- the processing order for processing the received access request is limited.
- the I/O adapter sends an access instruction to the storage device 202.
- the access instruction is a small computer system interface SCSI command that can be processed by the host bus adapter driver layer, and the I/O adapter 402 passes through the computing device 204 and the storage.
- the HBA driver of device 202 sends an access command to storage device 202.
- the I/O adapter 402 sends an access instruction to a storage array target for managing access operations to the storage device 202.
- the storage array target After the storage array target acquires the access instruction from the I/O adapter 402, determining, according to the virtual address information carried in the access command and the identifier of the virtual channel, the storage area to be accessed is in the storage device. Physical address. Specifically, the storage device target device queries the preset second correspondence according to the virtual address of the storage area to be accessed by the virtual machine 102 and the identifier of the virtual channel of the virtual machine 102, and determines that the storage area to be accessed is in the storage. a physical address in the device, where the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of a storage area allocated for each virtual channel.
- Table 1 exemplarily shows the mapping relationship of the virtual address of the virtual machine to the physical address of the storage array.
- the virtual addresses inside each virtual channel are unique.
- the addresses inside different virtual channels can be duplicated.
- the storage device target can uniquely determine the storage area to be accessed according to the virtual address and the identifier of the virtual channel. Physical address.
- the storage device target can still uniquely determine the physical address according to the identifier and virtual address of the virtual channel.
- the storage device target can have a virtual "simulated channel identifier 0 + virtual address VA1". Map to physical address PA1; map "virtual channel ID 1 + virtual address VA1" to physical address PA4.
- Table 1 address mapping table
- the virtual address is the indication information of the virtual LUN and the storage area to be accessed and the virtual LUN device.
- the physical address is the physical LUN and the indication information of the storage area to be accessed on the physical LUN device.
- the storage device target can be virtualized.
- the virtual LUN inside the machine 102 is mapped to an actual physical LUN.
- the storage device target is configured with at least one cache queue, and each cache queue has a one-to-one correspondence with each virtual channel; the storage device target obtains the access After the instruction, the access instruction is further placed in a second cache queue corresponding to the virtual channel of the virtual machine; the storage device target determines that the storage area to be accessed is before the physical address in the storage device, The access instruction is fetched from a second cache queue corresponding to the virtual channel of the virtual machine.
- the storage device target acquires at least two access instructions from at least two virtual machines
- the storage device target may be according to at least two corresponding to the at least two access instructions
- the priority of the virtual machine the physical address of the storage area to be accessed of the virtual machine with the highest priority is determined in the priority order, and the storage area of the virtual machine with the lower priority is determined.
- the physical address in the storage device is determined.
- the storage device target may further determine to receive the first time according to the chronological order in which the at least two access commands are obtained. And the physical address of the storage area to be accessed in the storage device corresponding to the access instruction, and then determining the physical address of the storage area to be accessed corresponding to the access instruction received in the storage device.
- the foregoing storage device target device processes the received multiple access commands according to the priority or the order of the acquisition time, which is merely an example.
- the embodiment of the present invention does not process the received by the storage device target device.
- the processing order of the access instructions is limited.
- the storage device target device performs an access operation on the storage area to be accessed according to the physical address and the access instruction of the storage area to be accessed by the virtual machine.
- the storage device target if the access instruction is a data write instruction, the storage device target writes data to be written into a storage area indicated by a physical address; if the access instruction is a data read instruction, The storage device target reads the data to be read from the storage area indicated by the physical address.
- the storage device target returns the execution result of the access instruction to the I/O adapter 402.
- the storage device target sends a feedback message to the I/O adapter 402, where the feedback message includes an execution result of the access instruction and an identifier of the virtual channel of the virtual machine.
- the I/O adapter determines the virtual machine based on the identity of the virtual channel.
- the I/O searches for the virtual machine corresponding to the identifier of the virtual channel according to the identifier of the virtual channel according to the preset first correspondence.
- the I/O adapter 402 returns the execution result of the access instruction to the virtual machine 102.
- the I/O adapter 402 puts the execution result of the access request into the I/O sharing ring shared by the virtual machine 102, and sends a second doorbell notification to the virtual machine 102, where the The two-door notification is used to indicate that the I/O sharing ring has an execution result arrival.
- an I/O adapter is configured between a virtual machine and a storage device, and a virtual channel corresponding to the virtual machine is configured between the I/O adapter and the storage device to access the virtual channel.
- the instruction carries the identifier of the corresponding virtual channel, so that the storage device target can
- the physical address of the area to be accessed is uniquely determined according to the virtual address information and the identifier of the virtual channel of the virtual machine, thereby realizing direct access of the virtual machine to the storage device, simplifying the access method of the storage device, and reducing the I/O access process. Reduces the consumption of memory resources and computing resources by the software layer.
- FIG. 6 is an exemplary flowchart of a storage device access method 600.
- the computer system runs at least one virtual machine, where the computer system is configured with an I/O adapter, and the I/O adapter is used for management operation.
- the method 600 for accessing a storage device by a virtual machine on a computer system includes:
- the I/O adapter acquires an access request from the virtual machine, where the access request carries virtual address information of the storage area to be accessed.
- the virtual machine when the virtual machine receives the upper-layer application requirement and accesses the storage array in the storage device, the virtual machine first generates an access request, where the access request carries the storage to be accessed.
- the virtual address information of the zone when the virtual machine receives the upper-layer application requirement and accesses the storage array in the storage device, the virtual machine first generates an access request, where the access request carries the storage to be accessed.
- the virtual address information of the zone when the virtual machine receives the upper-layer application requirement and accesses the storage array in the storage device, the virtual machine first generates an access request, where the access request carries the storage to be accessed.
- the virtual address information of the zone when the virtual machine receives the upper-layer application requirement and accesses the storage array in the storage device, the virtual machine first generates an access request, where the access request carries the storage to be accessed.
- the virtual address information of the zone when the virtual machine receives the upper-layer application requirement and accesses the storage array in the storage device, the virtual machine
- the virtual machine when the application layer inside the virtual machine has access requirements for the storage device, the virtual machine generates a corresponding block read/write request BIO, and sends the BIO to the virtual device block device (in the virtual machine).
- the virtual machine's block device generates a request according to the BIO, then merges, sorts, caches, and schedules based on Requst, and then sends the Request to the SCSI middle layer (in the virtual machine) of the virtual machine through the scheduling algorithm, and the SCSI middle layer of the virtual machine.
- a SCSI command is generated according to the Request, and the SCSI command is sent to the virtual disk drive virtio-scsi, and the virtio-scsi generates an access request virtio_scsi_cmd according to the SCSI command.
- the I/O adapter acquires an access request from a virtual machine, including: the I/O adapter receives a first doorbell notification from the virtual machine, and obtains a Obtaining the access request in an I/O sharing ring shared by the virtual machine, where the access request is placed in the I/O sharing ring by the virtual machine, where the first doorbell notification is used to indicate the I/O The shared ring has an access request to arrive.
- the virtual disk virtual disk driver virtio-scsi puts the access request virtio_scsi_cmd into the I/O shared ring vring of the virtual machine and the I/O adapter, and notifies the I/O adapter through the doorbell mechanism. A new access request arrives. After receiving the doorbell notification, the I/O adapter will take the access request virtio_scsi_cmd placed in the virtual machine in the corresponding I/O sharing ring.
- the I/O adapter generates an access instruction according to the access request, where the access instruction is Carrying the virtual address information and the identifier of the virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine and the storage device target, and the virtual machine has a one-to-one correspondence with the virtual channel, and the storage device target is used for management An access operation to the storage device.
- the virtual channel is used to connect the virtual machine to the storage device.
- the virtual channel is used to connect the storage device target of the virtual machine and the storage device, because the storage device can be shared by multiple virtual machines or even run by multiple physical machines.
- the virtual machine IDs running on different physical machines can be duplicated.
- the virtual channel between the virtual machine and the storage array target is unique, that is, the virtual machine has a one-to-one correspondence with the virtual channel, and the identifier of the virtual channel can uniquely identify the virtual machine.
- the method further includes: the I/O adapter querying the preset first correspondence according to the identifier of the virtual machine, and determining the identifier of the virtual channel, where
- the first correspondence includes a correspondence between an identifier of each virtual machine and an identifier of each virtual channel.
- the virtual channel can be negotiated by the I/O adapter and the storage device, or it can be configured in advance.
- the virtual machine is configured by a virtual machine manager (VMM) or a privileged domain that creates a virtual machine.
- VMM virtual machine manager
- the embodiment of the present invention does not limit the configuration manner of the virtual channel and the identifier of the virtual channel.
- the I/O adapter generates an access instruction according to the access request virtio_scsi_cmd.
- the access instruction carries the virtual address information of the storage area to be accessed and the identifier of the virtual channel corresponding to the virtual machine.
- the LUN address field defined in the SCSI model actually has 8 bytes, and the high byte of the LUN address field generally has two bytes as an alternate field, so The two alternate high-order bytes of the LUN address field can be used to carry the identity of the virtual channel to distinguish different virtual channels.
- the access instruction may also use other fields or extension fields to carry the identifier of the virtual channel, which is not limited by the embodiment of the present invention. For example, if the number of virtual channels is less than 256, only one high-order byte of the LUN address field is used. A record of the identification of the virtual channel can be implemented.
- the I/O adapter converts the virtio_scsi_cmd instruction into a standard access instruction scsi_cmnd, and uses scsi_cmnd to record the height of the LUN address field.
- the two-byte record records the ID of the virtual channel corresponding to the virtual machine.
- the I/O adapter is configured with at least one cache queue, and each cache queue has a one-to-one correspondence with each virtual channel; the I/O adapter acquires the virtual machine from the virtual machine.
- the method further includes: the I/O adapter placing the access request into a first cache queue corresponding to a virtual channel of the virtual machine; and the I/O adapter generating a location according to the access request
- the method further includes: the I/O adapter extracting the access request from a first cache queue corresponding to the virtual channel of the virtual machine.
- the I/O adapter acquires at least two access requests from at least two virtual machines
- the I/O adapter generates an access instruction according to the access request, including: the I/O adapter is configured according to The priority of the at least two virtual machines corresponding to the at least two access requests is an access command corresponding to the virtual machine having the higher priority according to the priority order, and then the access command corresponding to the virtual machine having the lower priority is generated.
- the I/O adapter acquires at least two access requests from at least two virtual machines
- the I/O adapter generates an access instruction according to the access request, including: the I/O adapter is configured according to Acquiring the chronological order of the at least two access requests, the access instruction corresponding to the access request received by the sir, and the access instruction corresponding to the received access request after the generation.
- I/O adapters process the received multiple access requests according to the priority of the virtual machine or the order of the acquisition time, which is merely an example.
- the embodiment of the present invention does not process the receiving of the I/O adapter.
- the processing order of the access request is limited.
- S606 The I/O adapter sends the access instruction to the storage device target.
- the method further includes: the I/O adapter acquiring a feedback message from the storage device target, the feedback message including the access An execution result of the instruction and an identifier of the virtual channel of the virtual machine; the I/O adapter determines the virtual machine according to the identifier of the virtual channel, and sends an execution result of the access instruction to the virtual machine.
- the I/O adapter sends the execution result of the access instruction to the virtual machine, where the I/O adapter puts an execution result of the access request into an I shared with the virtual machine. /O shares a ring, and sends a second doorbell notification to the virtual machine, where the second doorbell notification is used to indicate that the I/O sharing ring has an execution result arrival.
- the access instruction is a small computer system interface SCSI command that can be processed by the host bus adapter driver layer; the I/O adapter uses the access instruction Sending to the storage device target includes: the I/O adapter transmitting the access instruction to the storage device target through the host bus adapter driver layer.
- FIG. 6 is the method of the I/O adapter side of the embodiment of FIG. 5, and the feature description of the embodiment of FIG. 5 is applicable to the embodiment of FIG. 6, and details are not described herein again.
- an I/O adapter is configured between a virtual machine and a storage device, and a virtual channel corresponding to the virtual machine is configured between the I/O adapter and the storage device.
- the direct access of the virtual machine to the storage device simplifies the access method of the storage device, reduces the I/O access process, and reduces the consumption of memory resources and computing resources by the software layer.
- FIG. 7 is an exemplary flowchart of a storage device access method 700 according to an embodiment of the present invention.
- the storage device may be shared by multiple virtual machines, and the multiple virtual machines may be virtual machines running on the same physical machine.
- the virtual machine may be the same on the different physical machines.
- the virtual machine identifiers on the different physical machines may be the same.
- the memory target is used to manage access operations on the storage device.
- the method 700 includes:
- the storage device target acquires an access instruction, where the access instruction carries virtual address information and an identifier of a virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine to the storage device target, the virtual machine and the virtual channel.
- the virtual address information is used to indicate a virtual address of the storage area to be accessed in the virtual machine.
- the virtual channel is used to connect the virtual machine to the storage device.
- the virtual channel is used to connect the storage device target of the virtual machine and the storage device, because the storage device can be shared by multiple virtual machines or even run by multiple physical machines.
- the virtual machine IDs running on different physical machines can be duplicated.
- the virtual channel between the virtual machine and the storage array target is unique, that is, the virtual machine has a one-to-one correspondence with the virtual channel, and the identifier of the virtual channel can uniquely identify the virtual machine.
- the virtual channel can be determined by negotiation between the physical machine side virtual machine controller or the virtual machine or other modules and the storage device, or can be configured in advance. For example, when creating a virtual machine, the Virtual Machine Manager (VMM) or the privileged domain that created the virtual machine is used to perform virtual The configuration of the pseudo channel.
- VMM Virtual Machine Manager
- the embodiment of the present invention does not limit the configuration manner of the virtual channel and the identifier of the virtual channel.
- the LUN address field defined in the SCSI model actually has 8 bytes, and the high byte of the LUN address field generally has two bytes as an alternate field, so The two alternate high-order bytes of the LUN address field can be used to carry the identity of the virtual channel to distinguish different virtual channels.
- the access instruction may also use other fields or extension fields to carry the identifier of the virtual channel, which is not limited by the embodiment of the present invention. For example, if the number of virtual channels is less than 256, only one high-order byte of the LUN address field is used. A record of the identification of the virtual channel can be implemented.
- the storage device target determines a physical address of the storage area to be accessed in the storage device according to the virtual address information carried in the access instruction and the identifier of the virtual channel.
- the storage device target determines, according to the virtual address information carried in the access instruction and the identifier of the virtual channel, that the storage area to be accessed is in the
- the physical address of the storage device includes: the storage device target device queries the preset second correspondence according to the virtual address information carried in the access command and the identifier of the virtual channel, and determines the storage to be accessed. a physical address of the area in the storage device, wherein the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of a storage area allocated for each virtual channel.
- the virtual address inside each virtual channel is unique.
- the addresses inside the different virtual channels can be repeated.
- the storage device target can uniquely determine the physical address of the storage area to be accessed according to the virtual address and the identifier of the virtual channel. Because the physical address of the storage area to be accessed is determined according to the identifier of the virtual channel and the virtual address, even if the virtual machine identifier of the virtual machine running on different physical machines is the same, because the virtual channel corresponding to the virtual machine is unique, The storage device target can still uniquely determine the physical address based on the identity and virtual address of the virtual channel.
- the storage device target can map the virtual LUN inside the virtual machine to the actual physical LUN.
- the storage device target is configured with at least one cache queue, and each cache queue has a one-to-one correspondence with each virtual channel; the storage After the device target obtains the access instruction, the method further includes: the storage device target inserting the access instruction into a second cache queue corresponding to the virtual channel of the virtual machine; and the storage device target determines the to-be-waited Before the accessed storage area is in the storage device, the storage device further includes: the storage device target extracting the access instruction from a second cache queue corresponding to the virtual channel of the virtual machine.
- the storage device target acquires at least two access instructions from the at least two virtual machines
- the storage device target determines a physical address of the storage area to be accessed in the storage device
- the storage device target device determines, according to the priority of the at least two virtual machines corresponding to the at least two access instructions, the storage area to be accessed of the virtual machine with a high priority in the priority order.
- the physical address in the medium and then determine the physical address of the storage area to be accessed of the virtual machine with low priority in the storage device.
- the storage device target determines a physical address of the storage area to be accessed in the storage device, The determining, by the storage device target, determining the physical address of the storage area to be accessed corresponding to the access instruction received in the storage device according to the chronological order of obtaining the at least two access instructions, and then determining The physical address of the storage area to be accessed corresponding to the access instruction received in the storage device.
- the foregoing storage device target device processes the received multiple access commands according to the priority or the order of the acquisition time, which is merely an example.
- the embodiment of the present invention does not process the received by the storage device target device.
- the processing order of the access instructions is limited.
- the storage device target device operates the storage area to be accessed according to the access instruction and a physical address of the storage area to be accessed in the storage device.
- the storage device target if the access instruction is a data write instruction, the storage device target writes data to be written into a storage area indicated by a physical address; if the access instruction is a data read instruction, The storage device target reads the data to be read from the storage area indicated by the physical address.
- the storage device target after the operation, the storage device target, the operating location of the to-be-accessed storage area in the storage device, the operation, further includes: The storage device target returns a feedback message, the feedback message including an execution result of the access instruction and an identification of a virtual channel of the virtual machine.
- FIG. 7 is the method of the storage device target side of the embodiment of FIG. 5 , and the feature description of the embodiment of FIG. 5 is applicable to the embodiment of FIG. 7 , and details are not described herein again.
- the virtual channel between the virtual machine and the storage device is established, and the identifier of the corresponding virtual channel is carried in the access instruction, so that the storage device target can be based on the virtual address information and the virtual machine.
- the identifier of the virtual channel uniquely determines the physical address of the area to be accessed, thereby realizing direct access of the virtual machine to the storage device, simplifying the access method of the storage device, reducing the I/O access process, and reducing the software layer to the memory resource and Calculate the consumption of resources.
- FIG. 8 is a schematic diagram showing the logical structure of a storage device access device 800 according to an embodiment of the present invention.
- the device 800 is configured to manage access operations of a virtual machine running on a computer system to a storage device. As shown in FIG. Unit 802, generating unit 804, and transmitting unit 806, where
- An obtaining unit 802 configured to acquire an access request from a virtual machine, where the access request carries virtual address information of a storage area to be accessed;
- the generating unit 804 is configured to generate an access instruction according to the access request, where the access instruction carries the virtual address information and an identifier of a virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine and the storage device a target device, the virtual machine is in one-to-one correspondence with the virtual channel, and the storage device target is used to manage access operations on the storage device
- the sending unit 806 is configured to send the access instruction to the storage device target.
- the generating unit 804 is further configured to: determine, according to the identifier of the virtual machine, a preset first correspondence, and determine an identifier of the virtual channel, where the The first correspondence includes a correspondence between an identifier of each virtual machine and an identifier of each virtual channel.
- the device 800 is configured with at least one cache queue, and each cache queue has a one-to-one correspondence with each virtual channel.
- the acquiring unit 802 is further configured to: The access request is placed in a first cache queue corresponding to the virtual channel of the virtual machine; and before the generating the command is generated by the generating unit 804, the generating unit 804 is further configured to: correspond to the virtual channel of the virtual machine The access request is retrieved from the first cache queue.
- the generating unit 804 is configured to generate an access instruction according to the access request, including: The generating unit 804 is configured to generate, according to the priority of the at least two virtual machines corresponding to the at least two access requests, an access instruction corresponding to the virtual machine with a high priority according to the priority order, and then generate a virtual The corresponding access command of the machine.
- the generating unit 804 is configured to generate an access instruction according to the access request, where the generating unit 804 is configured to: And according to the chronological order in which the at least two access requests are obtained, the access instruction corresponding to the access request received by the sir is first generated, and the access instruction corresponding to the received access request is generated.
- the obtaining unit 802 is further configured to: acquire a target from the storage device. a feedback message, where the feedback message includes an execution result of the access instruction and an identifier of a virtual channel of the virtual machine; the sending unit 806 is further configured to: determine the virtual machine according to the identifier of the virtual channel, And transmitting the execution result of the access instruction to the virtual machine.
- the acquiring unit 802 is configured to acquire an access request from a virtual machine, where the acquiring unit 802 is configured to receive a first doorbell notification from the virtual machine. Obtaining the access request from an I/O sharing ring shared by the virtual machine, where the access request is placed in the I/O sharing ring by the virtual machine, where the first doorbell notification is used to indicate The I/O sharing ring has an access request arrival; the sending unit 806 is configured to send the execution result of the access instruction to the virtual machine, and the sending unit 806 is configured to execute the access request result. And placing an I/O sharing ring shared with the virtual machine, and sending a second doorbell notification to the virtual machine, where the second doorbell notification is used to indicate that the I/O sharing ring has an execution result arrival.
- the access instruction is a small computer system interface SCSI command that can be processed by the host bus adapter driver layer; the sending unit 806 is configured to use the access
- the sending of the instruction to the storage device target comprises: the sending unit 806 configured to send the access instruction to the storage device target by the host bus adapter driver layer.
- the embodiment of the present invention corresponds to the method embodiment of FIG. 6.
- the description of the features of the embodiment of FIG. 5 and FIG. 6 is applicable to the embodiment of the present invention, and details are not described herein again.
- FIG. 9 is a schematic diagram of a logical structure of a storage device accessing device 900 according to an embodiment of the present invention.
- the device 900 is configured to manage an access operation of a virtual machine to a storage device.
- the device 900 includes an obtaining unit 902 and a determining unit 904. And processing unit 906, wherein
- the obtaining unit 902 is configured to acquire an access instruction, where the access command carries virtual address information and an identifier of a virtual channel of the virtual machine, where the virtual channel is used to connect the virtual machine to the device, and the virtual machine and the virtual channel are Correspondingly, the virtual address information is used to indicate a virtual address of the storage area to be accessed in the virtual machine;
- a determining unit 904 configured to determine, according to the virtual address information carried in the access instruction and the identifier of the virtual channel, a physical address of the storage area to be accessed in the storage device;
- the processing unit 906 is configured to operate the storage area to be accessed according to the access instruction and the physical address of the storage area to be accessed in the storage device.
- the determining unit 904 is configured to determine, according to the virtual address information carried in the access instruction and the identifier of the virtual channel, a physical address of the storage area to be accessed in the storage device, including: The determining unit 904 is configured to query a preset second correspondence according to the virtual address information carried in the access command and the identifier of the virtual channel, and determine the physicality of the storage area to be accessed in the storage device.
- An address, where the second correspondence includes a correspondence between an identifier of each virtual channel and a physical address of a storage area allocated for each virtual channel.
- the device is configured with at least one cache queue, and each cache queue has a one-to-one correspondence with each virtual channel; after the obtaining unit 902 obtains the access instruction, the acquiring unit 902 is further configured to: put the access command Entering a second cache queue corresponding to the virtual channel of the virtual machine; the determining unit 904 determines that the storage area to be accessed is before the physical address in the storage device, and is further configured to: virtualize from the virtual machine The access instruction is taken out from the second cache queue corresponding to the channel.
- the determining unit 904 is configured to determine a physical address of the storage area to be accessed in the storage device, The determining unit 904 is configured to first determine, according to a priority order of the at least two virtual machines corresponding to the at least two access instructions, a storage area to be accessed of the virtual machine with a high priority in the storage order. The physical address in the device, and then determine the priority The physical address of the storage area of the low virtual machine to be accessed in the storage device.
- the determining unit 904 is configured to determine a physical address of the storage area to be accessed in the storage device, The determining unit 904 is configured to determine, according to the chronological order of the at least two access instructions, the storage unit to be accessed corresponding to the first received access instruction in the storage device.
- the physical address is determined by the physical address of the storage area to be accessed corresponding to the access instruction received in the storage device.
- the processing unit 906 operates the storage area to be accessed according to the access instruction and the physical address of the storage area to be accessed in the storage device. Then, it is further used to: return a feedback message, where the feedback message includes an execution result of the access instruction and an identifier of a virtual channel of the virtual machine.
- the embodiment of the present invention corresponds to the method embodiment of FIG. 7.
- the feature description of the embodiment of FIG. 5 and FIG. 7 is applicable to the embodiment of the present invention, and details are not described herein again.
- FIG. 10 is a schematic diagram showing the hardware structure of a storage device access device 1000 according to an embodiment of the invention.
- apparatus 1000 includes a processor 1002, a memory 1004, an input/output interface 1006, a communication interface 1008, and a bus 1010.
- the processor 1002, the memory 1004, the input/output interface 1006, and the communication interface 1008 implement a communication connection with each other through the bus 1010.
- the processor 1002 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
- CPU central processing unit
- ASIC application specific integrated circuit
- the memory 1004 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
- the memory 1004 can store an operating system and other applications.
- the program code for implementing the technical solution provided by the embodiment of the present invention is saved in the memory 1004 and executed by the processor 1002.
- the input/output interface 1006 is for receiving input data and information, and outputting data such as operation results.
- Communication interface 1008 implements the apparatus using transceivers such as, but not limited to, transceivers Communication between 1000 and other devices or communication networks.
- Bus 1010 can include a path for communicating information between various components of device 1000 (e.g., processor 1002, memory 1004, input/output interface 1006, and communication interface 1008).
- device 1000 may also include other devices necessary to achieve proper operation.
- device 1000 may also include hardware devices that implement other additional functions, depending on the particular needs.
- device 1000 may also only include the components necessary to implement embodiments of the present invention, and does not necessarily include all of the devices shown in FIG.
- FIG. 10 and the above description are applicable to various storage device access apparatuses and systems provided by the embodiments of the present invention, and are applicable to performing various storage device access methods provided by the embodiments of the present invention.
- the disclosed systems, devices, and methods may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the modules is only a logical function division, and may be implemented in another manner, for example, multiple modules or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.
- the modules described as separate components may or may not be physically separated.
- the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
- the above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.
- the above-described integrated modules implemented in the form of software function modules can be stored in a computer readable storage medium.
- the above software function modules are stored in a storage medium, including The dry commands are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform some of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a mobile hard disk, a read-only memory (English: Read-Only Memory, ROM for short), a random access memory (English: Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like. The medium of the code.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本发明实施例提供了一种存储设备访问方法、装置和系统,用于虚拟机对存储设备的访问操作。该方法包括:I/O适配器获取到来自虚拟机的访问请求,访问请求中携带待访问的存储区域的虚拟地址信息,根据该访问请求生成访问指令,访问指令中携带该虚拟地址信息和该虚拟机的虚拟通道的标识,虚拟通道与虚拟机一一对应,用于连接对应的虚拟机与存储设备目标器,存储设备目标器用于管理对存储设备的访问操作,并将访问指令发送给存储设备目标器。从而实现了虚拟机对存储设备的直接访问,简化了存储设备的访问方法,缩减了I/O访问流程,减少了软件层对内存资源和计算资源的消耗。
Description
本发明实施例涉及计算机领域,尤其涉及一种存储设备访问方法、装置和系统。
虚拟化技术起源于对分时系统的需求,主要的目标是在一台主机上运行多个操作系统,以便充分利用大型机上昂贵的计算资源。随着x86处理器的性能提升以及应用的普及,虚拟化技术的发展也开始进入x86架构领域。特别是20世纪90年代末期,虚级化软件厂商为x86平台上的虚拟化技术应用开辟了道路,提供了以虚拟机监控器(Virtual Machine Monitor,简称VMM)为中心,对个人计算机(Personal Computer,PC)服务器平台虚拟化的软件解决方案。虚拟机(Virtual Machine,简称VM)负责在一个硬件平台上虚拟多个独立的、指令集架构(instruction set architectur,简称ISA)和实际硬件相同的虚拟硬件系统,其中每个虚拟硬件系统均可运行不同的操作系统,即用户操作系统(Guest OS)。用户操作系统将通过虚拟机监控器VMM来访问实际的物理资源。
现有技术中,虚拟机对外设的访问要经过多个软件层的转换操作,对存储设备的访问操作存在机制冗余。所以,需要开发新的技术,来解决这一问题。
发明内容
有鉴于此,本发明实施例提供了一种存储设备访问方法、装置和系统,以简化虚拟机对存储设备的访问操作。
第一方面,本发明实施例提供了一种存储设备访问方法,通过在计算机系统上配置I/O适配器,从而管理运行在该计算机系统上的虚拟机对存储设备的访问操作,I/O适配器获取到来自虚拟机的携带其待访问的存储区域的虚拟地址信息的访问请求后,根据访问请求生成访问指令,并将访问指令发送给存储设备目标器。其中,访问指令中携带该虚拟地址信息和该虚拟机的
虚拟通道的标识,虚拟通道用于连接虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应,存储设备目标器用于管理对存储设备的访问操作。
虚拟机与虚拟通道一一对应,虚拟通道是指在数据传输过程中,使用存储传输协议,建立在实体物理介质之上的,表示虚拟机与存储设备之间的唯一连接关系的数据传输通道,虚拟通道和虚拟通道的标识是为了表征虚拟机与存储设备(存储设备目标器)的唯一连接关系,每一个虚拟机都通过唯一的虚拟通道的标识进行标识的虚拟通道与存储设备(存储设备目标器)连接。在具体实现时,虚拟通道可以有多种实现形式,例如,可以通过分时复用物理连接通道来实现。
通过I/O适配器维护虚拟机与存储设备之间的虚拟通道,在访问指令中加入虚拟机对应的虚拟通道的标识,从而实现虚拟机对存储设备的访问,简化了访问流程。
应了解,在本申请中,虚拟通道与虚拟机一一对应,一个主体与虚拟通道一一对应,则也与虚拟机一一对应,在本申请的一些描述中,“与虚拟机对应”和“与虚拟通道对应”可以相互替换,“与虚拟机关联”和“与虚拟通道关联”也可以相互替换。
结合第一方面,在第一方面第一种可能的实现方式中,I/O适配器根据访问请求生成访问指令之前,通过查询预设的第一对应关系,确定与该虚拟机对应的虚拟通道的标识,其中,第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系,第一对应关系可以提前配置,或通过I/O适配器与存储设备目标器通过协商确定。其中,对应关系的实现形式多种多样,例如,可以使用数据表的形式进行表示,也可以采用给每一个虚拟机配置一个寄存器,寄存器里保存对应的虚拟通道的标识来进行表示,本申请并不对此进行限定。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第二种可能的实现方式中,I/O适配器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;I/O适配器获取来自虚拟机的访问请求之后,如果当前不是空闲状态,或负载较大,进一步可以将访问请求放入该虚拟机的虚拟通道对应的第一缓存队列;并在根据访问请求生成访问指令之前,从该虚拟机的虚拟通道对应的第一缓存队列中取出访问请求。
通过给每一个虚拟通道增加缓存队列,可以使I/O适配器工作更加灵活,且在负载较大的情况下不会丢失访问请求,使用类似于先进先出(First In First Out,FIFO)结构的一个缓存队列来缓存所有虚拟机的访问请求也是可选的一种实现方式,但是FIFO结构无法区分虚拟机的优先级等信息,通过给每一个虚拟通道配置一个缓存队列,对于可以合并的访问请求还可以合并处理。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第三种可能的实现方式中,若I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,I/O适配器根据访问请求生成访问指令,包括:I/O适配器根据至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
通过给不同的虚拟机设置优先级关系,可以优先处理重要或用于服务等级高虚拟机的访问操作,从而使虚拟机对存储设备的访问操作更加灵活。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第四种可能的实现方式中,若I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,I/O适配器根据访问请求生成访问指令,包括:I/O适配器根据获取到至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
根据接收到访问请求的顺序处理,可以简化系统架构,仅仅需要采用FIFO的缓存结构,不需要分别缓存不同虚拟机的访问请求。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第五种可能的实现方式中,I/O适配器将访问指令发送给存储设备目标器之后,进一步获取来自存储设备目标器的反馈消息,反馈消息包含该访问指令的执行结果和该虚拟机的虚拟通道的标识,并根据该虚拟通道的标识确定该虚拟机,将访问指令的执行结果发送给该虚拟机。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第六种可能的实现方式中,I/O适配器获取来自虚拟机的访问请求,包括:I/O适配器接收来自虚拟机的第一门铃通知,并从与虚拟机共用的I/O共享环中获取访问请求,访问请求由虚拟机放入该I/O共享环,第一门铃通知用于指
示该I/O共享环有访问请求到达;I/O适配器将访问指令的执行结果发送给该虚拟机,包括:I/O适配器将访问请求的执行结果放入与该虚拟机共用的I/O共享环,并向该虚拟机发送第二门铃通知,第二门铃通知用于指示该I/O共享环有执行结果到达。
结合第一方面或第一方面以上任一种可能的实现方式,在第一方面第七种可能的实现方式中,虚拟机运行在与存储设备独立的计算设备上,访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;I/O适配器将访问指令发送给存储设备目标器,包括:I/O适配器通过主机总线适配器驱动层将访问指令发送给存储设备目标器。
如果虚拟机运行在存储设备上,即一体机的应用场景下,I/O适配器和存储设备目标器可以不通过HBA驱动层进行访问指令等消息的传递。
第二方面,本发明实施例提供了一种计算机可读介质,包括计算机执行指令,当计算机的处理器执行该计算机执行指令时,该计算机执行第一方面或第一方面任一种可能的实现方式中的方法。
第三方面,本发明实施例提供了一种存储设备访问装置,包括:处理器、存储器、总线和通信接口;该存储器用于存储执行指令,该处理器与该存储器通过该总线连接,当存储设备访问装置运行时,该处理器执行该存储器存储的该执行指令,以使该装置执行第一方面或第一方面任一种可能的实现方式中的方法。
第四方面,本发明实施例提供了一种存储设备访问方法,用于管理虚拟机对存储设备的访问操作,包括:存储设备目标器获取访问指令,访问指令中携带虚拟地址信息和该虚拟机的虚拟通道的标识,虚拟通道用于连接虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应,虚拟地址信息用于表示待访问的存储区域在虚拟机中的虚拟地址;存储设备目标器根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,确定待访问的存储区域在存储设备中的物理地址;存储设备目标器根据访问指令和待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作。
通过虚拟通道的配置,可以使存储设备目标器能够识别出不同的虚拟机,因为虚拟通道表征了虚拟机与存储设备的唯一连接关系,所以即使运行在不同物理机上的虚拟机标识有重复,存储设备也可以分辨出不同物理机上
的虚拟机,从而根据虚拟地址信息和该虚拟机的虚拟通道的标识唯一的确定虚拟机待访问的存储区域的物理地址。
结合第四方面,在第四方面第一种可能的实现方式中,存储设备目标器根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,确定待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,查询预设的第二对应关系,确定待访问的存储区域在存储设备中的物理地址,其中,第二对应关系包括每个虚拟通道的标识与为每个虚拟通道分配的存储区域的物理地址的对应关系。
此处的第二对应关系的实现形式多种多样,可以使用数据表的形式进行表示,也可以采用给每一个虚拟机配置一个寄存器,寄存器里保存对应的虚拟通道的标识来进行表示,本申请并不对此进行限定。
结合第四方面或第四方面以上任一种可能的实现方式,在第四方面第二种可能的实现方式中,存储设备目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;存储设备目标器获取访问指令之后,进一步包括:存储设备目标器将访问指令放入该虚拟机的虚拟通道对应的第二缓存队列;存储设备目标器确定待访问的存储区域在存储设备中的物理地址之前,进一步包括:存储设备目标器从该虚拟机的虚拟通道对应的第二缓存队列中取出访问指令。
通过给每一个虚拟通道配置对应的缓存队列,可以使存储设备目标器的工作方式更加灵活,能够针对性的应对某一些虚拟机访问量突发的状况,且可以根据需要,优先的处理某一些虚拟机的访问请求,对于可以合并的访问请求还可以合并处理。
可选的,存储设备目标器的缓存队列也可以采用FIFO结构。
结合第四方面或第四方面以上任一种可能的实现方式,在第四方面第三种可能的实现方式中,若存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,存储设备目标器确定待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器根据该至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在
存储设备中的物理地址。
通过给不同的虚拟通道(虚拟机)设置优先级关系,可以使存储设备目标器优先的处理重要或用户服务等级高的虚拟机的访问请求,增加了存储设备目标器管理对存储设备访问的灵活性。优先级先后顺序可以动态的进行调整。
结合第四方面或第四方面以上任一种可能的实现方式,若存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,存储设备目标器确定待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器根据获取到该至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址。
采用接收到访问指令的时间先后顺序对访问指令进行处理,可以简化存储设备的系统架构,仅仅采用FIFO的缓存结构即可以满足需求。
结合第四方面或第四方面以上任一种可能的实现方式,在第四方面第五种可能的实现方式中,存储设备目标器根据访问指令和待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作之后,进一步包括:存储设备目标器返回反馈消息,所述反馈消息包含访问指令的执行结果和该虚拟机的虚拟通道的标识。
第五方面,本发明实施例提供了一种计算机可读介质,包括计算机执行指令,当计算机的处理器执行该计算机执行指令时,该计算机执行第四方面或第四方面任一种可能的实现方式中的方法。
第六方面,本发明实施例提供了一种存储设备访问装置,包括:处理器、存储器、总线和通信接口;该存储器用于存储执行指令,该处理器与该存储器通过该总线连接,当存储设备访问装置运行时,该处理器执行该存储器存储的该执行指令,以使该装置执行第四方面或第四方面任一种可能的实现方式中的方法。
第七方面,本发明实施例提供了一种存储设备访问装置,用于管理运行在计算机系统上的虚拟机对存储设备的访问操作,包括:获取单元,用于获取获取来自虚拟机的访问请求,访问请求中携带待访问的存储区域的虚拟地址信息;生成单元,用于根据访问请求生成访问指令,访问指令中携带虚拟
地址信息和该虚拟机的虚拟通道的标识,该虚拟通道用于连接该虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应,存储设备目标器用于管理对存储设备的访问操作;发送单元,用于将访问指令发送给存储设备目标器。
结合第七方面,在第七方面第一种可能的实现方式中,生成单元根据访问请求生成访问指令之前,还用于:根据该虚拟机的标识查询预设的第一对应关系,确定虚拟通道的标识,其中,第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
结合第七方面或第七方面以上任一种可能的实现方式,在第七方面第二种可能的实现方式中,该装置配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;获取单元获取来自该虚拟机的访问请求之后,还用于:将访问请求放入该虚拟机的虚拟通道对应的第一缓存队列;生成单元根据访问请求生成访问指令之前,还用于:从该虚拟机的虚拟通道对应的第一缓存队列中取出访问请求。
结合第七方面或第七方面以上任一种可能的实现方式,在第七方面第三种可能的实现方式中,若获取单元获取到来自至少两个虚拟机的至少两个访问请求,生成单元用于根据访问请求生成访问指令,包括:生成单元用于根据该至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
结合第七方面或第七方面以上任一种可能的实现方式,若获取单元获取到来自至少两个虚拟机的至少两个访问请求,生成单元用于根据访问请求生成访问指令,包括:生成单元用于根据获取到该至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
结合第七方面或第七方面以上任一种可能的实现方式,在第七方面第五种可能的实现方式中,发送单元将访问指令发送给存储设备目标器之后,获取单元还用于:获取来自存储设备目标器的反馈消息,反馈消息包含访问指令的执行结果和该虚拟机的虚拟通道的标识;发送单元还用于:根据该虚拟通道的标识确定该虚拟机,并将访问指令的执行结果发送给该虚拟机。
结合第七方面或第七方面以上任一种可能的实现方式,在第七方面第六
种可能的实现方式中,获取单元用于获取来自虚拟机的访问请求,包括:获取单元用于接收来自该虚拟机的第一门铃通知,并从与该虚拟机共用的I/O共享环中获取访问请求,访问请求由该虚拟机放入该I/O共享环,第一门铃通知用于指示该I/O共享环有访问请求到达;发送单元用于将访问指令的执行结果发送给该虚拟机,包括:发送单元用于将访问请求的执行结果放入与该虚拟机共用的I/O共享环,并向该虚拟机发送第二门铃通知,第二门铃通知用于指示该I/O共享环有执行结果到达。
结合第七方面或第七方面以上任一种可能的实现方式,在第七方面第七种可能的实现方式中,访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;发送单元用于将访问指令发送给存储设备目标器,包括:发送单元用于通过主机总线适配器驱动层将访问指令发送给存储设备目标器。
应理解,第七方面为第一方面的方法对应的装置实现方式,第一方面或第一方面任一种可能的实现方式中的特征描述适用于第七方面或第七方面任一种可能的实现方式,在此不再赘述。
第八方面,本发明实施例提供了一种存储设备访问装置,其特征在于,用于管理虚拟机对存储设备的访问操作,包括:获取单元,用于获取访问指令,访问指令中携带虚拟地址信息和该虚拟机的虚拟通道的标识,该虚拟通道用于连接虚拟机与该装置,虚拟机与虚拟通道一一对应,虚拟地址信息用于表示待访问的存储区域在虚拟机中的虚拟地址;确定单元,用于根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,确定待访问的存储区域在存储设备中的物理地址;处理单元,用于根据访问指令和待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作。
结合第八方面,在第八方面第一种可能的实现方式中,确定单元用于根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,确定待访问的存储区域在存储设备中的物理地址,包括:确定单元用于根据访问指令中携带的虚拟地址信息和该虚拟机的虚拟通道的标识,查询预设的第二对应关系,确定待访问的存储区域在存储设备中的物理地址,其中,第二对应关系包括每个虚拟通道的标识与为每个虚拟通道分配的存储区域的物理地址的对应关系。
结合第八方面或第八方面以上任一种可能的实现方式,在第八方面第二种可能的实现方式中,该装置配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;获取单元获取访问指令之后之后,还用于:将访问指令放入该虚拟机的虚拟通道对应的第二缓存队列;确定单元确定待访问的存储区域在存储设备中的物理地址之前,还用于:从该虚拟机的虚拟通道对应的第二缓存队列中取出访问指令。
结合第八方面或第八方面以上任一种可能的实现方式,在第八方面第三种可能的实现方式中,若获取单元获取到来自至少两个虚拟机的至少两个访问指令,确定单元用于确定待访问的存储区域在存储设备中的物理地址,包括:确定单元用于根据该至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在存储设备中的物理地址。
结合第八方面或第八方面以上任一种可能的实现方式,在第八方面第四种可能的实现方式中,若获取单元获取到来自至少两个虚拟机的至少两个访问指令,确定单元用于确定待访问的存储区域在存储设备中的物理地址,包括:确定单元用于根据获取单元获取到该至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址。
结合第八方面或第八方面以上任一种可能的实现方式,在第八方面第五种可能的实现方式中,处理单元根据访问指令和待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作之后,还用于:返回反馈消息,反馈消息包含访问指令的执行结果和该虚拟机的虚拟通道的标识。
应理解,第八方面为第四方面的方法对应的装置实现方式,第四方面或第四方面任一种可能的实现方式中的特征描述适用于第八方面或第八方面任一种可能的实现方式,在此不再赘述。
第九方面,本发明实施例提供了一种存储设备访问系统,包括I/O适配器和存储设备目标器,I/O适配器用于获取来自虚拟机的访问请求,访问请求中携带待访问的存储区域的虚拟地址信息,根据访问请求生成访问指令,
并将访问指令发送给存储设备目标器,访问指令中携带虚拟地址信息和该虚拟机的虚拟通道的标识,该虚拟通道用于连接该虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应;存储设备目标器用于获取访问指令,根据访问指令中携带的虚拟地址信息和该虚拟通道的标识,确定该待访问的存储区域在存储设备中的物理地址,并根据访问指令和该待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作。
结合第九方面,I/O适配器根据访问请求生成访问指令之前,还用于:根据该虚拟机的标识查询预设的第一对应关系,确定该虚拟通道的标识,其中,该第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第二种可能的实现方式中,I/O适配器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;I/O适配器获取来自该虚拟机的访问请求之后,还用于:将访问请求放入该虚拟机的虚拟通道对应的第一缓存队列;I/O适配器根据访问请求生成访问指令之前,还用于:从该虚拟机的虚拟通道对应的第一缓存队列中取出访问请求。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第三种可能的实现方式中,若I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,I/O适配器用于根据访问请求生成访问指令,包括:I/O适配器用于根据该至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第四种可能的实现方式中,若I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,I/O适配器用于根据访问请求生成访问指令,包括:I/O适配器用于根据获取到该至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第五种可能的实现方式中,I/O适配器将访问指令发送给存储设备目标器之后,还用于:获取来自存储设备目标器的反馈消息,反馈消息包含访问指令的执
行结果和该虚拟机的虚拟通道的标识,并根据该虚拟通道的标识确定该虚拟机,将访问指令的执行结果发送给该虚拟机。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第六种可能的实现方式中,I/O适配器用于获取来自虚拟机的访问请求,包括:I/O适配器用于接收来自该虚拟机的第一门铃通知,并从与该虚拟机共用的I/O共享环中获取访问请求,访问请求由该虚拟机放入该I/O共享环,该第一门铃通知用于指示该I/O共享环有访问请求到达;I/O适配器用于将访问指令的执行结果发送给该虚拟机,包括:I/O适配器用于将访问请求的执行结果放入与该虚拟机共用的I/O共享环,并向该虚拟机发送第二门铃通知,该第二门铃通知用于指示该I/O共享环有执行结果到达。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第七种可能的实现方式中,访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;I/O适配器用于将访问指令发送给存储设备目标器,包括:I/O适配器用于通过该主机总线适配器驱动层将访问指令发送给存储设备目标器。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第八种可能的实现方式中,存储设备目标器用于根据访问指令中携带的虚拟地址信息和该虚拟通道的标识,确定该待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器用于根据访问指令中携带的虚拟地址信息和该虚拟通道的标识,查询预设的第二对应关系,确定该待访问的存储区域在存储设备中的物理地址,其中,该第二对应关系包括每个虚拟通道的标识与为该每个虚拟通道分配的存储区域的物理地址的对应关系。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第九种可能的实现方式中,存储设备目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;存储设备目标器获取访问指令之后,还用于:将访问指令放入该虚拟机的虚拟通道对应的第二缓存队列;存储设备目标器确定该待访问的存储区域在存储设备中的物理地址之前,还用于:从该虚拟机的虚拟通道对应的第二缓存队列中取出访问指令。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第十种可能的实现方式中,若存储设备目标器获取到来自至少两个虚拟机的至少
两个访问指令,存储设备目标器用于确定该待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器用于根据该至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在存储设备中的物理地址。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第十一种可能的实现方式中,若存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,存储设备目标器用于确定该待访问的存储区域在存储设备中的物理地址,包括:存储设备目标器用于根据获取到该至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在存储设备中的物理地址。
结合第九方面或第九方面以上任一种可能的实现方式,在第九方面第十二种可能的实现方式中,存储设备目标器根据访问指令和该待访问的存储区域在存储设备中的物理地址,对待访问的存储区域进行操作之后,还用于:返回反馈消息,所述反馈消息包含访问指令的执行结果和该虚拟机的虚拟通道的标识。
应理解,第九方面为第一方面和第四方面的方法对应的系统实现方式,第一方面或第一方面任一种可能的实现方式,或第四方面或第四方面任一种可能的实现方式中的特征描述适用于第九方面或第九方面任一种可能的实现方式,在此不再赘述。
根据本申请公开的技术方案,通过在虚拟机与存储设备之间配置I/O适配器,并通过在I/O适配器与存储设备之间配置与虚拟机一一对应的虚拟通道,并在访问指令中携带对应的虚拟通道的标识,使存储设备目标器能够根据虚拟地址信息和虚拟机的虚拟通道的标识唯一的确定待访问区域的物理地址,从而实现了虚拟机对存储设备的直接访问,简化了存储设备的访问方法,缩减了I/O访问流程,减少了软件层对内存资源和计算资源的消耗。
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所
需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一种虚拟化系统的结构示意图;
图2为依据本发明一实施例的存储设备访问系统的结构示意图;
图3为一种存储设备访问架构示意图;
图4为依据本发明一实施例的存储设备访问架构示意图;
图5为依据本发明一实施例的存储设备访问方法的信令图;
图6为依据本发明一实施例的存储设备访问方法的示范性流程图;
图7为依据本发明一实施例的存储设备访问方法的示范性流程图;
图8为依据本发明一实施例的存储设备访问装置的逻辑结构示意图;
图9为依据本发明一实施例的存储设备访问装置的逻辑结构示意图;
图10为依据本发明一实施例的存储设备访问装置硬件结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为一种虚拟化系统100的结构示意图,如图1所示,系统100包括:物理硬件106、虚拟机监视器104(Virtual Machine Monitor,VMM)以及运行在物理硬件上的N个虚拟机102,其中,N为大于0的正整数。
虚拟机监视器(Virtual Machine Monitor)是介于虚拟机操作系统和物理硬件之间的一个软件描述层。它负责在各个虚拟机之间进行处理器调度和内存分配等。VMM不仅抽象出虚拟机的硬件,同时还控制着各个虚拟机的执行。
VMM还可以用于管理虚拟机的创建、销毁、暂停、恢复及迁移,以及虚拟机之间的CPU调度、内存分配及设备访问等。
VMM向虚拟机提供了一个抽象层,其中包含了管理和虚拟硬件的应用程序接口(Application Programming Interface,API)。VMM向虚拟机提供了虚拟中央处理器(Virtual Central Processing Unit,简称VCPU)、虚拟存储器
管理单元(Memory Management Unit,简称MMU)等基本的虚拟硬件,并向虚拟机提供了相应的硬件接口(安全硬件接口),以保证设备访问得以安全进行。
安全硬件接口提供直接内存访问(Direct Memory Access,简称DMA)、输入输出(Input&Output,简称I/O)、驱动程序、虚拟的外围组件互联(Peripheral Component Interconnect,简称PCI)地址配置、虚拟硬件中断等硬件虚拟工作。
系统100可以支持半虚拟化和全虚拟化,运行在VMM上的半虚拟化(Paravirtualized,简称PV)虚拟机上运行着被修改过内核的操作系统,或者上层操作系统安装了半虚拟化的驱动程序的系统。运行在VMM上的全虚拟化虚拟机上运行着没有修改内核且没有安装半虚拟化驱动程序的操作系统。
图2为依据本发明一实施例的存储设备访问系统200(a)和200(b)的结构示意图,如图2所示,本发明实施例的存储设备访问系统包含两种结构。
如图2(a)所示,系统200(a)包含存储设备202,以及M个计算设备204,其中每一个计算设备204上运行有图1所示的虚拟化系统100,M为大于0的正整数。
如图所示,每一个计算设备204上均运行有至少一个虚拟机,存储设备202被M个计算设备204上的虚拟机共用,计算设备204与存储设备202相互分离,计算设备204与存储设备202之间可以通过光纤或串行电缆或其他连接方式来相互连接。本发明实施例并不限定存储设备202与计算设备204之间的连接方式。
图2(a)描述了普通存储区域网络(Storage Area Networking,SAN)中计算设备204和存储设备202的应用场景,在此场景中,每个计算设备204上运行的虚拟机产生数据后,经过计算设备204的特定处理后,把有效数据存放到存储设备202的存储阵列中。
存储设备202由存储阵列组成,存储设备202的种类多种多样,包括,但不限于,RAM、ROM、EEPROM、闪存、其他的存储器技术,CD-ROM、数字通用盘、其他的光存储,磁卡带、磁带、磁盘存储、其他的磁存储设
备,以及任何其他可以用来存储所需信息并可由计算设备204访问的介质。本发明实施例并不对存储设备202的实现方式进行限定。
计算设备204在其基本的配置中,通常包括至少一个处理器和存储器。存储器可以是易失性的,诸如随机访问内存(Random Access Memory,RAM),非易失性的,诸如只读存储器(Read Only Memory,ROM)、闪存,或这两者的某种组合。
这个基本的配置可以具有外加的特征和功能。例如,它可以包括外设的存储(可移动的和不可移动的),其包括但不限于,磁盘和磁带以及光盘和光带。计算机存储介质包括易失性和非易失性的,可移动的和不可移动的,在任何方法或技术中实现的用来存储诸如计算机可读指令、数据结构、程序模块或其它数据等信息的介质。
计算设备204还可以包含允许其与其他设备通信的通信信道。通信信道的介质包括但不限于:光介质、诸如有线网络和直线连接等的有线介质、诸如声音、RF、红外线和其他无线介质等的无线介质。
应了解,本发明实施例仅仅是示例性说明,计算设备204还可以包含其他功能模块,在此不再赘述。
如图2(b)所示,在本发明实施例的另外一种实现方式中,存储设备访问系统200(b)包含存储设备202和M个存储控制器206,存储控制器206上运行有图1所示的虚拟化系统100,M为大于0的正整数。
如图所示,每一个存储控制器206上均运行有至少一个虚拟机,存储设备202被M个存储控制器206上的虚拟机共用,存储控制器206与存储设备202共同组成存储一体机。在本发明实施例的一种实现方式中,存储控制器206可以对存储设备202进行热插拔。
图2(b)描述了SAN中省去计算设备后的存储设备202的应用场景,在此场景中,虚拟机直接运行在存储设备202的存储器控制器206上,虚拟机产生的数据经过存储控制器206的特定处理后,把有效数据存放到存储设备202的存储阵列中。
存储控制器206在其基本的配置中,通常包括至少一个处理器和存储器。存储器可以是易失性的,诸如随机访问内存(Random Access Memory,RAM),非易失性的,诸如只读存储器(Read Only Memory,ROM)、闪
存,或这两者的某种组合。
存储控制器206还可以包含允许其与其他设备通信的通信信道。通信信道的介质包括但不限于:光介质、诸如有线网络和直线连接等的有线介质、诸如声音、RF、红外线和其他无线介质等的无线介质。
应了解,图1中的物理硬件106可以是具体计算机,也可以是存储设备202的存储控制器,或二者任意组合,且图2中系统的实现形式多种多样,可以是计算设备204与存储设备202相互分离,通过任意方式相互连接,也可以是存储控制器206与存储设备202集成在一个存储一体机中。本发明实施例并不对物理硬件106和系统200的具体实现方式进行限定。为了描述方便,在以下描述中,对计算设备204、存储控制器206或二者的任意组合,统称为物理机。
图3为一种存储设备访问架构示意图,如图3所示,以基于内核的虚拟机(Kernel-based Virtual Machine,KVM)为例进行说明,整个存储设备访问流程要经过虚拟机102、虚拟机主机目标器(Vhost target)302、块设备层(Block level)304、小型计算机系统接口中层(Small Computer System Interface level,SCSI level)306和存储设备202。
在图2的200(a)场景下,还需要经过计算设备204和存储设备202的主机总线适配器驱动(Host Bus Adaptor driver,HBA driver)。HBA driver是物理机器上的操作系统SCSI协议传输层(也称HBA驱动层),连接物理机内部总线和存储设备,作为SCSI协议的载体层,完成SCSI协议与具体协议报文之间的打包和解析,配合SCSI中层的完成错误处理,负责传输SCSI中层下发的SCSI命令。
存储设备202的存储阵列可以被划分为多个逻辑单元号(Logical Unit Number,LUN)设备,每一个LUN设备拥有一个LUN。存储设备202的LUN设备被分配给多个虚拟机使用,其中,多个虚拟机可以是运行在同一个物理上,也可以是运行在不同的物理机上,本发明实施例对此并不进行限定。
在整个系统运行的之前,首先有一个物理机和存储设备202的LUN设备配置过程,使得存储设备202的LUN设备在物理机的块设备层呈现出实体盘符。其次需要用户通过配置工具把块设备上的实体盘符分别配置给该
物理机上运行的多个虚拟机,以使得在虚拟机内部呈现出虚拟盘符。为了描述方便,在本发明实施例中,虚拟机内部的盘符叫做虚拟盘符,物理机块设备层呈现的盘符叫做实体盘符。
虚拟机102内部的应用层有对存储设备202的访问需求时,虚拟机102会生成相应块读写请求(BLOCK Input and Output Request,BIO),然后你将BIO发给该虚拟机的块设备(虚拟机内的),虚拟机的块设备根据BIO生成请求Request,然后基于Requst进行合并、排序、缓存、调度,然后经过调度算法将Request发给虚拟机的SCSI中层(虚拟机内的),虚拟机的SCSI中层会生成SCSI命令发送给虚拟磁盘驱动virtio-scsi,virtio-scsi根据SCSI命令生成virtio_scsi_cmd请求,virtio_scsi_cmd请求包含SCSI命令描述符(Command Distription Block,CBD)、数据空间描述信息和数据传输方向信息,以及其他IO属性等数据,virtio_scsi_cmd携带了块设备层(Block level)304给虚拟机102提供的虚拟盘符信息。
虚拟机的虚拟磁盘驱动virtio-scsi把virtio_scsi_cmd请求发到虚拟机的I/O共享环vring中,通过门铃机制通知Vhost target 302有新的I/O请求到达。
Vhost target 302获知门铃信号后从vring中取出virtio_scsi_cmd,并解析和处理该请求,如果不是读写命令,则直接在vhost target 302中模拟处理;如果是读写命令,则生成对应的BIO,并发给指定的块设备层304。
块设备层304根据BIO生成请求Request,然后基于Requst进行合并、排序、缓存、调度,然后经过调度算法将Request发给虚拟机的SCSI中层306。
SCSI中层306进行虚拟盘符到实体盘符的映射,并把Request重新打包成SCSI指令,发送给存储设备202。其中,SCSI指令中携带实体盘符信息。
在图2所示的200(a)的场景下,SCSI中层通过计算设备204和存储设备202的HBA驱动将SCSI指令发往存储设备202。由存储设备202实现实体盘符到存储阵列的LUN设备的映射。
图3实施例实现了虚拟机102对存储设备202的访问,但是整个访问流程要经过虚拟机102内部,vhost target302、块设备层304、SCSI中层306
多层转换才能实现虚拟机102对存储设备202的访问操作。且访问请求经过了两次块设备的缓存、合并、排序、调度、SCSI命令转换,一次在虚拟机内,一次在物理机内。
图4为依据本发明一实施例的存储设备访问架构400示意图,如图4所示,架构400包括:虚拟机102、I/O适配器402和存储设备202。
其中存储设备202可以被运行在多个物理机上的多个虚拟机102使用,在整个系统运行之前,首先有一个物理机上运行的虚拟机102和存储设备202的LUN设备的配置过程,使得存储设备202的LUN设备在物理机上运行的虚拟机102中呈现出虚拟LUN设备。存储设备202的LUN设备可以分配给多个虚拟机使用,多个虚拟机可以运行在一个物理机上,也可以运行在多个物理上,本发明实施例对此并不进行限定。
为了描述方便,在本发明实施例中,虚拟机内部的LUN设备叫做虚拟LUN,使用虚拟LUN对虚拟LUN设备进行标识,存储设备202的存储阵列的LUN设备叫做物理LUN设备,使用物理LUN对物理LUN进行标识。
具体实现过程中,可以由I/O适配器402将物理LUN设备配置为虚拟机102内部的虚拟LUN设备,也可以由VMM完成物理LUN设备到虚拟机102的虚拟LUN设备的配置;可以在创建虚拟机102的时候完成物理LUN设备到虚拟机LUN设备的配置,也可以在后续的资源动态调整时,进行物理LUN设备到虚拟LUN设备的配置。本发明实施例并不对配置主体和配置时间进行限定。
在本发明实施例的一种可能的实现方式中,不同虚拟机内部的编址方式相同,不同虚拟机内部的虚拟lun设备编址是可以重复的。物理lun设备到虚拟lun设备的配置,可以仅仅是物理lun设备编号到虚拟lun设备编号的转化,物理lun设备的属性信息可以透传给虚拟机,例如,是否支持自动精简配置,是否支持集群持续预留,是否支持卸载数据传输,是否支持路径切换等属性信息。其中,物理lun设备到虚拟lun设备的配置过程可以通过I/O适配器或VMM与存储设备目标器的协商来完成,本发明实施例并不对此进行限定。
架构400下的存储设备访问流程信令图如图5所示,访问流程包括:
502:虚拟机102生成对存储设备202的访问请求。
当虚拟机102接收到上层应用需求,要访问存储设备202中的存储阵列时,首先由虚拟机102生成访问请求,该访问请求中携带待访问的存储区域的虚拟地址信息。
在本发明实施例的一种实现方式中,访问请求中可以携带虚拟机102要访问的虚拟LUN设备的虚拟LUN和待访问的存储区域在该虚拟LUN设备的起始地址和地址长度。
以KVM虚拟化进行举例说明,在本发明实施例的一种实现方式中,虚拟机102内部的应用层有对存储设备202的访问需求时,虚拟机102会生成相应块读写请求BIO,并将BIO发给该虚拟机102的块设备(虚拟机内的),虚拟机102的块设备根据BIO生成请求Request,然后基于Requst进行合并、排序、缓存、调度,然后经过调度算法将Request发给虚拟机102的SCSI中层(虚拟机内的),虚拟机102的SCSI中层根据Request生成SCSI命令,并将SCSI命令发送给虚拟磁盘驱动virtio-scsi,virtio-scsi根据SCSI命令生成访问请求virtio_scsi_cmd。其中,访问请求virtio_scsi_cmd中携带用于标识虚拟LUN设备的虚拟LUN和待访问的存储区域在虚拟LUN设备中的起始地址和地址长度。
504:虚拟机102将访问请求发送给I/O适配器402。
虚拟机102将访问请求放入与I/O适配器402共用的I/O共享环,并向I/O适配器发送第一门铃通知,所述第一门铃通知用于指示所述I/O共享环有访问请求到达,I/O适配器402接收来自所述虚拟机的第一门铃通知后,从与所述虚拟机共用的I/O共享环中获取所述访问请求。
以KVM虚拟化进行举例说明,在具体实现过程中,虚拟机102的虚拟磁盘驱动virtio-scsi把访问请求virtio_scsi_cmd放入虚拟机102与I/O适配器的I/O共享环vring中,通过门铃机制通知I/O适配器402有新的访问请求到达。I/O适配器402接收到门铃通知后,会去对应的I/O共享环中取出虚拟机102放入的访问请求virtio_scsi_cmd。
506:I/O适配器402根据访问请求,生成访问指令。
I/O适配器402根据访问请求virtio_scsi_cmd生成访问指令,访问指令中携带待访问的存储区域的虚拟地址信息和虚拟机102对应的虚拟通道的标识。
在本发明实施例的一种实现方式中,访问指令中可以携带虚拟机102要访问的虚拟LUN设备的虚拟LUN、与虚拟机102对应的虚拟通道的标识,以及待访问的存储区域在该虚拟LUN设备的起始地址和地址长度。
其中,虚拟通道用于连接虚拟机102与存储设备202,虚拟机102与虚拟通道一一对应,更具体的,虚拟通道用于连接虚拟机102与存储设备202的存储设备目标器,存储设备目标器用于管理对存储设备202的访问操作,因为存储设备202可以被多个虚拟机共用,甚至被多个物理机上运行的多个虚拟机共用,为了存储设备目标器能够识别出对存储设备202进行访问操作的虚拟机是哪一个虚拟机,需建立虚拟机与虚拟通道的对应关系,虚拟机与存储阵列目标器之间的虚拟通道是唯一的,即虚拟机与虚拟通道一一对应,虚拟通道的标识能够唯一的标识虚拟机。
应理解,虚拟通道和虚拟通道的标识是为了表征虚拟机102与存储设备202的唯一连接关系,虚拟通道是指在数据传输过程中,使用存储传输协议,建立在实体物理介质之上的,表示虚拟机与存储设备之间的唯一连接关系的数据传输通道,每一个虚拟机都通过唯一的虚拟通道的标识进行标识的虚拟通道与存储设备连接。在具体实现时,虚拟通道可以有多种实现形式,例如,可以通过分时复用物理连接通道来实现。
因为运行在不同的物理机上的虚拟机的虚拟机标识是可以重复的,所以虚拟机标识不能唯一的表征虚拟机,而虚拟通道与虚拟机一一对应,虚拟通道的标识的本质目的是唯一的表征与该虚拟通道连接的虚拟机。虚拟机标识的具体实现形式多种多样,本发明实施例对此并不进行限定,可以使用任一种能够唯一表征虚拟机身份的标识来实现这一目的,在虚拟机与存储设备之间传递唯一表征虚拟机身份的虚拟通道的标识的通道即为连接虚拟机与存储设备的唯一虚拟通道。
虚拟通道可以由I/O适配器402与存储设备202通过协商决定,也可以提前配置。例如,在创建虚拟机时,由虚拟机监控器(Virtual Machine Manager,VMM)或创建虚拟机的特权域进行虚拟通道的配置。本发明实施例并不限定虚拟通道以及虚拟通道的标识的配置方式。虚拟通道可以拥有各种属性,例如,承载能力、对应的存储阵列的地址空间、故障处理方法等。
在I/O适配器402内部维护有虚拟通道与虚拟机的一一对应关系,例如,
可以使用数据表的形式,记录虚拟机与虚拟通道的一一对应关系。具体实现过程中,可以使用虚拟机标识指示虚拟机,使用虚拟通道的标识指示虚拟通道。
I/O适配器402根据访问请求生成访问指令之前,通过查询预设的对应关系,确定该虚拟机对应的虚拟通道的标识,其中,对应关系包括虚拟通道的标识与虚拟机的一一对应关系。
通过虚拟通道的配置,可以使存储设备目标器能够识别出不同的虚拟机,因为虚拟通道表征了虚拟机与存储设备的唯一连接关系,所以即使运行在不同物理机上的虚拟机标识有重复,存储设备也可以分辨出不同物理机上的虚拟机,从而根据虚拟地址信息和虚拟机的虚拟通道的标识唯一的确定虚拟机待访问的存储区域的物理地址。
虚拟通道与虚拟机的一一对应关系可以动态的进行调整,当新建一个虚拟机时,可以在对应关系中新加入该新建虚拟机与其对应的虚拟通道的对应关系,当删除一个虚拟机时,同样在对应关系中删除相应的虚拟机与虚拟通道的对应关系。
在本发明实施例的一种实现方式中,I/O适配器将virtio_scsi_cmd指令转换为标准访问指令scsi_cmnd,并使用scsi_cmnd记录LUN地址字段的高两位字节记录虚拟机102对应的虚拟通道的标识。
因为LUN地址格式一般不超过6个字节,而SCSI模型里面定义的LUN地址字段实际上有8个字节,LUN地址字段的高位一般有两个字节是备用字段,所以可以使用LUN地址字段的两个备用的高位字节来携带虚拟通道的标识,以区分不同的虚拟通道。
应理解,访问指令还可以用其他字段或扩展字段来携带虚拟通道的标识,本发明实施例并不对此进行限定,例如,如果虚拟通道数目小于256,只使用LUN地址字段的一个高位字节就可以实现对虚拟通道的标识的记录。
从访问请求到访问指令的部分转换伪代码如下所示,使用LUN地址字段的高两位字节记录虚拟通道的标识Virtual_Channel_no,具体实现为Virtual_Channel_no左移48位(即6个字节),然后与LUN进行“位或”操作,因为LUN地址字段的高两位字节缺省为0,二者进行“位或”操作
后,LUN地址字段的高两位字节记录的即为虚拟通道的标识Virtual_Channel_no,使用两位字节可以区分65536个不同的虚拟通道。
访问请求伪代码:
struct virtio_scsi_cmd{
lun[8];
cdb[32];
sdb;
tag;
....
}
访问指令伪代码:
struct scsi_cmnd{
Cmnd=cdb[32];
sdb=sdb;
lun=lun[8]|Virtual_Channel_no<<48;
tag=tag;
....
}
应了解,以上伪代码仅仅是为了示例性说明,在具体实现的时候,实际代码可以与上述伪代码不同,本发明实施例并不对此进行限定。
在本发明实施例的一种实现方式中,所述I/O适配器402配置有至少一个缓存队列,每一个缓存队列关联一个虚拟通道,每个缓存队列与每个虚拟通道一一对应;所述I/O适配器402获取来自所述虚拟机的所述访问请求之后,进一步将所述访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列;所述I/O适配器402根据所述访问请求生成所述访问指令之前,从所述虚拟机的虚拟通道对应的第一缓存队列中取出所述访问请求。
若所述I/O适配器402获取到来自至少两个虚拟机的至少两个访问请
求,所述I/O适配器402可以根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
若所述I/O适配器402获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器402还可以根据获取到所述至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
应了解,以上I/O适配器402按照虚拟机优先级或按照获取时间的先后顺序,分别处理接收到的多个访问请求的方式,仅仅是举例说明,本发明实施例并不对I/O适配器402处理接收到的访问请求的处理顺序进行限定。
508:I/O适配器将访问指令发送给存储设备202。
具体实现过程中,在图2所示的200(a)的场景下,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令,I/O适配器402通过计算设备204和存储设备202的HBA驱动将访问指令发往存储设备202。
具体的,I/O适配器402将访问指令发送给存储阵列目标器,该存储阵列目标器用于管理对存储设备202的访问操作。
存储阵列目标器获取到来自I/O适配器402的访问指令后,根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址。具体的,存储设备目标器根据虚拟机102待访问的存储区域的虚拟地址和虚拟机102的虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
表1示例性的示出了虚拟机的虚拟地址到存储阵列的物理地址的映射关系。如表1所示,每一个虚拟通道内部的虚拟地址都是唯一的,不同虚拟通道内部的地址可以重复,存储设备目标器根据虚拟地址和虚拟通道的标识能够唯一的确定待访问的存储区域的物理地址。
因为在确定待访问的存储区域的物理地址的时候是依据虚拟通道的标识和虚拟地址共同确定,即使不同物理机上运行的虚拟机的虚拟机标识相
同,因为虚拟机对应的虚拟通道是唯一的,存储设备目标器任然能够根据虚拟通道的标识和虚拟地址,唯一的确定物理地址。
如表1所示,即使虚拟通道的标识为0和1的虚拟通道的虚拟地址相互重叠,因为二者的虚拟通道的标识不同,存储设备目标器可以将虚“拟通道标识0+虚拟地址VA1”映射为物理地址PA1;将“虚拟通道的标识1+虚拟地址VA1”映射为物理地址PA4。
表1地址映射表
在具体实现过程中,虚拟地址为虚拟LUN和待访问存储区与虚拟LUN设备的指示信息,物理地址为物理LUN和待访问的存储区域在物理LUN设备的指示信息,存储设备目标器可以将虚拟机102内部的虚拟LUN映射为实际的物理LUN。
在本发明实施例的一种可能的实现方式中,所述存储设备目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述存储设备目标器获取所述访问指令之后,进一步将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列;所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址之前,从所述虚拟机的虚拟通道对应的第二缓存队列中取出所述访问指令。
若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器可以根据所述至少两个访问指令对应的至少两个
虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器还可以根据获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
应了解,以上存储设备目标器按照优先级或按照获取时间的先后顺序,分别处理接收到的多个访问指令的方式,仅仅是举例说明,本发明实施例并不对存储设备目标器处理接收到的访问指令的处理顺序进行限定。
510:存储设备目标器根据虚拟机待访问的存储区域的物理地址和访问指令,对待访问的存储区域进行访问操作
在具体实现过程中,如果所述访问指令为数据写指令,所述存储设备目标器向物理地址指示的存储区域中写入待写入的数据;如果所述访问指令为数据读指令,所述存储设备目标器从物理地址指示的存储区域中读取待读取的数据。
512:存储设备目标器将访问指令的执行结果返回给I/O适配器402。
在本发明实施例的一种实现方式中,存储设备目标器向I/O适配器402发送反馈消息,所述反馈消息包含访问指令的执行结果和该虚拟机的虚拟通道的标识。I/O适配器根据该虚拟通道的标识确定该虚拟机。可选的,I/O根据预设的第一对应关系,根据虚拟通道的标识查找与虚拟通道高的标识对应的虚拟机。
514:I/O适配器402将访问指令的执行结果返回给虚拟机102。
在本发明实施例的一种实现方式中,I/O适配器402将访问请求的执行结果放入与虚拟机102共用的I/O共享环,并向虚拟机102发送第二门铃通知,该第二门铃通知用于指示所述I/O共享环有执行结果到达。
根据本发明实施例公开的技术方案,通过在虚拟机与存储设备之间配置I/O适配器,并通过在I/O适配器与存储设备之间配置与虚拟机一一对应的虚拟通道,在访问指令中携带对应的虚拟通道的标识,使存储设备目标器能
够根据虚拟地址信息和虚拟机的虚拟通道的标识唯一的确定待访问区域的物理地址,从而实现了虚拟机对存储设备的直接访问,简化了存储设备的访问方法,缩减了I/O访问流程,减少了软件层对内存资源和计算资源的消耗。
图6为依据本发明一实施例的存储设备访问方法600的示范性流程图,计算机系统上运行着至少一个虚拟机,计算机系统上配置有I/O适配器,该I/O适配器用于管理运行在计算机系统上的虚拟机对存储设备的访问操作,方法600包括:
S602:I/O适配器获取来自虚拟机的访问请求,所述访问请求中携带待访问的存储区域的虚拟地址信息。
在本发明实施例的一种可能的实现方式中,当虚拟机接收到上层应用需求,要访问存储设备中的存储阵列时,首先由虚拟机生成访问请求,该访问请求中携带待访问的存储区域的虚拟地址信息。
以KVM虚拟化系统进行举例说明,虚拟机内部的应用层有对存储设备的访问需求时,虚拟机会生成相应块读写请求BIO,并将BIO发给该虚拟机的块设备(虚拟机内的),虚拟机的块设备根据BIO生成请求Request,然后基于Requst进行合并、排序、缓存、调度,然后经过调度算法将Request发给虚拟机的SCSI中层(虚拟机内的),虚拟机的SCSI中层根据Request生成SCSI命令,并将SCSI命令发送给虚拟磁盘驱动virtio-scsi,virtio-scsi根据SCSI命令生成访问请求virtio_scsi_cmd。
在本发明实施例的一种实现方式中,所述I/O适配器获取来自虚拟机的访问请求,包括:所述I/O适配器接收来自所述虚拟机的第一门铃通知,并从与所述虚拟机共用的I/O共享环中获取所述访问请求,所述访问请求由所述虚拟机放入所述I/O共享环,所述第一门铃通知用于指示所述I/O共享环有访问请求到达。
以KVM虚拟化系统进行举例说明,虚拟机的虚拟磁盘驱动virtio-scsi把访问请求virtio_scsi_cmd放入虚拟机与I/O适配器的I/O共享环vring中,并通过门铃机制通知I/O适配器有新的访问请求到达。I/O适配器接收到门铃通知后,会去对应的I/O共享环中取出虚拟机放入的访问请求virtio_scsi_cmd。
S604:I/O适配器根据所述访问请求生成访问指令,所述访问指令中
携带所述虚拟地址信息和该虚拟机的虚拟通道的标识,所述虚拟通道用于连接所述虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应,所述存储设备目标器用于管理对所述存储设备的访问操作。
其中,虚拟通道用于连接虚拟机与存储设备,具体的,虚拟通道用于连接虚拟机与存储设备的存储设备目标器,因为存储设备可以被多个虚拟机共用,甚至被多个物理机上运行的多个虚拟机共用,运行在不同物理机上的虚拟机标识可以重复,为了存储设备目标器能够识别出对存储设备进行访问操作的虚拟机是哪一个虚拟机,需建立虚拟机与虚拟通道的对应关系,虚拟机与存储阵列目标器之间的虚拟通道是唯一的,即虚拟机与虚拟通道一一对应,虚拟通道的标识能够唯一的标识虚拟机。
所述I/O适配器根据所述访问请求生成访问指令之前,进一步包括:所述I/O适配器根据所述虚拟机的标识查询预设的第一对应关系,确定所述虚拟通道的标识,其中,所述第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
虚拟通道可以由I/O适配器与存储设备通过协商决定,也可以提前配置。例如,在创建虚拟机时,由虚拟机监控器(Virtual Machine Manager,VMM)或创建虚拟机的特权域去进行虚拟通道的配置。本发明实施例并不限定虚拟通道以及虚拟通道的标识的配置方式。
以KVM虚拟化系统进行举例说明,I/O适配器根据访问请求virtio_scsi_cmd生成访问指令,访问指令中携带待访问的存储区域的虚拟地址信息和虚拟机对应的虚拟通道的标识。
具体实现过程中,因为LUN地址格式一般不超过6个字节,而SCSI模型里面定义的LUN地址字段实际上有8个字节,LUN地址字段的高位一般有两个字节是备用字段,所以可以使用LUN地址字段的两个备用的高位字节来携带虚拟通道的标识,以区分不同的虚拟通道。应理解,访问指令还可以用其他字段或扩展字段来携带虚拟通道的标识,本发明实施例并不对此进行限定,例如,如果虚拟通道数目小于256,只使用LUN地址字段的一个高位字节就可以实现对虚拟通道的标识的记录。
在本发明实施例的一种实现方式中,I/O适配器将virtio_scsi_cmd指令转换为标准访问指令scsi_cmnd,并使用scsi_cmnd记录LUN地址字段的高
两位字节记录虚拟机对应的虚拟通道的标识。
在本发明实施例的一种实现方式中,所述I/O适配器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述I/O适配器获取来自所述虚拟机的所述访问请求之后,进一步包括:所述I/O适配器将所述访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列;所述I/O适配器根据所述访问请求生成所述访问指令之前,进一步包括:所述I/O适配器从所述虚拟机的虚拟通道对应的第一缓存队列中取出所述访问请求。
可选的,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器根据所述访问请求生成访问指令,包括:所述I/O适配器根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
可选的,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器根据所述访问请求生成访问指令,包括:所述I/O适配器根据获取到所述至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
应了解,以上I/O适配器按照虚拟机优先级或按照获取时间的先后顺序,分别处理接收到的多个访问请求的方式,仅仅是举例说明,本发明实施例并不对I/O适配器处理接收到的访问请求的处理顺序进行限定。
S606:I/O适配器将所述访问指令发送给所述存储设备目标器。
所述I/O适配器将所述访问指令发送给所述存储设备目标器之后,进一步包括:所述I/O适配器获取来自所述存储设备目标器的反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识;所述I/O适配器根据所述虚拟通道的标识确定所述虚拟机,并将所述访问指令的执行结果发送给所述虚拟机。
具体的,所述I/O适配器将所述访问指令的执行结果发送给所述虚拟机,包括:所述I/O适配器将所述访问请求的执行结果放入与所述虚拟机共用的I/O共享环,并向所述虚拟机发送第二门铃通知,所述第二门铃通知用于指示所述I/O共享环有执行结果到达。
具体实现过程中,在图2所示的200(a)的场景下,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;所述I/O适配器将所述访问指令发送给所述存储设备目标器,包括:所述I/O适配器通过所述主机总线适配器驱动层将所述访问指令发送给所述存储设备目标器。
应了解,图6实施例为图5实施例的I/O适配器侧的方法,图5实施例部分的特征描述适用于图6实施例,在此不再赘述。
根据本发明实施例公开的技术方案,通过在虚拟机与存储设备之间配置I/O适配器,并通过在I/O适配器与存储设备之间配置与虚拟机一一对应的虚拟通道,从而实现了虚拟机对存储设备的直接访问,简化了存储设备的访问方法,缩减了I/O访问流程,减少了软件层对内存资源和计算资源的消耗。
图7为依据本发明一实施例的存储设备访问方法700的示范性流程图,存储设备可以被多个虚拟机机共用,该多个虚拟机可以是运行在同一个物理机上的虚拟机,也可以是运行在不同物理机上的虚拟机,不同物理机上的虚拟机标识可以相同,存储器目标器用于管理对存储设备的访问操作,方法700包括:
S702:存储设备目标器获取访问指令,所述访问指令中携带虚拟地址信息和虚拟机的虚拟通道的标识,所述虚拟通道用于连接虚拟机与所述存储设备目标器,虚拟机与虚拟通道一一对应,所述虚拟地址信息用于表示待访问的存储区域在所述虚拟机中的虚拟地址。
其中,虚拟通道用于连接虚拟机与存储设备,具体的,虚拟通道用于连接虚拟机与存储设备的存储设备目标器,因为存储设备可以被多个虚拟机共用,甚至被多个物理机上运行的多个虚拟机共用,运行在不同物理机上的虚拟机标识可以重复,为了存储设备目标器能够识别出对存储设备进行访问操作的虚拟机是哪一个虚拟机,需建立虚拟机与虚拟通道的对应关系,虚拟机与存储阵列目标器之间的虚拟通道是唯一的,即虚拟机与虚拟通道一一对应,虚拟通道的标识能够唯一的标识虚拟机。
虚拟通道可以由物理机侧虚拟机控制器或虚拟机或其他模块与存储设备通过协商决定,也可以提前配置。例如,在创建虚拟机时,由虚拟机监控器(Virtual Machine Manager,VMM)或创建虚拟机的特权域去进行虚
拟通道的配置。本发明实施例并不限定虚拟通道以及虚拟通道的标识的配置方式。
具体实现过程中,因为LUN地址格式一般不超过6个字节,而SCSI模型里面定义的LUN地址字段实际上有8个字节,LUN地址字段的高位一般有两个字节是备用字段,所以可以使用LUN地址字段的两个备用的高位字节来携带虚拟通道的标识,以区分不同的虚拟通道。应理解,访问指令还可以用其他字段或扩展字段来携带虚拟通道的标识,本发明实施例并不对此进行限定,例如,如果虚拟通道数目小于256,只使用LUN地址字段的一个高位字节就可以实现对虚拟通道的标识的记录。
S704:所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址。
在本发明实施例的一种可能的实现方式中,所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
其中,每一个虚拟通道内部的虚拟地址都是唯一的,不同虚拟通道内部的地址可以重复,存储设备目标器根据虚拟地址和虚拟通道的标识能够唯一的确定待访问的存储区域的物理地址。因为在确定待访问的存储区域的物理地址的时候是依据虚拟通道的标识和虚拟地址共同确定,即使不同物理机上运行的虚拟机的虚拟机标识相同,因为虚拟机对应的虚拟通道是唯一的,存储设备目标器任然能够根据虚拟通道的标识和虚拟地址,唯一的确定物理地址。
在具体实现过程中,存储设备目标器可以将虚拟机内部的虚拟LUN映射为实际的物理LUN。
在本发明实施例的一种可能的实现方式中,所述存储设备目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述存储
设备目标器获取所述访问指令之后,进一步包括:所述存储设备目标器将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列;所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址之前,进一步包括:所述存储设备目标器从所述虚拟机的虚拟通道对应的第二缓存队列中取出所述访问指令。
可选的,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据所述至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
可选的,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
应了解,以上存储设备目标器按照优先级或按照获取时间的先后顺序,分别处理接收到的多个访问指令的方式,仅仅是举例说明,本发明实施例并不对存储设备目标器处理接收到的访问指令的处理顺序进行限定。
S706:所述存储设备目标器根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作。
在具体实现过程中,如果所述访问指令为数据写指令,所述存储设备目标器向物理地址指示的存储区域中写入待写入的数据;如果所述访问指令为数据读指令,所述存储设备目标器从物理地址指示的存储区域中读取待读取的数据。
可选的,所述存储设备目标器根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作之后,进一步包括:所述存储设备目标器返回反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识。
应了解,图7实施例为图5实施例的存储设备目标器侧的方法,图5实施例部分的特征描述适用于图7实施例,在此不再赘述。
根据本发明实施例公开的技术方案,通过建立虚拟机与存储设备之间的虚拟通道,并在访问指令中携带对应的虚拟通道的标识,使存储设备目标器能够根据虚拟地址信息和虚拟机的虚拟通道的标识唯一的确定待访问区域的物理地址,从而实现了虚拟机对存储设备的直接访问,简化了存储设备的访问方法,缩减了I/O访问流程,减少了软件层对内存资源和计算资源的消耗。
图8为依据本发明一实施例的存储设备访问装置800的逻辑结构示意图,装置800用于管理运行在计算机系统上的虚拟机对存储设备的访问操作,如图8所示,装置800包含获取单元802、生成单元804和发送单元806,其中,
获取单元802,用于获取获取来自虚拟机的访问请求,所述访问请求中携带待访问的存储区域的虚拟地址信息;
生成单元804,用于根据所述访问请求生成访问指令,所述访问指令中携带所述虚拟地址信息和该虚拟机的虚拟通道的标识,所述虚拟通道用于连接所述虚拟机与存储设备目标器,虚拟机与虚拟通道一一对应,所述存储设备目标器用于管理对所述存储设备的访问操作
发送单元806,用于将所述访问指令发送给所述存储设备目标器。
具体的,所述生成单元804根据所述访问请求生成访问指令之前,还用于:根据所述虚拟机的标识查询预设的第一对应关系,确定所述虚拟通道的标识,其中,所述第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
可选的,所述装置800配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述获取单元802获取来自所述虚拟机的所述访问请求之后,还用于:将所述访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列;生成单元804根据所述访问请求生成所述访问指令之前,还用于:从所述虚拟机的虚拟通道对应的第一缓存队列中取出所述访问请求。
可选的,若所述获取单元802获取到来自至少两个虚拟机的至少两个访问请求,所述生成单元804用于根据所述访问请求生成访问指令,包括:
所述生成单元804用于根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
可选的,若所述获取单元802获取到来自至少两个虚拟机的至少两个访问请求,所述生成单元804用于根据所述访问请求生成访问指令,包括:所述生成单元804用于根据获取到所述至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
在本发明实施例的一种可能的实现方式中,所述发送单元806将所述访问指令发送给所述存储设备目标器之后,所述获取单元802还用于:获取来自所述存储设备目标器的反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识;所述发送单元806还用于:根据所述虚拟通道的标识确定所述虚拟机,并将所述访问指令的执行结果发送给所述虚拟机。
在本发明实施例的一种可能的实现方式中,所述获取单元802用于获取来自虚拟机的访问请求,包括:所述获取单元802用于接收来自所述虚拟机的第一门铃通知,并从与所述虚拟机共用的I/O共享环中获取所述访问请求,所述访问请求由所述虚拟机放入所述I/O共享环,所述第一门铃通知用于指示所述I/O共享环有访问请求到达;所述发送单元806用于将所述访问指令的执行结果发送给所述虚拟机,包括:所述发送单元806用于将所述访问请求的执行结果放入与所述虚拟机共用的I/O共享环,并向所述虚拟机发送第二门铃通知,所述第二门铃通知用于指示所述I/O共享环有执行结果到达。
具体实现过程中,在图2所示的200(a)的场景下,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;所述发送单元806用于将所述访问指令发送给所述存储设备目标器,包括:所述发送单元806用于通过所述主机总线适配器驱动层将所述访问指令发送给所述存储设备目标器。
本发明实施例与图6的方法实施例相对应,图5及图6实施例部分的特征描述,适用于本发明实施例,在此不再赘述。
图9为依据本发明一实施例的存储设备访问装置900的逻辑结构示意图,装置900用于管理虚拟机对存储设备的访问操作,如图9所示,装置900包含获取单元902、确定单元904和处理单元906,其中,
获取单元902,用于获取访问指令,所述访问指令中携带虚拟地址信息和虚拟机的虚拟通道的标识,所述虚拟通道用于连接所述虚拟机与所述装置,虚拟机与虚拟通道一一对应,所述虚拟地址信息用于表示待访问的存储区域在所述虚拟机中的虚拟地址;
确定单元904,用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址;
处理单元906,用于根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作。
具体的,所述确定单元904用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元904用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
可选的,所述装置配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述获取单元902获取所述访问指令之后之后,还用于:将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列;所述确定单元904确定所述待访问的存储区域在所述存储设备中的物理地址之前,还用于:从所述虚拟机的虚拟通道对应的第二缓存队列中取出所述访问指令。
可选的,若所述获取单元902获取到来自至少两个虚拟机的至少两个访问指令,所述确定单元904用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元904用于根据所述至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级
低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
可选的,若所述获取单元902获取到来自至少两个虚拟机的至少两个访问指令,所述确定单元904用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元904用于根据所述获取单元902获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
在本发明实施例的一种实现方式中,所述处理单元906根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作之后,还用于:返回反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识。
本发明实施例与图7的方法实施例相对应,图5及图7实施例部分的特征描述,适用于本发明实施例,在此不再赘述。
图10是依据本发明一实施例的存储设备访问装置1000的硬件结构示意图。如图10所示,装置1000包括处理器1002、存储器1004、输入/输出接口1006、通信接口1008和总线1010。其中,处理器1002、存储器1004、输入/输出接口1006和通信接口1008通过总线1010实现彼此之间的通信连接。
处理器1002可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application SQecific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本发明实施例所提供的技术方案。
存储器1004可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器1004可以存储操作系统和其他应用程序。在通过软件或者固件来实现本发明实施例提供的技术方案时,用于实现本发明实施例提供的技术方案的程序代码保存在存储器1004中,并由处理器1002来执行。
输入/输出接口1006用于接收输入的数据和信息,输出操作结果等数据。
通信接口1008使用例如但不限于收发器一类的收发装置,来实现装置
1000与其他设备或通信网络之间的通信。
总线1010可包括一通路,在装置1000各个部件(例如处理器1002、存储器1004、输入/输出接口1006和通信接口1008)之间传送信息。
应注意,尽管图10所示的装置1000仅仅示出了处理器1002、存储器1004、输入/输出接口1006、通信接口1008以及总线1010,但是在具体实现过程中,本领域的技术人员应当明白,装置1000还包含实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当明白,装置1000还可包含实现其他附加功能的硬件器件。此外,本领域的技术人员应当明白,装置1000也可仅仅包含实现本发明实施例所必须的器件,而不必包含图10中所示的全部器件。
图10所示的硬件结构以及上述描述适用于本发明实施例所提供的各种存储设备访问装置和系统,适用于执行本发明实施例所提供的各种存储设备访问方法。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若
干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:移动硬盘、只读存储器(英文:Read-Only Memory,简称ROM)、随机存取存储器(英文:Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。
Claims (45)
- 一种存储设备访问方法,其特征在于,应用于计算机系统,所述计算机系统上运行有虚拟机,所述计算机系统上还配置有I/O适配器,包括:所述I/O适配器获取来自虚拟机的访问请求,所述访问请求中携带待访问的存储区域的虚拟地址信息;所述I/O适配器根据所述访问请求生成访问指令,所述访问指令中携带所述虚拟地址信息和所述虚拟机的虚拟通道的标识,其中,所述虚拟通道用于连接所述虚拟机与存储设备目标器,所述虚拟机与所述虚拟通道一一对应,所述存储设备目标器用于管理对所述存储设备的访问操作;所述I/O适配器将所述访问指令发送给所述存储设备目标器。
- 根据权利要求1所述的方法,其特征在于,所述I/O适配器根据所述访问请求生成访问指令之前,进一步包括:所述I/O适配器根据所述虚拟机的标识查询预设的第一对应关系,确定所述虚拟通道的标识,其中,所述第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
- 根据权利要求1或2所述的方法,其特征在于,所述I/O适配器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述I/O适配器获取来自所述虚拟机的所述访问请求之后,进一步包括:所述I/O适配器将所述虚拟机的访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列。
- 根据权利要求1-3任一项所述的方法,其特征在于,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器根据所述访问请求生成访问指令,包括:所述I/O适配器根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
- 根据权利要求1-3任一项所述的方法,其特征在于,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器根据所述访问请求生成访问指令,包括:所述I/O适配器根据获取到所述至 少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
- 根据权利要求1-5任一项所述的方法,其特征在于,所述I/O适配器将所述访问指令发送给所述存储设备目标器之后,进一步包括:所述I/O适配器获取来自所述存储设备目标器的反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识;所述I/O适配器根据所述虚拟通道的标识确定所述虚拟机,并将所述访问指令的执行结果发送给所述虚拟机。
- 根据权利要求6所述的方法,其特征在于,所述I/O适配器获取来自虚拟机的访问请求,包括:所述I/O适配器接收来自所述虚拟机的第一门铃通知,并从与所述虚拟机共用的I/O共享环中获取所述访问请求,所述访问请求由所述虚拟机放入所述I/O共享环,所述第一门铃通知用于指示所述I/O共享环有访问请求到达;所述I/O适配器将所述访问指令的执行结果发送给所述虚拟机,包括:所述I/O适配器将所述访问请求的执行结果放入与所述虚拟机共用的I/O共享环,并向所述虚拟机发送第二门铃通知,所述第二门铃通知用于指示所述I/O共享环有执行结果到达。
- 根据权利要求1-7任一项所述的方法,其特征在于,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;所述I/O适配器将所述访问指令发送给所述存储设备目标器,包括:所述I/O适配器通过所述主机总线适配器驱动层将所述访问指令发送给所述存储设备目标器。
- 一种存储设备访问方法,其特征在于,包括:存储设备目标器获取访问指令,所述访问指令中携带虚拟地址信息和虚拟机的虚拟通道的标识,所述虚拟通道用于连接所述虚拟机与所述存储设备目标器,所述虚拟机与所述虚拟通道一一对应,所述虚拟地址信息用于表示待访问的存储区域在所述虚拟机中的虚拟地址;所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址;所述存储设备目标器根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作。
- 根据权利要求9所述的方法,其特征在于,所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
- 根据权利要求9或10所述的方法,其特征在于,所述存储设备目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述存储设备目标器获取所述访问指令之后,进一步包括:所述存储设备目标器将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列。
- 根据权利要求9-11任一项所述的方法,其特征在于,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据所述至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求9-11任一项所述的方法,其特征在于,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器根据获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求9-13任一项所述的方法,其特征在于,所述存储 设备目标器根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作之后,进一步包括:所述存储设备目标器返回反馈消息,所述反馈消息包括所述访问指令的执行结果和所述虚拟机的虚拟通道的标识。
- 一种存储设备访问装置,其特征在于,应用于计算机系统,所述计算机系统上运行有虚拟机,包括:获取单元,用于获取获取来自虚拟机的访问请求,所述访问请求中携带待访问的存储区域的虚拟地址信息;生成单元,用于根据所述访问请求生成访问指令,所述访问指令中携带所述虚拟地址信息和所述虚拟机的虚拟通道的标识,其中,所述虚拟通道用于连接所述虚拟机与存储设备目标器,所述虚拟机与所述虚拟通道一一对应,所述存储设备目标器用于管理对所述存储设备的访问操作;发送单元,用于将所述访问指令发送给所述存储设备目标器。
- 根据权利要求15所述的装置,其特征在于,所述生成单元根据所述访问请求生成访问指令之前,还用于:根据所述虚拟机的标识查询预设的第一对应关系,确定所述虚拟通道的标识,其中,所述第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
- 根据权利要求15或16所述的装置,其特征在于,所述装置配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述获取单元获取来自所述虚拟机的所述访问请求之后,还用于:将所述访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列。
- 根据权利要求15-17任一项所述的装置,其特征在于,若所述获取单元获取到来自至少两个虚拟机的至少两个访问请求,所述生成单元用于根据所述访问请求生成访问指令,包括:所述生成单元用于根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
- 根据权利要求15-17任一项所述的装置,其特征在于,若所述获取单元获取到来自至少两个虚拟机的至少两个访问请求,所述生成单元用于根据所述访问请求生成访问指令,包括:所述生成单元用于根据获取到 所述至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
- 根据权利要求15-19任一项所述的装置,其特征在于,所述发送单元将所述访问指令发送给所述存储设备目标器之后,所述获取单元还用于:获取来自所述存储设备目标器的所述访问指令的反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识;所述发送单元还用于:根据所述虚拟通道的标识确定所述虚拟机,并将所述访问指令的执行结果发送给所述虚拟机。
- 根据权利要求20所述的装置,其特征在于,所述获取单元用于获取来自虚拟机的访问请求,包括:所述获取单元用于接收来自所述虚拟机的第一门铃通知,并从与所述虚拟机共用的I/O共享环中获取所述访问请求,所述访问请求由所述虚拟机放入所述I/O共享环,所述第一门铃通知用于指示所述I/O共享环有访问请求到达;所述发送单元用于将所述访问指令的执行结果发送给所述虚拟机,包括:所述发送单元用于将所述访问请求的执行结果放入与所述虚拟机共用的I/O共享环,并向所述虚拟机发送第二门铃通知,所述第二门铃通知用于指示所述I/O共享环有执行结果到达。
- 根据权利要求15-21任一项所述的装置,其特征在于,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;所述发送单元用于将所述访问指令发送给所述存储设备目标器,包括:所述发送单元用于通过所述主机总线适配器驱动层将所述访问指令发送给所述存储设备目标器。
- 一种存储设备访问装置,其特征在于,用于管理虚拟机对存储设备的访问操作,包括:获取单元,用于获取访问指令,所述访问指令中携带虚拟地址信息和所述虚拟机的虚拟通道的标识,所述虚拟通道用于连接虚拟机与所述装置,所述虚拟机与所述虚拟通道一一对应,所述虚拟地址信息用于表示待访问的存储区域在所述虚拟机中的虚拟地址;确定单元,用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址;处理单元,用于根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作。
- 根据权利要求23所述的装置,其特征在于,所述确定单元用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
- 根据权利要求23或24所述的装置,其特征在于,所述装置配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述获取单元获取所述访问指令之后之后,还用于:将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列之前。
- 根据权利要求23-25任一项所述的装置,其特征在于,若所述获取单元获取到来自至少两个虚拟机的至少两个访问指令,所述确定单元用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元用于根据所述至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求23-25任一项所述的装置,其特征在于,若所述获取单元获取到来自至少两个虚拟机的至少两个访问指令,所述确定单元用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述确定单元用于根据所述获取单元获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求23-27任一项所述的装置,其特征在于,所述处理单元根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作之后,还用于:返回反馈消息, 所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识。
- 一种存储设备访问系统,其特征在于,包括I/O适配器和存储设备目标器,所述I/O适配器用于获取来自虚拟机的访问请求,所述访问请求中携带待访问的存储区域的虚拟地址信息,根据所述访问请求生成访问指令,并将所述访问指令发送给所述存储设备目标器,所述访问指令中携带所述虚拟地址信息和所述虚拟机的虚拟通道的标识,所述虚拟通道用于连接所述虚拟机与存储设备目标器,所述虚拟机与所述虚拟通道一一对应;所述存储设备目标器用于获取所述访问指令,根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,并根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作。
- 根据权利要求29所述的系统,其特征在于,所述I/O适配器根据所述访问请求生成访问指令之前,还用于:根据所述虚拟机的标识查询预设的第一对应关系,确定所述虚拟通道的标识,其中,所述第一对应关系包括每台虚拟机的标识与每个虚拟通道的标识的对应关系。
- 根据权利要求29或30所述的系统,其特征在于,所述I/O适配器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述I/O适配器获取来自所述虚拟机的所述访问请求之后,还用于:将所述访问请求放入所述虚拟机的虚拟通道对应的第一缓存队列。
- 根据权利要求29-31任一项所述的系统,其特征在于,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器用于根据所述访问请求生成访问指令,包括:所述I/O适配器用于根据所述至少两个访问请求对应的至少两个虚拟机的优先级,按照优先级顺序先生成优先级高的虚拟机对应的访问指令,再生成优先级低的虚拟机对应的访问指令。
- 根据权利要求29-31任一项所述的系统,其特征在于,若所述I/O适配器获取到来自至少两个虚拟机的至少两个访问请求,所述I/O适配器用于根据所述访问请求生成访问指令,包括:所述I/O适配器用于根据获 取到所述至少两个访问请求的时间先后顺序,先生成先接收到的访问请求对应的访问指令,再生成后接收到的访问请求对应的访问指令。
- 根据权利要求29-33任一项所述的系统,其特征在于,所述I/O适配器将所述访问指令发送给所述存储设备目标器之后,还用于:获取来自所述存储设备目标器的反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识;所述I/O适配器根据所述虚拟通道的标识确定所述虚拟机,并将所述访问指令的执行结果发送给所述虚拟机。
- 根据权利要求34所述的系统,其特征在于,所述I/O适配器用于获取来自虚拟机的访问请求,包括:所述I/O适配器用于接收来自所述虚拟机的第一门铃通知,并从与所述虚拟机共用的I/O共享环中获取所述访问请求,所述访问请求由所述虚拟机放入所述I/O共享环,所述第一门铃通知用于指示所述I/O共享环有访问请求到达;所述I/O适配器用于将所述访问指令的执行结果发送给所述虚拟机,包括:所述I/O适配器用于将所述访问请求的执行结果放入与所述虚拟机共用的I/O共享环,并向所述虚拟机发送第二门铃通知,所述第二门铃通知用于指示所述I/O共享环有执行结果到达。
- 根据权利要求29-35任一项所述的系统,其特征在于,所述访问指令为主机总线适配器驱动层可处理的小型计算机系统接口SCSI指令;所述I/O适配器用于将所述访问指令发送给所述存储设备目标器,包括:所述I/O适配器用于通过所述主机总线适配器驱动层将所述访问指令发送给所述存储设备目标器。
- 根据权利要求29所述的系统,其特征在于,所述存储设备目标器用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器用于根据所述访问指令中携带的虚拟地址信息和所述虚拟通道的标识,查询预设的第二对应关系,确定所述待访问的存储区域在所述存储设备中的物理地址,其中,所述第二对应关系包括每个虚拟通道的标识与为所述每个虚拟通道分配的存储区域的物理地址的对应关系。
- 根据权利要求29或37所述的系统,其特征在于,所述存储设备 目标器配置有至少一个缓存队列,每个缓存队列与每个虚拟通道一一对应;所述存储设备目标器获取所述访问指令之后,还用于:将所述访问指令放入所述虚拟机的虚拟通道对应的第二缓存队列。
- 根据权利要求29或37或38所述的系统,其特征在于,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器用于根据所述至少两个访问指令对应的至少两个虚拟机的优先级,按照优先级顺序先确定优先级高的虚拟机的待访问的存储区域在所述存储设备中的物理地址,再确定优先级低的虚拟机的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求29或37或38所述的系统,其特征在于,若所述存储设备目标器获取到来自至少两个虚拟机的至少两个访问指令,所述存储设备目标器用于确定所述待访问的存储区域在所述存储设备中的物理地址,包括:所述存储设备目标器用于根据获取到所述至少两个访问指令的时间先后顺序,先确定先接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址,再确定后接收到的访问指令对应的待访问的存储区域在所述存储设备中的物理地址。
- 根据权利要求29或37-40任一项所述的系统,其特征在于,所述存储设备目标器根据所述访问指令和所述待访问的存储区域在所述存储设备中的物理地址,对所述待访问的存储区域进行操作之后,还用于:返回反馈消息,所述反馈消息包含所述访问指令的执行结果和所述虚拟机的虚拟通道的标识。
- 一种计算机可读介质,其特征在于,包括计算机执行指令,当计算机的处理器执行所述计算机执行指令时,所述计算机执行权利要求1-8任一项所述的方法。
- 一种存储设备访问装置,其特征在于,包括:处理器、存储器、总线和通信接口;所述存储器用于存储执行指令,所述处理器与所述存储器通过所述总线连接,当所述存储设备访问转置运行时,所述处理器执行所述存储器存 储的所述执行指令,以使所述装置执行权利要求1-8任一项所述的方法。
- 一种计算机可读介质,其特征在于,包括计算机执行指令,当计算机的处理器执行所述计算机执行指令时,所述计算机执行权利要求9-14任一项所述的方法。
- 一种存储设备访问装置,其特征在于,包括:处理器、存储器、总线和通信接口;所述存储器用于存储执行指令,所述处理器与所述存储器通过所述总线连接,当所述存储设备访问装置运行时,所述处理器执行所述存储器存储的所述执行指令,以使所述装置执行权利要求9-14任一项所述的方法。
Priority Applications (6)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2015/092457 WO2017066944A1 (zh) | 2015-10-21 | 2015-10-21 | 一种存储设备访问方法、装置和系统 |
| EP15906462.5A EP3206124B1 (en) | 2015-10-21 | 2015-10-21 | Method, apparatus and system for accessing storage device |
| CN202010517281.3A CN111831588B (zh) | 2015-10-21 | 2015-10-21 | 一种存储设备访问方法、装置和系统 |
| CN201580002150.9A CN107209681B (zh) | 2015-10-21 | 2015-10-21 | 一种存储设备访问方法、装置和系统 |
| US15/666,306 US10713074B2 (en) | 2015-10-21 | 2017-08-01 | Method, apparatus, and system for accessing storage device |
| US16/878,365 US20200278880A1 (en) | 2015-10-21 | 2020-05-19 | Method, apparatus, and system for accessing storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2015/092457 WO2017066944A1 (zh) | 2015-10-21 | 2015-10-21 | 一种存储设备访问方法、装置和系统 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US15/666,306 Continuation US10713074B2 (en) | 2015-10-21 | 2017-08-01 | Method, apparatus, and system for accessing storage device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017066944A1 true WO2017066944A1 (zh) | 2017-04-27 |
Family
ID=58556590
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/092457 Ceased WO2017066944A1 (zh) | 2015-10-21 | 2015-10-21 | 一种存储设备访问方法、装置和系统 |
Country Status (4)
| Country | Link |
|---|---|
| US (2) | US10713074B2 (zh) |
| EP (1) | EP3206124B1 (zh) |
| CN (2) | CN111831588B (zh) |
| WO (1) | WO2017066944A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108536515A (zh) * | 2018-03-02 | 2018-09-14 | 武汉噢易云计算股份有限公司 | Vdi的虚拟机播放客户机的音乐cd的方法及系统 |
| CN113765908A (zh) * | 2021-09-01 | 2021-12-07 | 南京炫佳网络科技有限公司 | 一种数据获取方法、装置、设备及存储介质 |
Families Citing this family (28)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11036533B2 (en) | 2015-04-17 | 2021-06-15 | Samsung Electronics Co., Ltd. | Mechanism to dynamically allocate physical storage device resources in virtualized environments |
| US10838852B2 (en) | 2015-04-17 | 2020-11-17 | Samsung Electronics Co., Ltd. | System and method to extend NVME queues to user space |
| CN111831234B (zh) * | 2016-06-21 | 2024-04-23 | 伊姆西Ip控股有限责任公司 | 用于虚拟机的方法和装置 |
| US11693792B2 (en) | 2018-01-04 | 2023-07-04 | Google Llc | Infernal storage in cloud disk to support encrypted hard drive and other stateful features |
| CN109117247B (zh) * | 2018-07-18 | 2021-12-07 | 上海交通大学 | 一种基于异构多核拓扑感知的虚拟资源管理系统及方法 |
| US11429419B2 (en) * | 2018-08-03 | 2022-08-30 | Nvidia Corporation | Secure access of virtual machine memory suitable for AI assisted automotive applications |
| CN109240802B (zh) | 2018-09-21 | 2022-02-18 | 北京百度网讯科技有限公司 | 请求处理方法和装置 |
| US10802974B2 (en) * | 2018-10-15 | 2020-10-13 | Texas Instruments Incorporated | Virtual network pre-arbitration for deadlock avoidance and enhanced performance |
| CN109684029A (zh) * | 2018-11-02 | 2019-04-26 | 新华三云计算技术有限公司 | 存储内容访问方法、装置、电子设备及计算机存储介质 |
| CN109857519B (zh) * | 2019-01-15 | 2021-05-07 | 新华三云计算技术有限公司 | 虚拟磁盘的处理方法及相关装置 |
| US12353364B2 (en) * | 2019-07-18 | 2025-07-08 | Pure Storage, Inc. | Providing block-based storage |
| US11379246B2 (en) * | 2019-07-24 | 2022-07-05 | EMC IP Holding Company LLC | Automatic configuration of multiple virtual storage processors |
| CN110633055B (zh) * | 2019-09-18 | 2023-05-16 | 东软集团股份有限公司 | 一种访问rpmb分区的方法、装置及相关设备 |
| CN111290829B (zh) * | 2020-01-15 | 2023-05-02 | 海光信息技术股份有限公司 | 访问控制模组、虚拟机监视器及访问控制方法 |
| CN111737176B (zh) * | 2020-05-11 | 2022-07-15 | 瑞芯微电子股份有限公司 | 一种基于pcie数据的同步装置及驱动方法 |
| CN112199309B (zh) * | 2020-10-10 | 2022-03-15 | 北京泽石科技有限公司 | 基于dma引擎的数据读取方法、装置和数据传输系统 |
| CN112527698B (zh) * | 2020-12-04 | 2024-03-22 | 联想(北京)有限公司 | 一种处理方法、装置及设备 |
| CN112732269B (zh) * | 2021-01-15 | 2024-05-24 | 北京博雅慧视智能技术研究院有限公司 | 一种应用于avs2硬件编码器的物理地址的访问方法及装置 |
| CN113365105B (zh) * | 2021-06-30 | 2022-12-06 | 北京奇艺世纪科技有限公司 | 一种内容生产控制方法、装置、设备及存储介质 |
| CN114185650B (zh) * | 2021-12-14 | 2023-07-25 | 平安壹账通云科技(深圳)有限公司 | Linux系统下识别SCSI设备的方法、系统、设备及存储介质 |
| CN114546896A (zh) * | 2022-02-22 | 2022-05-27 | 杭州中天微系统有限公司 | 系统内存管理单元、读写请求处理方法、电子设备和片上系统 |
| CN114637609B (zh) * | 2022-05-20 | 2022-08-12 | 沐曦集成电路(上海)有限公司 | 基于冲突检测的gpu的数据获取系统 |
| CN115278211B (zh) * | 2022-06-29 | 2025-03-28 | 深圳市辰卓科技有限公司 | 图像处理方法、装置、系统及图像采集设备 |
| CN115185880B (zh) * | 2022-09-09 | 2022-12-09 | 南京芯驰半导体科技有限公司 | 一种数据存储方法及装置 |
| CN115933975B (zh) * | 2022-11-28 | 2025-12-05 | 阿里云计算有限公司 | 数据处理方法、计算设备及计算机系统 |
| CN116028164B (zh) * | 2023-03-29 | 2023-06-20 | 阿里云计算有限公司 | 设备虚拟化方法以及装置 |
| CN116774933A (zh) * | 2023-06-19 | 2023-09-19 | 北京火山引擎科技有限公司 | 存储设备的虚拟化处理方法、桥接设备、系统及介质 |
| CN117331702A (zh) * | 2023-10-31 | 2024-01-02 | 中科驭数(北京)科技有限公司 | 请求分配方法、装置、电子设备及存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102426557A (zh) * | 2011-10-27 | 2012-04-25 | 中国科学院计算技术研究所 | 虚拟化环境中 pci 设备的分离访问方法及其系统 |
| CN102662869A (zh) * | 2012-04-01 | 2012-09-12 | 龙芯中科技术有限公司 | 虚拟机中的内存访问方法和装置及查找器 |
| US20130152086A1 (en) * | 2011-12-09 | 2013-06-13 | Jung-hyun Yoo | Apparatus and method for managing virtual memory |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5890220A (en) * | 1991-02-05 | 1999-03-30 | Hitachi, Ltd. | Address conversion apparatus accessible to both I/O devices and processor and having a reduced number of index buffers |
| US5996026A (en) * | 1995-09-05 | 1999-11-30 | Hitachi, Ltd. | Method and apparatus for connecting i/o channels between sub-channels and devices through virtual machines controlled by a hypervisor using ID and configuration information |
| US20050080982A1 (en) * | 2003-08-20 | 2005-04-14 | Vasilevsky Alexander D. | Virtual host bus adapter and method |
| JP4733399B2 (ja) * | 2005-01-28 | 2011-07-27 | 株式会社日立製作所 | 計算機システム、計算機、ストレージ装置及び管理端末 |
| US7689800B2 (en) * | 2005-05-12 | 2010-03-30 | Microsoft Corporation | Partition bus |
| US8095675B2 (en) * | 2006-07-20 | 2012-01-10 | Oracle America, Inc. | Priority and bandwidth specification at mount time of NAS device volume |
| US8966476B2 (en) * | 2008-05-28 | 2015-02-24 | Hewlett-Packard Development Company, L.P. | Providing object-level input/output requests between virtual machines to access a storage subsystem |
| US9389895B2 (en) * | 2009-12-17 | 2016-07-12 | Microsoft Technology Licensing, Llc | Virtual storage target offload techniques |
| US8612633B2 (en) * | 2010-03-31 | 2013-12-17 | Microsoft Corporation | Virtual machine fast emulation assist |
| CN103793330B (zh) * | 2012-10-31 | 2017-03-01 | 国际商业机器公司 | 在虚拟机环境中进行数据交换的方法和装置 |
| US9052835B1 (en) * | 2013-12-20 | 2015-06-09 | HGST Netherlands B.V. | Abort function for storage devices by using a poison bit flag wherein a command for indicating which command should be aborted |
| US20150237140A1 (en) * | 2014-02-14 | 2015-08-20 | Tenoware R&D Limited | Data storage systems and methods |
| KR101699377B1 (ko) * | 2014-07-02 | 2017-01-26 | 삼성전자주식회사 | 불휘발성 메모리 및 메모리 컨트롤러를 포함하는 스토리지 장치 및 스토리지 장치의 동작 방법 |
| US10838852B2 (en) * | 2015-04-17 | 2020-11-17 | Samsung Electronics Co., Ltd. | System and method to extend NVME queues to user space |
-
2015
- 2015-10-21 EP EP15906462.5A patent/EP3206124B1/en active Active
- 2015-10-21 WO PCT/CN2015/092457 patent/WO2017066944A1/zh not_active Ceased
- 2015-10-21 CN CN202010517281.3A patent/CN111831588B/zh active Active
- 2015-10-21 CN CN201580002150.9A patent/CN107209681B/zh active Active
-
2017
- 2017-08-01 US US15/666,306 patent/US10713074B2/en active Active
-
2020
- 2020-05-19 US US16/878,365 patent/US20200278880A1/en not_active Abandoned
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102426557A (zh) * | 2011-10-27 | 2012-04-25 | 中国科学院计算技术研究所 | 虚拟化环境中 pci 设备的分离访问方法及其系统 |
| US20130152086A1 (en) * | 2011-12-09 | 2013-06-13 | Jung-hyun Yoo | Apparatus and method for managing virtual memory |
| CN102662869A (zh) * | 2012-04-01 | 2012-09-12 | 龙芯中科技术有限公司 | 虚拟机中的内存访问方法和装置及查找器 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108536515A (zh) * | 2018-03-02 | 2018-09-14 | 武汉噢易云计算股份有限公司 | Vdi的虚拟机播放客户机的音乐cd的方法及系统 |
| CN108536515B (zh) * | 2018-03-02 | 2021-10-01 | 武汉噢易云计算股份有限公司 | Vdi的虚拟机播放客户机的音乐cd的方法及系统 |
| CN113765908A (zh) * | 2021-09-01 | 2021-12-07 | 南京炫佳网络科技有限公司 | 一种数据获取方法、装置、设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107209681B (zh) | 2020-07-07 |
| EP3206124A4 (en) | 2018-01-10 |
| US10713074B2 (en) | 2020-07-14 |
| EP3206124B1 (en) | 2020-01-08 |
| CN107209681A (zh) | 2017-09-26 |
| US20200278880A1 (en) | 2020-09-03 |
| US20170329625A1 (en) | 2017-11-16 |
| CN111831588B (zh) | 2025-01-17 |
| EP3206124A1 (en) | 2017-08-16 |
| CN111831588A (zh) | 2020-10-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107209681B (zh) | 一种存储设备访问方法、装置和系统 | |
| CN109445905B (zh) | 虚拟机数据通信方法和系统以及虚拟机配置方法和装置 | |
| CN108243118B (zh) | 转发报文的方法和物理主机 | |
| US20220283964A1 (en) | Cross Address-Space Bridging | |
| US9086907B2 (en) | Apparatus and method for managing virtual machine addresses | |
| US8645594B2 (en) | Driver-assisted base address register mapping | |
| CN112306624B (zh) | 一种信息处理方法、物理机和pcie设备 | |
| US10474606B2 (en) | Management controller including virtual USB host controller | |
| US8930568B1 (en) | Method and apparatus for enabling access to storage | |
| CN106445628A (zh) | 一种虚拟化方法、装置和系统 | |
| EP2667296A1 (en) | Method and apparatus of data processing | |
| CN102968331A (zh) | 一种虚拟机管理系统及其文件访问方法 | |
| US20160224479A1 (en) | Computer system, and computer system control method | |
| CN103262034B (zh) | 将数据分区至虚拟机 | |
| CN111782318A (zh) | 远程挂载本地磁盘到云桌面虚拟机中共享访问系统及方法 | |
| JP7615474B2 (ja) | コンピューティングデバイス及び割り込み処理方法 | |
| US20110246600A1 (en) | Memory sharing apparatus | |
| WO2023174146A1 (zh) | 卸载卡命名空间管理、输入输出请求处理系统和方法 | |
| CN105556473A (zh) | 一种i/o任务处理的方法、设备和系统 | |
| CN106598696A (zh) | 一种虚拟机之间数据交互的方法及装置 | |
| US11003618B1 (en) | Out-of-band interconnect control and isolation | |
| CN110704163A (zh) | 一种服务器及其虚拟化存储方法和装置 | |
| US20220137998A1 (en) | Storage virtualization device supporting virtual machine, operation method thereof, and operation method of system having the same | |
| CN117971135B (zh) | 存储设备的访问方法、装置、存储介质和电子设备 | |
| US11601515B2 (en) | System and method to offload point to multipoint transmissions |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| REEP | Request for entry into the european phase |
Ref document number: 2015906462 Country of ref document: EP |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15906462 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
