Resource management method and resource management system based on multi-tenant cloud storage

文档序号:1719600 发布日期:2019-12-17 浏览:15次 中文

阅读说明:本技术 一种基于多租户云存储的资源管理方法和资源管理系统 (Resource management method and resource management system based on multi-tenant cloud storage ) 是由 王芳 冯丹 刘家豪 朱挺炜 于 2018-06-07 设计创作,主要内容包括:本发明公开了一种基于多租户云存储的资源管理方法及管理系统,方法包括:得到每一个租户的租户性能需求,并对应地记录在租户所使用的虚拟机镜像文件的元数据内;为每一个虚拟机镜像文件的元数据添加一个令牌桶;在IO栈的页缓存层,获取被访问的虚拟机镜像文件的索引节点对象,并利用令牌桶算法对内存资源进行调度;在IO栈的文件系统层,将文件IO请求转换成对应的块IO请求;对于每一个文件IO请求,获取其所访问的虚拟机镜像文件的索引节点对象,从中获取租户性能需求并附加到由该文件IO请求转换得到的每一个块IO请求中;在IO栈的块层,从块IO请求中获取租户性能需求,并利用令牌桶算法对硬盘资源进行调度。本发明能够有效实现租户间的性能隔离。(The invention discloses a resource management method and a resource management system based on multi-tenant cloud storage, wherein the method comprises the following steps: acquiring the performance requirement of each tenant, and correspondingly recording the performance requirement in the metadata of the virtual machine image file used by the tenant; adding a token bucket to the metadata of each virtual machine image file; acquiring an index node object of an accessed virtual machine image file on a page cache layer of an IO stack, and scheduling memory resources by using a token bucket algorithm; converting the file IO request into a corresponding block IO request at a file system layer of an IO stack; for each file IO request, acquiring an index node object of a virtual machine image file accessed by the file IO request, acquiring tenant performance requirements from the index node object, and adding the tenant performance requirements to each block IO request converted by the file IO request; and acquiring tenant performance requirements from the block IO requests at a block layer of the IO stack, and scheduling the hard disk resources by using a token bucket algorithm. The invention can effectively realize the performance isolation among tenants.)

1. A resource management method based on multi-tenant cloud storage is characterized by comprising the following steps:

(1) According to the resource allocation strategy, acquiring the tenant performance requirements of each tenant, and correspondingly recording the tenant performance requirements of all tenants in the metadata of the virtual machine image file used by the tenant; adding a token bucket for the metadata of each virtual machine image file according to the performance requirements of tenants;

(2) On a page cache layer of an IO stack, acquiring an index node object of a virtual machine image file requested to be accessed by a file IO from a memory, and scheduling memory resources by using a token bucket algorithm; after scheduling is completed, transmitting the file IO request to a file system layer of an IO stack;

(3) converting each file IO request into a corresponding block IO request at a file system layer of an IO stack; for each file IO request, acquiring an index node object of a virtual machine image file accessed by the file IO request from a memory, acquiring a tenant performance requirement from the index node object, and adding the acquired tenant performance requirement to each block IO request converted by the file IO request; transmitting a block IO request carrying tenant performance requirements to a block layer of an IO stack;

(4) On a block layer of an IO stack, acquiring tenant performance requirements from block IO requests, and scheduling hard disk resources by using a token bucket algorithm;

The tenant performance requirements comprise a tenant mark and a performance mark, the tenant mark is used for uniquely identifying a tenant, and the performance mark is used for indicating that the corresponding tenant requires fixed throughput guarantee or minimum throughput guarantee; the IO stack is required for each level stage when the read-write request is processed in the multi-tenant cloud storage system, and comprises the following steps: a page cache layer, a file system layer and a block layer; the file IO request is an IO request for accessing a virtual machine image file, and the block IO request is a request for accessing a hard disk.

2. the multi-tenant cloud storage-based resource management method according to claim 1, wherein in the step (1), the tenant performance requirement is recorded in an inode object of an in-memory virtual machine image file.

3. the resource management method based on multi-tenant cloud storage according to claim 1, wherein in the step (1), according to tenant performance requirements, a rate of generating tokens for a token bucket added to metadata of each virtual machine image file is set according to the following rules:

if the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires a fixed throughput guarantee with a throughput rate of T, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is T; if the performance flag in the tenant performance requirement recorded in the metadata of the virtual machine image indicates that the tenant requires minimum throughput guarantee, the rate at which tokens are generated by the token bucket attached to the metadata of the virtual machine image is large enough to ensure that the token bucket is always full.

4. the resource management method based on multi-tenant cloud storage according to claim 1, wherein in the step (2), the memory resource is scheduled by using a token bucket algorithm in a page cache layer of an IO stack, and the method includes: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in the token bucket attached to the index node object of the virtual machine image file accessed by the file IO request is not enough to service the file IO request, the process initiating the file IO request sleeps until enough tokens are generated in the token bucket.

5. the resource management method based on multi-tenant cloud storage according to claim 1, wherein in the step (4), the hard disk resource is scheduled by using a token bucket algorithm according to the acquired tenant performance requirement at a block layer of an IO stack, and the method includes:

(41) an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same;

(42) creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment;

(43) Acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues and the IO queues with the tenant performance requirements requiring minimum throughput rate guarantee exist, distributing the remaining idle hard disk resources among the IO queues with the minimum throughput rate requirements in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates;

(44) traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly executing the step (44) after waiting for a preset time interval;

And the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue.

6. a resource management system based on multi-tenant cloud storage is characterized by comprising a control plane and a data plane;

The control plane includes: the tenant performance requirement generating module is used for obtaining the tenant performance requirement of each tenant according to the resource allocation strategy; the control interface is used for recording the performance requirements of all tenants in the metadata of the virtual machine image file used by the corresponding tenant; the cross-layer marking module is used for acquiring an index node object of the accessed virtual machine image file from a memory when the file IO request is converted into the block IO request in a file system layer of the IO stack, acquiring a tenant performance requirement from metadata of the index node object, and correspondingly adding the tenant performance requirement to each block IO request;

the data plane includes: the page cache scheduler is used for adding a token bucket to metadata of each virtual machine image file according to tenant performance requirements, acquiring an index node object of the virtual machine image file requested to be accessed by the file IO from a memory on a page cache layer of the IO stack, scheduling memory resources by using a token bucket algorithm, and transmitting the file IO request to a file system layer of the IO stack after scheduling is completed; the file system is used for converting the file IO request into a block IO request at a file system layer of the IO stack and transmitting the block IO request carrying the tenant performance requirement to the block layer; the block layer scheduler is used for acquiring tenant performance requirements from the block IO requests in the block layers of the IO stacks and scheduling the hard disk resources by using a token bucket algorithm according to the tenant performance requirements;

The tenant performance requirements comprise a tenant mark and a performance mark, the tenant mark is used for uniquely identifying a tenant, and the performance mark is used for indicating that the corresponding tenant requires fixed throughput guarantee or minimum throughput guarantee; the IO stack is required for each level stage when the read-write request is processed in the multi-tenant cloud storage system, and comprises the following steps: a page cache layer, a file system layer and a block layer; the file IO request is a request for accessing a virtual machine image file, and the block IO request is a request for accessing a hard disk resource.

7. the multi-tenant cloud storage-based resource management system of claim 6, wherein the control interface is to record tenant performance requirements in an inode object of an in-memory virtual machine image file.

8. the multi-tenant cloud storage-based resource management system of claim 6, wherein the rate at which the page cache scheduler generates tokens for the token bucket added for the metadata of each virtual machine image file according to tenant performance requirements is set according to the following rules:

If the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires a fixed throughput guarantee with a throughput rate of T, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is T; if the performance flag in the tenant performance requirement recorded in the metadata of the virtual machine image indicates that the tenant requires minimum throughput guarantee, the rate at which tokens are generated by the token bucket attached to the metadata of the virtual machine image is large enough to ensure that the token bucket is always full.

9. the resource management system based on multi-tenant cloud storage according to claim 6, wherein the page cache scheduler obtains, from a memory, an inode object of a virtual machine image file requested to be accessed by a file IO at a page cache layer of an IO stack, and schedules memory resources by using a token bucket algorithm, including: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in the token bucket attached to the index node object of the virtual machine image file accessed by the file IO request is not enough to service the file IO request, the process initiating the file IO request sleeps until enough tokens are generated in the token bucket.

10. the multi-tenant cloud storage-based resource management system of claim 6, wherein the block layer scheduler schedules hard disk resources at a block layer of an IO stack according to tenant performance requirements using a token bucket algorithm, comprising:

an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same;

creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment;

Acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues and the IO queues with the tenant performance requirements requiring minimum throughput rate guarantee exist, distributing the remaining idle hard disk resources among the IO queues with the minimum throughput rate requirements in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates;

traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly traversing all IO queues after waiting for a preset time interval so as to search the IO queues which can be served;

And the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue.

Technical Field

the invention belongs to the field of cloud storage, and particularly relates to a resource management method and a resource management system based on multi-tenant cloud storage.

background

More and more enterprises and users deploy loads in a cloud environment by renting virtual machines, which are stored in large files on shared storage servers connected via a network by cloud providers for simplicity of management and cost reduction. But sharing storage can create resource contention among tenants, thereby interfering with each other's performance.

In order to guarantee performance requirements of different tenants and achieve performance isolation among the tenants, most of the existing methods achieve resource management through IO scheduling on a Hypervisor layer, and some methods achieve resource management in cooperation with the Hypervisor and a storage server. The IO scheduling methods do not consider the influence of a file system at a storage server side, which results in that the use condition of the underlying storage resource cannot be known, for example, an IO request sent by a virtual machine reaches the storage server side, if the request is served by a page cache, the request does not consume the hard disk resource, if the request is a write request, additional write operation may be caused due to a log mechanism used by the file system, and the like, so that more hard disk resources are consumed. The use condition of resources is not known, accurate resource allocation cannot be achieved, so that the performance of tenants cannot be guaranteed, and performance isolation has no effect.

disclosure of Invention

Aiming at the defects and the improvement requirements of the prior art, the invention provides a resource management method and a resource management system based on multi-tenant cloud storage, and aims to realize performance isolation of a virtual machine level in a multi-tenant cloud storage environment.

in order to achieve the above object, according to a first aspect of the present invention, there is provided a resource management method based on multi-tenant cloud storage, including:

(1) According to the resource allocation strategy, acquiring the tenant performance requirements of each tenant, and correspondingly recording the tenant performance requirements of all tenants in the metadata of the virtual machine image file used by the tenant; adding a token bucket for the metadata of each virtual machine image file according to the performance requirements of tenants;

(2) on a page cache layer of an IO stack, acquiring an index node object of a virtual machine image file requested to be accessed by a file IO from a memory, and scheduling memory resources by using a token bucket algorithm; after scheduling is completed, transmitting the file IO request to a file system layer of an IO stack;

(3) converting each file IO request into a corresponding block IO request at a file system layer of an IO stack; for each file IO request, acquiring an index node object of a virtual machine image file accessed by the file IO request from a memory, acquiring a tenant performance requirement from the index node object, and adding the acquired tenant performance requirement to each block IO request converted by the file IO request; if the file IO request is a write request and a log mechanism is used for guaranteeing data consistency when the file IO request is converted into a block IO request, an additional block IO request for writing a log is generated in the conversion process, and for the additional block IO request, the cross-layer marking module can also add tenant performance requirements to the additional block IO request; transmitting a block IO request carrying tenant performance requirements to a block layer of an IO stack;

(4) On a block layer of an IO stack, acquiring tenant performance requirements from block IO requests, and scheduling hard disk resources by using a token bucket algorithm;

The tenant performance requirements comprise a tenant mark and a performance mark, the tenant mark is used for uniquely identifying a tenant, and the performance mark is used for indicating that the corresponding tenant requires fixed throughput guarantee or minimum throughput guarantee; the IO stack is required in each level stage when the read-write request is processed in the multi-tenant cloud storage system, and comprises the following steps: a page cache layer, a file system layer and a block layer; the file IO request is an IO request for accessing the image file of the virtual machine, and the block IO request is a request for accessing the hard disk.

Further, in the step (1), the tenant performance requirement is recorded in an index node object of the virtual machine image file in the memory; compared with the method that the tenant performance requirements are recorded in the index nodes of the virtual machine image files in the hard disk, the method that the tenant performance requirements are recorded in the index node objects of the virtual machine image files in the memory can avoid changing the hard disk layout.

further, in the step (1), according to tenant performance requirements, a rate of generating tokens for a token bucket added to the metadata of each virtual machine image file is set according to the following rules: if the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires a fixed throughput guarantee with a throughput rate of T, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is T; if the performance flag in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires minimum throughput guarantee, the rate of generating tokens by the token bucket attached to the metadata of the virtual machine image file is large enough to ensure that the token bucket is always full, so that file IO (input/output) requests are not blocked, and the maximization of memory resource utilization is realized.

further, in step (2), in the page cache layer of the IO stack, the memory resource is scheduled by using a token bucket algorithm, which includes: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in the token bucket attached to the index node object of the virtual machine image file accessed by the file IO request is not enough to service the file IO request, the process initiating the file IO request sleeps until enough tokens are generated in the token bucket.

further, in the step (4), the hard disk resource is scheduled by using a token bucket algorithm according to the acquired tenant performance requirement at the block layer of the IO stack, and the method includes:

(41) an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same;

(42) Creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment;

(43) Acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues, and the performance requirement of tenants of the IO queues is the IO queues requiring minimum throughput rate guarantee, distributing the remaining idle hard disk resources among the IO queues requiring the minimum throughput rate in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates, and therefore the maximization of the hard disk resource utilization is realized;

(44) traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly executing the step (44) after waiting for a preset time interval;

And the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue.

According to a second aspect of the present invention, the present invention further provides a resource management system based on multi-tenant cloud storage, including a control plane and a data plane;

the control plane includes: the tenant performance requirement generating module is used for obtaining the tenant performance requirement of each tenant according to the resource allocation strategy; the control interface is used for recording the performance requirements of all tenants in the metadata of the virtual machine image file used by the corresponding tenant; the cross-layer marking module is used for acquiring an index node object of the accessed virtual machine image file from a memory when the file IO request is converted into the block IO request in a file system layer of the IO stack, acquiring a tenant performance requirement from metadata of the index node object, and correspondingly adding the tenant performance requirement to each block IO request;

the data plane includes: the page cache scheduler is used for adding a token bucket to metadata of each virtual machine image file according to tenant performance requirements, acquiring an index node object of the virtual machine image file requested to be accessed by the file IO from a memory on a page cache layer of the IO stack, scheduling memory resources by using a token bucket algorithm, and transmitting the file IO request to a file system layer of the IO stack after scheduling is completed; the file system is used for converting a file IO request into a block IO request at a file system layer of the IO stack and transmitting the block IO request carrying tenant performance requirements to the block layer, if the file system uses a log mechanism to guarantee data consistency and the file IO request R is a write request, an extra block IO request for writing a log can be generated in the conversion process, and for the extra block IO request, the cross-layer marking module can also add the tenant performance requirements to the extra block IO request; the block layer scheduler is used for acquiring tenant performance requirements from the block IO requests in the block layers of the IO stacks and scheduling the hard disk resources by using a token bucket algorithm according to the tenant performance requirements;

The tenant performance requirements comprise a tenant mark and a performance mark, the tenant mark is used for uniquely identifying a tenant, and the performance mark is used for indicating that the corresponding tenant requires fixed throughput guarantee or minimum throughput guarantee; the IO stack is required in each level stage when the read-write request is processed in the multi-tenant cloud storage system, and comprises the following steps: a page cache layer, a file system layer and a block layer; the file IO request is a request for accessing a virtual machine image file, and the block IO request is a request for accessing a hard disk resource.

further, the control interface is used for recording the tenant performance requirement in an index node object of the virtual machine image file in the memory; compared with the method that the tenant performance requirements are recorded in the index nodes of the virtual machine image files in the hard disk, the method that the tenant performance requirements are recorded in the index node objects of the virtual machine image files in the memory can avoid changing the hard disk layout.

further, the rate of generating tokens by the token bucket added to the metadata of each virtual machine image file by the page cache scheduler according to the tenant performance requirement is set according to the following rule: if the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires a fixed throughput guarantee with a throughput rate of T, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is T; if the performance flag in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires minimum throughput guarantee, the rate of generating tokens by the token bucket attached to the metadata of the virtual machine image file is large enough to ensure that the token bucket is always full, so that file IO (input/output) requests are not blocked, and the maximization of memory resource utilization is realized.

Further, the page cache scheduler obtains, from the memory, an index node object of the virtual machine image file requested to be accessed by the file IO in a page cache layer of the IO stack, and schedules memory resources by using a token bucket algorithm, including: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in the token bucket attached to the index node object of the virtual machine image file accessed by the file IO request is not enough to service the file IO request, the process initiating the file IO request sleeps until enough tokens are generated in the token bucket.

Further, the method for scheduling the hard disk resources by using the token bucket algorithm according to the tenant performance requirements in the block layer of the IO stack by the block layer scheduler includes: an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same; creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment; acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues, and the performance requirement of tenants of the IO queues is the IO queues requiring minimum throughput rate guarantee, distributing the remaining idle hard disk resources among the IO queues requiring the minimum throughput rate in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates, and therefore the maximization of the hard disk resource utilization is realized; traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly traversing all IO queues after waiting for a preset time interval so as to search the IO queues which can be served; and the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue.

generally, by the above technical solution conceived by the present invention, the following beneficial effects can be obtained:

(1) According to the resource management method based on multi-tenant cloud storage, the scheduling of the memory resources and the hard disk resources is realized on the page cache layer and the block layer of the IO stack respectively, and the influence of a file system on the use of the resources can be controlled, so that the performance interference among tenants is effectively reduced, and the performance isolation among the tenants is realized.

(2) according to the resource management method based on multi-tenant cloud storage, provided by the invention, the metadata of the virtual machine image file is used for carrying the tenant performance requirement, so that the tenant performance requirement can be transmitted to the block layer of the IO stack by multiplexing the data path, and the control overhead is effectively avoided.

(3) According to the resource management method based on multi-tenant cloud storage, the file IO request for accessing the virtual machine image file is scheduled in the storage system, the use conditions of the memory resource and the hard disk resource can be fully mastered, so that idle resources can be fully utilized, and the resource utilization rate is improved.

(4) According to the resource management system based on multi-tenant cloud storage, the control plane and the data plane are designed, the resource management strategy is separated from the implementation mechanism, and therefore management can be simplified in a software-defined mode.

drawings

fig. 1 is an architecture diagram of a resource management system based on multi-tenant cloud storage according to an embodiment of the present invention;

fig. 2 is a schematic view of a storage system of a resource management system based on multi-tenant cloud storage according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

in a Linux environment, the resource management system based on multi-tenant cloud storage provided by the present invention is shown in fig. 1, and includes a control plane and a data plane;

the control plane includes: the tenant performance requirement generating module is used for obtaining the tenant performance requirement of each tenant according to the resource allocation strategy; the control interface is used for recording the performance requirements of all tenants in the metadata of the virtual machine image file used by the corresponding tenant; the cross-layer marking module is used for acquiring an index node object of the accessed virtual machine image file from a memory when the file IO request is converted into the block IO request in a file system layer of the IO stack, acquiring a tenant performance requirement from metadata of the index node object, and correspondingly adding the tenant performance requirement to each block IO request;

the data plane includes: the page cache scheduler is used for adding a token bucket to metadata of each virtual machine image file according to tenant performance requirements, acquiring an index node object of the virtual machine image file requested to be accessed by the file IO from a memory on a page cache layer of the IO stack, scheduling memory resources by using a token bucket algorithm, and transmitting the file IO request to a file system layer of the IO stack after scheduling is completed; the file system is used for converting the file IO request into a block IO request at a file system layer of the IO stack and transmitting the block IO request carrying the tenant performance requirement to the block layer, and in the embodiment, the file system is an Ext4 file system; the block layer scheduler is used for acquiring tenant performance requirements from the block IO requests in the block layers of the IO stacks and scheduling the hard disk resources by using a token bucket algorithm according to the tenant performance requirements;

the tenant performance requirements comprise a tenant mark and a performance mark, the tenant mark is used for uniquely identifying a tenant, and the performance mark is used for indicating that the corresponding tenant requires fixed throughput guarantee or minimum throughput guarantee; the IO stack is required in each level stage when the read-write request is processed in the multi-tenant cloud storage system, and comprises the following steps: a page cache layer, a file system layer and a block layer; the file IO request is a request for accessing a virtual machine image file, and the block IO request is a request for accessing a hard disk resource; specifically, the method comprises the following steps:

the control interface is used for recording the performance requirement of the tenant in an index node object of a virtual machine image file in the memory; compared with the method that the tenant performance requirements are recorded in the index nodes of the virtual machine image files in the hard disk, the tenant performance requirements are recorded in the index node objects of the virtual machine image files in the memory, so that the hard disk layout can be prevented from being changed;

According to the performance requirement of a tenant, the speed of generating tokens for the token bucket added by the metadata of each virtual machine image file by the page cache scheduler is set according to the following rule: if the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires a fixed throughput guarantee with a throughput rate of T, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is T; if the performance mark in the tenant performance requirement recorded in the metadata of the virtual machine image file indicates that the tenant requires minimum throughput guarantee, the rate of generating tokens by a token bucket attached to the metadata of the virtual machine image file is large enough to ensure that the token bucket is always full, so that file IO (input/output) requests are not blocked, and the maximization of memory resource utilization is realized; the method comprises the following steps that a page cache scheduler obtains an index node object of a virtual machine image file requested to be accessed by a file IO from a memory on a page cache layer of an IO stack, and schedules memory resources by using a token bucket algorithm, and comprises the following steps: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in a token bucket in an index node object of a virtual machine image file accessed by the file IO request is not enough to serve the file IO request, initiating the process of the file IO request to sleep until enough tokens are generated in the token bucket;

the method for dispatching the hard disk resources by the block layer dispatcher according to tenant performance requirements on the block layer of the IO stack by using a token bucket algorithm comprises the following steps: an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same; creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment; acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues, and the performance requirement of tenants of the IO queues is the IO queues requiring minimum throughput rate guarantee, distributing the remaining idle hard disk resources among the IO queues requiring the minimum throughput rate in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates, and therefore the maximization of the hard disk resource utilization is realized; traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly traversing all IO queues after waiting for a preset time interval so as to search the IO queues which can be served; the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue;

The number of tokens consumed when the block IO request accesses the hard disk is determined by a storage mechanism of the underlying storage device, for example, when the underlying storage device is a disk, due to a seek characteristic of the disk, a cost of the random request and a cost of the sequential request may be greatly different, accordingly, the number of tokens consumed when the block IO request generated by the sequential request accesses the disk is equal to a size of the request, the number of tokens consumed when the block IO request generated by the random request accesses the memory is equal to the size of the request plus a certain amount of extra tokens, for example, a 4K token is consumed by a sequential 4KB request, and a total of 68K tokens is consumed by a 4K plus 64K by a random 4KB request.

In the storage system shown in fig. 2, resource management is performed based on the resource management system shown in fig. 1; in the storage system shown in fig. 2, 3 virtual machines are included, three tenant VM1, tenant VM2, and tenant VM3 correspond to each other, and the corresponding virtual machine image files are vm1.img, vm2.img, and vm3.img, respectively; the resource management strategy made by the manager is as follows: tenant VM1 requires a fixed throughput guarantee with a throughput of T1, tenant VM2 requires a minimum throughput guarantee with a throughput not less than T2, and tenant VM3 requires a minimum throughput guarantee with a throughput not less than T3; in the storage system, the resource management method based on multi-tenant cloud storage provided by the invention comprises the following steps:

(1) according to the resource allocation strategy, a tenant performance requirement generating module is used for obtaining the tenant performance requirement of each tenant, and the control interface is used for correspondingly recording the tenant performance requirements of all the tenants in an index node object of a virtual machine image file used by the tenant; adding a token bucket for the index node object of each virtual machine image file by using a page cache scheduler according to the performance requirements of tenants; for the virtual machine image file VM1.img, the rate of generating tokens by the token bucket is T1; for virtual machine image files VM2.img and VM3.img, the rate of generating tokens by the token bucket is large enough to ensure that the token bucket is always full, thereby ensuring that file IO requests are not blocked and realizing the maximization of memory resource utilization;

(2) In a page cache layer of an IO stack, acquiring an index node object of a virtual machine image file requested to be accessed by a file IO from a memory by using a page cache scheduler, and scheduling memory resources by using a token bucket algorithm, wherein the method comprises the following steps: if the file IO request is a read request, the token is not consumed when the memory is accessed; if the file IO request is a write request, consuming tokens when accessing the memory, wherein the number of the consumed tokens is equal to the size of the file IO request; if the file IO request is a write request and the number of tokens in a token bucket in an index node object of a virtual machine image file accessed by the file IO request is not enough to serve the file IO request, initiating the process of the file IO request to sleep until enough tokens are generated in the token bucket;

After scheduling is completed, transmitting the file IO request to a file system layer of an IO stack by using a page cache scheduler;

(3) converting each file IO request into a corresponding block IO request by using a file system on a file system layer of an IO stack; for each file IO request, acquiring an index node object of a virtual machine image file accessed by the file IO request from a memory by using a cross-layer marking module, acquiring a tenant performance requirement from the index node object, and then adding the acquired tenant performance requirement to each block IO request converted by the file IO request; because the Ext4 file system uses a log mechanism to guarantee data consistency, when a file IO request is a write request, an additional block IO request for writing a log is generated in the conversion process, and for the additional block IO request, the tenant performance requirement needs to be added to the additional block IO request;

(4) On a block layer of an IO stack, acquiring tenant performance requirements from block IO requests by using a block layer scheduler, and scheduling hard disk resources by using a token bucket algorithm; the method comprises the following steps:

(41) an IO queue is constructed for each virtual machine image file and used for receiving block IO requests obtained by file IO request conversion; in an IO queue, tenant performance requirements carried by all block IO requests are the same;

(42) Creating a token bucket for each IO queue; whether the block IO request is a read request or a write request, the tokens are consumed when the hard disk is accessed, and the number of the consumed tokens is determined by a storage mechanism of the bottom-layer storage equipment;

(43) acquiring current idle hard disk resources, and allocating the hard disk resources to the IO queue according to the tenant performance requirements of the IO queue: if the performance mark in the tenant performance requirement of the IO queue indicates that a user requires a fixed throughput guarantee with a throughput rate of T ', the token generation rate of a token bucket of the IO queue is T'; if the performance mark in the tenant performance requirement of the IO queue indicates that the user requires the minimum throughput guarantee that the throughput is not lower than T ', the rate of generating tokens by the token bucket of the IO queue is T'; if the remaining idle hard disk resources exist after the hard disk resources are distributed to all the IO queues, and the performance requirement of tenants of the IO queues is the IO queues requiring minimum throughput rate guarantee, distributing the remaining idle hard disk resources among the IO queues requiring the minimum throughput rate in proportion, wherein the distribution proportion is the ratio of the corresponding minimum throughput rates, and therefore the maximization of the hard disk resource utilization is realized; for example, T1 is 10Mtokens/s, T2 is 10Mtokens/s, T3 is 20Mtokens/s, and the current free hard disk resource is 55Mtokens/s, then the token bucket generation rates of tenant VM1, tenant VM2, and tenant VM3 are first set to 10Mtokens/s, and 20Mtokens/s, respectively; after the resource allocation is completed, 15Mtokens/s of idle hard disk resources are left, the remaining idle hard disk resources are allocated to the tenant VM2 and the tenant VM3 according to the proportion of T2: T3 to 1:2, and finally the hard disk resources allocated to the tenant VM1, the tenant VM2 and the tenant VM3 are respectively 10Mtokens/s, 15Mtokens/s and 30 Mtokens/s;

(44) traversing all IO queues, and if the IO queues exist in which block IO requests are to be processed and a token bucket of the IO queues has enough tokens, selecting the queues for service; otherwise, repeatedly executing the step (44) after waiting for a preset time interval;

and the tenant performance requirement of the IO queue is the tenant performance requirement carried by the block IO request in the IO queue.

it will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:使用缓存反馈信息指导数据预读

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类