Universal Flash Storage (UFS) is a flash storage specification designed for digital cameras, mobile phones, and other consumer electronic devices. The goal of UFS is to provide higher data transfer speeds and increased reliability compared to other flash memory storage formats.
A virtual machine (VM) is like any other computer, complete with a CPU, memory, and storage. However, instead of being a physical device, a VM exists as software code. It runs within a window on the computer or server, separate from the host system. VMs are used for various purposes, such as testing new operating systems, running legacy applications, and creating isolated environments. They offer benefits like cost savings and portability.
Virtualization enables multiple virtual machines to run on a single physical machine, optimizing resource utilization and improving efficiency. Each virtual machine operates independently and remains isolated from other VMs and the host computer. VMs play a crucial role in server environments by centralizing workloads and enhancing the efficiency of resource use.
An embodiment provides a system. The system includes a host, a storage host controller, and a storage device. The host includes a hypervisor for running a first virtual machine and a second virtual machine. The storage host controller includes a plurality of first multi-circular queues (MCQs) assigned to the first virtual machine and a plurality of second MCQs assigned to the second virtual machine. The plurality of first MCQs assigned to the first virtual machine is used to control operations of the first virtual machine. The plurality of second MCQs assigned to the second virtual machine is used to control operations of the second virtual machine. The storage device has a first portion linked to the first virtual machine for being accessed by the first virtual machine, and a second portion linked to the second virtual machine for being accessed by the second virtual machine. The first portion and the second portion are isolated.
An embodiment provides a method for isolating a shared storage device for a first virtual machine and a second virtual machine. The method includes initiating a first request, by the first virtual machine, with a first identifier; initiating a second request, by the second virtual machine, with a second identifier; assigning a plurality of first multi-circular queues (MCQs) for the first virtual machine and a plurality of second MCQs for the second virtual machine; and isolating a first portion and a second portion in a storage device for the first virtual machine and the second virtual machine respectively according to the first identifier and the second identifier. The first portion and the second portion are not overlapped.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
In an embodiment, the plurality of multi-circular queues (MCQs) comprises first multi-circular queues (MCQs) assigned to the first virtual machine 102 and a plurality of second MCQs assigned to the second virtual machine 104. Each of the MCQs comprises a submission queue (SQ) or a completion queue (CQ). In some embodiment, each of the MCQs may comprise a plurality of SQs and CQs. The plurality of first MCQs include first SQs 118 and first CQs 120 assigned to the first virtual machine 102. The plurality of second MCQs include second SQs 124 and second CQs 126 assigned to the second virtual machine 104. The SQs 118, 124 are used for sending requests, and the CQs 120, 126 are used for receiving responses from the UFS device 122.
During operation, the first virtual machine 102 initiates a first request with a first initiator ID (IID) and a first logical block addressing and the second virtual machine initiates a second request with a second initiator ID and a second logical block addressing. In some case, the value of the first logical block addressing and that of the second logical block addressing may be the same. The first request and the second request may access the same logical block addressing in a storage device such as a UFS device 122 and it would cause the data to be overwritten. To avoid this situation, the UFS controller 115 may assign a first offset to the first logical block addressing and a second offset to the second logical block addressing when accessing to the UFS device 122. The first offset is different from the second offset to ensure a first portion of the UFS device 122 to be accessed by the first request corresponding to the first virtual machine 102 would be different from a second portion of the UFS device to be accessed by the second request corresponding to the second virtual machine 104.
Therefore, the first portion of a UFS device 122 is linked to the first virtual machine 102 for being accessed by the first virtual machine 102, and the second portion of the UFS device 122 is linked to the second virtual machine 104 for being accessed by the second virtual machine 104. The data storage regions for the first virtual machine 102 and the second virtual machine 104 are isolated by using a logical block address (LBA) offset assigned by the UFS host controller 115. For example, the LBA of the first request initiated by the first virtual machine 102 is 1000, and the LBA of the second request initiated by the second virtual machine 104 is 1000 as well.
The UFS host controller 112 may assign different offsets to LBAs of the first request and the second request according to initiator identifications (IIDs) or extended initiator identifications (Ext IIDs) which are corresponding to different virtual machines. In
In an embodiment, the plurality of multi-circular queues (MCQs) comprises first multi-circular queues (MCQs) assigned to the first virtual machine 102 and a plurality of second MCQs assigned to the second virtual machine 104. Each of the MCQs comprises a submission queue (SQ) or a completion queue (CQ).). In some embodiment, each of the MCQs may comprise a plurality of SQs and CQs. The plurality of first MCQs include first SQs 118 and first CQs 120 assigned to the first virtual machine 102. The plurality of second MCQs include second SQs 124 and second CQs 126 assigned to the second virtual machine 104. The SQs 118, 124 are used for sending requests, and the CQs 120, 126 are used for receiving responses from the UFS device 122.
During operation, the first virtual machine 102 initiates a first request with a first logical unit number (LUN) and a first logical block addressing and the second virtual machine initiates a second request with a second LUN and a second logical block addressing. In some case, the value of the first logical block addressing and that of the second logical block addressing may be the same. The first request and the second request may access the same logical block addressing in a storage device such as a UFS device 122 and it would cause the data to be overwritten. To avoid this situation, the UFS controller 115 may assign a first offset to the first logical block addressing and a second offset to the second logical block addressing when accessing to the UFS device 122. The first offset is different from the second offset to ensure a first portion of the UFS device 122 to be accessed by the first request corresponding to the first virtual machine 102 would be different from a second portion of the UFS device to be accessed by the second request corresponding to the second virtual machine 104.
A first portion of a UFS device 122 is linked to the first virtual machine 102 for being accessed by the first virtual machine 102, and a second portion of the UFS device 122 is linked to the second virtual machine 104 for being accessed by the second virtual machine 104. In an embodiment, a logical unit number (LUN) is assigned to each request initiated by each virtual machine by the host, to be specific, by the hypervisor 114. The logical unit number (LUN) is an identifier used in storage systems to distinguish between different logical units (such partitions) that are part of a storage device. By using different LUNs of the requests initiated by the virtual machines, the system make sure a first portion and a second portion of the UFS device 122 are isolated. In
In an embodiment, the plurality of multi-circular queues (MCQs) comprises first multi-circular queues (MCQs) assigned to the first virtual machine 102 for controlling operations of the first virtual machine 102 and a plurality of second MCQs assigned to the second virtual machine 104 for controlling operations of the second virtual machine 104. Each of the MCQs includes a submission queue (SQ) or a completion queue (CQ). The plurality of first MCQs include first SQs 118 and first CQs 120 assigned to the first virtual machine 102. The plurality of second MCQs include second SQs 124 and second CQs 126 assigned to the second virtual machine 104. The SQs 118, 124 are used for sending requests, and the CQs 120, 126 are used for receiving responses from the UFS device 122.
During operation, the first virtual machine 102 initiates a first request with a first tag number and a first logical block addressing and the second virtual machine initiates a second request with a second tag number and a second logical block addressing. In some case, the value of the first logical block addressing and that of the second logical block addressing may be the same. The first request and the second request may access the same logical block addressing in a storage device such as a UFS device 122 and it would cause the data to be overwritten. To avoid this situation, the UFS controller 115 may assign a first offset to the first logical block addressing and a second offset to the second logical block addressing when accessing to the UFS device 122. The first offset is different from the second offset to ensure a first portion of the UFS device 122 to be accessed by the first request corresponding to the first virtual machine 102 would be different from a second portion of the UFS device to be accessed by the second request corresponding to the second virtual machine 104.
Therefore, the first portion of a UFS device 122 is linked to the first virtual machine 102 for being accessed by the first virtual machine 102, and the second portion of the UFS device 122 is linked to the second virtual machine 104 for being accessed by the second virtual machine 104. The data storage regions for the first virtual machine 102 and the second virtual machine 104 are isolated by using a logical block address (LBA) offset. For example, the LBA of the first request initiated by the first virtual machine 102 is 1000, and the LBA of the second request initiated by the second virtual machine 104 is 1000 as well.
The UFS host controller 112 may assign different offsets to LBAs of the first request and the second request according to sections of tag numbers which are corresponding to the virtual machines 102, 104. In
In step S402, the first request is initiated by the first virtual machine 102 with the first identifier. In step S404, the second request is initiated by the second virtual machine 104 with the second identifier. In an embodiment, the first identifier can be an initial identification (IID), an extended initiator identification (Ext IID), a tag number and/or a logical unit number (LUN). The second identifier can be an initial identification (IID), an extended initiator identification (Ext IID), a tag number and/or a logical unit number (LUN). In step S406, a plurality of first MCQs is assigned for the first virtual machine 102 and a plurality of second MCQs is assigned for the second virtual machine 104. In an embodiment, the first MCQs can include first SQs 118 and first CQs 120, and the second MCQs can include second SQs 124 and second CQs 126. In step S408, a first portion and a second portion are isolated in a storage device for the first virtual machine 102 and the second virtual machine 104 respectively according to the first identifier and the second identifier. The first portion and the second portion are not overlapped. The data storage regions for the first virtual machine 102 and the second virtual machine 104 are isolated by using an LBA offset. For example, the LBA of the first request initiated by the first virtual machine 102 is 1000, and the LBA of the second request initiated by the second virtual machine 104 is 1000 as well. The UFS host controller 115 may assign different offsets to LBAs of the first request and the second request according to the first identifier and the second identifier. The LBA offset may be zero or a positive integer. For example, the LBA offset for the first virtual machine is 0, and the LBA offset for the second machine is X. X is a positive integer.
In conclusion, the embodiments of the present invention provide a UFS system which uses different IIDs, LUNs, or sections of tag numbers for directly accessing the UFS device by submission queues and completion queues, thus various virtual machines can be protected and distinguished.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application claims the benefit of U.S. Provisional Application No. 63/510,155, filed on Jun. 26, 2023. The content of the application is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
63510155 | Jun 2023 | US |