Virtual machine traffic control method, device, electronic device and storage medium
By obtaining the physical disk attribute information of the virtual disk and allocating the traffic quota, it prevents the virtual disk from reading and writing tasks when the quota is exhausted, solving the problem of low universality of virtual machine traffic control results in the existing technology, and achieving matching of user needs. The flow control effect matches the physical disk capacity.
Patent Information
- Application Number
- CN202210087444.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-01-25
AI Technical Summary
When users deploy multiple virtual machines of different service types, the existing technology cannot meet the traffic control needs of different virtual machine performance requirements, resulting in relatively fixed traffic control results that cannot adapt to the actual needs of users.
By obtaining the attribute information of the physical disk corresponding to the virtual disk of the virtual machine, traffic usage quota is allocated to the virtual disk according to user needs, and read and write tasks are blocked when the quota is exhausted. Token bucket technology is used to allocate quota cyclically to achieve traffic control.
It realizes virtual machine flow control based on user needs and physical disk capabilities, improves the applicability and performance isolation of flow control, and meets user control needs.
Smart Images

Figure CN114443228B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a virtual machine traffic control method, device, electronic device and storage medium. Background Art
[0002] At present, a host machine can often support multiple virtual machines, and each virtual machine can provide solid-state disk (SSD) storage services for the host machine. In order to ensure the I / O quality of service (QoS) of each virtual machine, how to control the flow of each virtual machine has become a key research topic.
[0003] In the prior art, a virtual machine management tool deployed on a physical server of a virtual machine usually monitors the traffic of each virtual machine virtualized from the physical server, and then controls the traffic of each virtual machine based on the monitoring result.
[0004] However, when a user deploys multiple virtual machines of different service types at the same time, the user has different performance requirements for different virtual machines, and the flow control results of the prior art are relatively fixed and cannot meet the actual control needs of the user. Summary of the invention
[0005] The present application provides a virtual machine traffic control method, device, electronic device and storage medium to solve the defects of the virtual machine traffic control results in the prior art such as low universality.
[0006] The first aspect of the present application provides a virtual machine traffic control method, which is applied to a host machine, and the method includes:
[0007] Obtaining the property information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine;
[0008] According to the user virtual machine traffic control requirements, and based on the attribute information of the physical disk corresponding to each virtual disk, a traffic usage quota is allocated to each virtual disk;
[0009] When the traffic usage quota of any of the virtual disks is exhausted, the virtual disk is prevented from sending read and write tasks to the corresponding physical disk, so as to stop the read and write service of the virtual disk.
[0010] Optionally, allocating a traffic usage quota to each virtual disk includes:
[0011] According to the preset quota update cycle, the traffic usage quota is cyclically allocated to each of the virtual disks.
[0012] Optionally, the virtual disk includes a virtual disk processor, which is used to send read and write tasks to the physical disk, and preventing the virtual disk from sending read and write tasks to the corresponding physical disk includes:
[0013] A blocking flag is set on the read / write task to be sent by the virtual disk, so that the virtual disk processor does not send the read / write task to the physical disk.
[0014] Optionally, after allocating traffic usage quotas to each of the virtual disks, the method further includes:
[0015] Monitoring the read and write task information received by each of the virtual disks;
[0016] For each of the virtual disks, determining a traffic usage value of the virtual disk according to the read and write task information received by the virtual disk;
[0017] When the traffic usage value of the virtual disk reaches the traffic usage quota, it is determined that the traffic usage quota of the virtual disk is exhausted.
[0018] Optionally, the traffic usage quota is divided into three types: read and write operation times quota, read throughput quota and write throughput quota.
[0019] Optionally, the traffic usage value of the virtual disk includes three indicators: IOPS cumulative value, total read throughput cumulative value, and write throughput cumulative value. The method further includes:
[0020] If any one of the IOPS cumulative value, the total read throughput cumulative value, and the write throughput cumulative value of the virtual disk reaches the quota of the corresponding type, it is determined that the traffic usage value of the virtual disk reaches the traffic usage quota.
[0021] Optionally, the attribute information of the physical disk includes at least an IOPS upper limit value and a bandwidth of the physical disk.
[0022] A second aspect of the present application provides a virtual machine traffic control device, which is applied to a host machine, and the device includes:
[0023] The acquisition module is used to obtain the property information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine;
[0024] A management module, configured to allocate a traffic usage quota to each virtual disk according to the traffic control requirements of the user virtual machine and the attribute information of the physical disk corresponding to each virtual disk;
[0025] The control module is used to prevent any virtual disk from sending read and write tasks to the corresponding physical disk when the traffic usage quota of any virtual disk is exhausted, so as to stop the read and write service of the virtual disk.
[0026] Optionally, the management module is specifically used to:
[0027] According to the preset quota update cycle, the traffic usage quota is cyclically allocated to each of the virtual disks.
[0028] Optionally, the virtual disk includes a virtual disk processor, which is used to send read and write tasks to the physical disk, and the control module is specifically used to:
[0029] A blocking flag is set on the read / write task to be sent by the virtual disk, so that the virtual disk processor does not send the read / write task to the physical disk.
[0030] Optionally, the management module is further used to:
[0031] Monitoring the read and write task information received by each of the virtual disks;
[0032] For each of the virtual disks, determining a traffic usage value of the virtual disk according to the read and write task information received by the virtual disk;
[0033] When the traffic usage value of the virtual disk reaches the traffic usage quota, it is determined that the traffic usage quota of the virtual disk is exhausted.
[0034] Optionally, the traffic usage quota is divided into three types: read and write operation times quota, read throughput quota and write throughput quota.
[0035] Optionally, the traffic usage value of the virtual disk includes three indicators: IOPS cumulative value, total read throughput cumulative value and write throughput cumulative value. The management module is further used to:
[0036] If any one of the IOPS cumulative value, the total read throughput cumulative value, and the write throughput cumulative value of the virtual disk reaches the quota of the corresponding type, it is determined that the traffic usage value of the virtual disk reaches the traffic usage quota.
[0037] Optionally, the attribute information of the physical disk includes at least an IOPS upper limit value and a bandwidth of the physical disk.
[0038] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;
[0039] The memory stores computer-executable instructions;
[0040] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.
[0041] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.
[0042] The technical solution of this application has the following advantages:
[0043] The present application provides a virtual machine traffic control method, device, electronic device and storage medium, the method comprising: obtaining the attribute information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; allocating traffic usage quota to each virtual disk according to the user virtual machine traffic control requirements and the attribute information of the physical disk corresponding to each virtual disk; when the traffic usage quota of any virtual disk is exhausted, preventing the virtual disk from sending read and write tasks to the corresponding physical disk to stop the read and write service of the virtual disk. The method provided by the above scheme controls the traffic of the virtual disk of the deployed virtual machine on the host side according to the user virtual machine traffic control requirements and the attribute information of the physical disk, so that the virtual machine traffic control result not only meets the user control requirements, but also matches the actual capacity of the physical disk, thereby ensuring the applicability of the virtual machine traffic control result of the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0045] Figure 1 This is a schematic diagram of the structure of the virtual machine traffic control system based on the embodiment of the present application;
[0046] Figure 2 A flow chart of a virtual machine traffic control method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of a virtual machine traffic control device provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0049] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0052] In the prior art, a virtual machine management tool deployed on the physical server of the virtual machine usually monitors the traffic of each virtual machine virtualized from the physical server, and then controls the traffic of each virtual machine according to the monitoring result. However, when a user deploys multiple virtual machines of different service types at the same time, the user has different performance requirements for different virtual machines, and the traffic control results of the prior art are relatively fixed and cannot meet the actual control needs of the user.
[0053] In response to the above problems, the virtual machine traffic control method, device, electronic device and storage medium provided in the embodiments of the present application obtain the attribute information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; according to the user virtual machine traffic control requirements, according to the attribute information of the physical disk corresponding to each virtual disk, the traffic usage quota is allocated to each virtual disk; when the traffic usage quota of any virtual disk is exhausted, the virtual disk is prevented from sending read and write tasks to the corresponding physical disk to stop the read and write service of the virtual disk. The method provided by the above scheme controls the traffic of the virtual disk of the deployed virtual machine on the host side according to the user virtual machine traffic control requirements and the attribute information of the physical disk, so that the virtual machine traffic control result not only meets the user control requirements, but also matches the actual capacity of the physical disk, thereby ensuring the applicability of the virtual machine traffic control result of the host.
[0054] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0055] First, the structure of the virtual machine traffic control system on which this application is based is described:
[0056] The virtual machine traffic control method, device, electronic device and storage medium provided in the embodiments of the present application are suitable for controlling the traffic of a virtual machine deployed on a host machine. Figure 1 As shown, it is a structural diagram of the virtual machine flow control system based on the embodiment of the present application, which mainly includes multiple virtual machines, a data acquisition device and a virtual machine flow control device for controlling the flow of virtual machines, wherein the virtual machine flow control system is deployed on a host machine. Specifically, the attribute information of the physical disk corresponding to the virtual disk of each virtual machine of the data acquisition device and the virtual machine flow control requirements input by the user can be used, and then the collected data can be sent to the virtual machine flow control device, so that the virtual machine flow control device can control the flow of the virtual machine according to these data.
[0057] The embodiment of the present application provides a virtual machine flow control method, which is applied to a host machine and is used to control the flow of a virtual machine deployed on the host machine. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used to control the flow of a virtual machine.
[0058] like Figure 2 FIG. 1 is a flow chart of a virtual machine traffic control method provided in an embodiment of the present application, the method comprising:
[0059] Step 201: Acquire the property information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine.
[0060] The attribute information of the physical disk is used to characterize the I / O service capability of the physical disk, and the attribute information at least includes relevant information such as the IOPS upper limit and bandwidth of the physical disk.
[0061] Step 202: Allocate traffic usage quota to each virtual disk according to the traffic control requirements of the user virtual machine and the attribute information of the physical disk corresponding to each virtual disk.
[0062] It should be noted that the virtual machine traffic control requirements input by the user reflect information such as the usage frequency and importance of each virtual machine in the host machine.
[0063] Specifically, first, the weight of each virtual machine in the allocation of traffic usage quota can be determined according to the user virtual machine traffic control requirements, and then the traffic usage quota can be allocated to each virtual disk deployed on the current host machine in combination with the attribute information of the physical disk corresponding to each virtual disk.
[0064] Step 203: When the traffic usage quota of any virtual disk is exhausted, the virtual disk is prevented from sending read and write tasks to the corresponding physical disk to stop the read and write service of the virtual disk.
[0065] It should be noted that in an actual network environment, if a virtual machine is overloaded, such as the received I / O tasks exceed the actual service capacity of the physical disk, the I / O service quality Qos of the virtual machine in the host will be reduced.
[0066] Specifically, when a virtual machine has exhausted the traffic usage quota previously allocated to it after running for a period of time, in order to avoid overload and other situations, the virtual disk can be blocked from sending read and write tasks (I / O tasks) to the corresponding physical disk, making it impossible for the virtual machine to send I / O tasks to the physical disk, thereby stopping the read and write services of the virtual disk.
[0067] Based on the above embodiment, as an implementable manner, in one embodiment, the traffic usage quota can be cyclically allocated to each virtual disk according to a preset quota update cycle.
[0068] Specifically, when determining the traffic usage quota to be allocated to each virtual machine, it is also necessary to determine the quota update cycle, and then cyclically allocate traffic usage quotas to each virtual disk according to the quota update cycle. Specifically, token bucket technology can be used to achieve cyclic allocation of traffic usage quotas.
[0069] Specifically, in one embodiment, the virtual disk includes a virtual disk processor for sending read and write tasks to the physical disk. Specifically, a blocking flag can be set on the read and write tasks to be sent by the virtual disk so that the virtual disk processor does not send the read and write tasks to the physical disk.
[0070] It should be noted that after obtaining the I / O task, the virtual disk adds the I / O task to the task submission queue to prepare to send the I / O task to the physical disk in a queue manner.
[0071] Specifically, when it is determined that the traffic usage quota of a virtual disk is exhausted, a blocking flag can be added to the mark bit of its task submission queue to prevent the sending operation of the task submission queue, that is, not sending to the corresponding physical disk.
[0072] Based on the above embodiment, as an implementable manner, in one embodiment, after allocating traffic usage quota to each virtual disk, the method further includes:
[0073] Step 301, monitoring the read and write task information received by each virtual disk;
[0074] Step 302, for each virtual disk, determine the traffic usage value of the virtual disk according to the read and write task information received by the virtual disk;
[0075] Step 303: When the traffic usage value of the virtual disk reaches the traffic usage quota, it is determined that the traffic usage quota of the virtual disk is exhausted.
[0076] Specifically, by monitoring the read and write task information received by each virtual disk, the traffic consumption of the virtual machine during the current quota update cycle and its corresponding traffic usage value can be determined. In the process of monitoring the read and write task information, the relationship between the traffic usage value and the traffic usage quota of the virtual disk is compared. When the traffic usage value of the virtual disk reaches the traffic usage quota, it is determined that the traffic usage quota of the virtual disk is exhausted.
[0077] Among them, traffic usage quotas are divided into three types: read and write operation quotas, read throughput quotas, and write throughput quotas.
[0078] Correspondingly, the traffic usage value of the virtual disk includes three indicators: IOPS cumulative value, total read throughput cumulative value and write throughput cumulative value. If any of the indicators among the IOPS cumulative value, total read throughput cumulative value and write throughput cumulative value of the virtual disk reaches the quota of the corresponding type, it is determined that the traffic usage value of the virtual disk reaches the traffic usage quota.
[0079] For example, assuming that the token update time (quota update cycle) is 5ms, if the read and write operation quota in the traffic usage quota of a virtual disk of a virtual machine is 500K, the read throughput quota is 5000M / s, and the write throughput quota is 4000M / s, then in a quota update cycle (e.g. 5ms), the number of tokens (traffic usage quota) that can be used is 2500IOPS, 25000M throughput, and 20000M write throughput. In actual applications, these traffic usage quota parameters can be set for each virtual disk based on the private Admin management command of the virtual disk control channel of the physical disk, and only the virtual disk control channel of the physical disk has this setting authority.
[0080] Furthermore, in the process of flow control for virtual machines, each virtual machine independently maintains the token, that is, every time an I / O request is received, the number of IOPS tokens is reduced by 1, and the read / write throughput token is also reduced by the length of the request. The one whose token arrives first (the one whose traffic usage quota is exhausted first) stops serving until the end of this time slice (quota update cycle). When a new time slice arrives, the token resources will be re-initialized, that is, the traffic usage quota will be re-allocated to each virtual disk.
[0081] Exemplarily, when monitoring the read and write task information received by each virtual disk, the read and write tasks of the virtual disk can be counted based on the virtual disk processor DM of each virtual machine, which involves information synchronization issues. Assuming that the user virtual machine traffic control requirements do not require high accuracy in the read and write task counting, each CPU (virtual disk processor) is treated as having an exclusive variable, that is, a DM instance in the virtual disk processor reserves a Random for the virtual disk, such as any one of the IOPS token count, the total read throughput token count, and the total read throughput token count.
[0082] Furthermore, for each DM instance, in the process of counting the read and write tasks of the virtual disk, each time an SQM request (I / O task) is received, the count is updated, and only the token count of its own CPU is updated. After the update is completed, the variables of other DM instances are obtained at the same time and accumulated to determine whether the traffic usage quota of the current virtual disk is used up according to the accumulated results. After it is used up, feedback control is performed to turn off the I / O service SQ of the current virtual disk VF. In order to support 1 virtual disk control channel PF+127VF, the virtual disk controller has 8 DMs, requiring 1024 arrays, each with 3 elements corresponding to 3 token values; 128 arrays are also required to store the token reload value (reset value) of the token bucket for periodic updates. Similarly, each array has 3 elements, namely the read and write operation quota, the read throughput quota, and the write throughput quota, also known as the maximum IOPS token value, the maximum read-read throughput token value, and the maximum write throughput token value.
[0083] It should be noted that after a DM receives an SQM request, it obtains the corresponding SQE field in different SQ (I / O service) commands, maps the corresponding VF according to the mapping table from physical SQ to virtual SQ, and adds the quota value to the elements of this (DM, VF) combination. After the addition, it determines whether the accumulated quota value of this VF on all DMs exceeds the corresponding token quota value. If so, all SQs of this VF are turned off. When the token bucket update time (quota update cycle) is reached, each DM receives a time interrupt respectively, and each DM updates the data structure on its own CPU to clear the accumulated value of the corresponding variable (indicator). Among them, each DM instance can be set with a timer, and the reload flag (reset flag) of all DMs is set in the timer interrupt. The DM detects the reload flag in the loop and performs a reset operation to clear the current traffic usage value of each VF.
[0084] Furthermore, each SQ of the virtual disk corresponds to a 32-bit register called SQEARBCTL, which has a bit for SKIP (mark bit). When it is set to 1, this SQ no longer participates in the arbitration of command distribution, that is, the commands in this SQ will no longer send the corresponding firmware. When the traffic usage quota of the virtual disk is used up, the DM finds all the SQs corresponding to this VF, sets the SKIP bit to 1, and turns off subsequent requests. At the end of the time slice, the DM will reset the SKIP bit of the SQEARBCTL corresponding to each VF.
[0085] It should be further explained that when the allocated traffic usage quota is relatively small, there may be a relatively large error. The reason is that traffic control limits traffic by switching queues. However, when the set traffic usage quota is relatively small, the traffic usage quota will be frequently reset. During the operation, the impact of the leaked I / O tasks on the current error is more obvious. In order to reduce this error, the number of switches can be reduced to reduce the leaked I / O tasks.
[0086] Specifically, when the traffic usage quota is less than a certain threshold, the quota update period can be increased. In actual tests, it was found that 100ms is a relatively good quota update period.
[0087] The virtual machine traffic control method provided in the embodiment of the present application obtains the attribute information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; according to the user virtual machine traffic control requirements, according to the attribute information of the physical disk corresponding to each virtual disk, the traffic usage quota is allocated to each virtual disk; when the traffic usage quota of any virtual disk is exhausted, the virtual disk is prevented from sending read and write tasks to the corresponding physical disk to stop the read and write service of the virtual disk. The method provided by the above scheme controls the traffic of the virtual disk of the deployed virtual machine on the host side according to the user virtual machine traffic control requirements and the attribute information of the physical disk, so that the virtual machine traffic control result not only meets the user control requirements, but also matches the actual capacity of the physical disk, thereby ensuring the applicability of the virtual machine traffic control result of the host. In addition, by using token bucket technology to control the traffic of different I / O tasks, the performance isolation of virtual disks is guaranteed.
[0088] An embodiment of the present application provides a virtual machine traffic control device, which is applied to a host machine and is used to execute the virtual machine traffic control method provided in the above embodiment.
[0089] like Figure 3 , which is a schematic diagram of the structure of a virtual machine traffic control device provided in an embodiment of the present application. The virtual machine traffic control device 30 comprises: an acquisition module 301 , a management module 302 and a control module 303 .
[0090] Among them, the acquisition module is used to obtain the attribute information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; the management module is used to allocate traffic usage quota to each virtual disk according to the attribute information of the physical disk corresponding to each virtual disk in accordance with the user virtual machine traffic control requirements; the control module is used to prevent the virtual disk from sending read and write tasks to the corresponding physical disk when the traffic usage quota of any virtual disk is exhausted, so as to stop the read and write services of the virtual disk.
[0091] Specifically, in one embodiment, the management module is specifically used to:
[0092] According to the preset quota update cycle, the traffic usage quota is cyclically allocated to each virtual disk.
[0093] Specifically, in one embodiment, the virtual disk includes a virtual disk processor, which is used to send read and write tasks to the physical disk, and a control module, which is specifically used to:
[0094] A blocking flag is set on the read / write task to be sent by the virtual disk, so that the virtual disk processor does not send the read / write task to the physical disk.
[0095] Specifically, in one embodiment, the management module is further used to:
[0096] Monitor the read and write task information received by each virtual disk;
[0097] For each virtual disk, determine the traffic usage value of the virtual disk according to the read and write task information received by the virtual disk;
[0098] When the traffic usage value of the virtual disk reaches the traffic usage quota, it is determined that the traffic usage quota of the virtual disk is exhausted.
[0099] Specifically, in one embodiment, the traffic usage quota is divided into three types: read and write operation times quota, read throughput quota and write throughput quota.
[0100] Specifically, in one embodiment, the traffic usage value of the virtual disk includes three indicators: IOPS cumulative value, total read throughput cumulative value, and write throughput cumulative value. The management module is also used to:
[0101] If any of the IOPS cumulative value, the total read throughput cumulative value, and the write throughput cumulative value of the virtual disk reaches the quota of the corresponding type, it is determined that the traffic usage value of the virtual disk reaches the traffic usage quota.
[0102] Specifically, in one embodiment, the attribute information of the physical disk includes at least the IOPS upper limit and bandwidth of the physical disk.
[0103] Regarding the virtual machine traffic control device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0104] The virtual machine traffic control device provided in the embodiment of the present application is used to execute the virtual machine traffic control method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0105] An embodiment of the present application provides an electronic device for executing the virtual machine traffic control method provided in the above embodiment.
[0106] like Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 40 includes: at least one processor 41 and a memory 42.
[0107] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the virtual machine traffic control method provided in the above embodiment.
[0108] An electronic device provided in an embodiment of the present application is used to execute the virtual machine traffic control method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0109] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a virtual machine traffic control method provided in any of the above embodiments is implemented.
[0110] The storage medium containing computer executable instructions in the embodiment of the present application can be used to store computer executable instructions of the virtual machine traffic control method provided in the aforementioned embodiment. Its implementation method and principle are the same and will not be repeated here.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0114] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0115] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A virtual machine traffic control method, applied to a host machine, characterized in that: The method comprises: Obtaining the property information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; According to the user virtual machine traffic control requirements, and based on the attribute information of the physical disk corresponding to each virtual disk, a traffic usage quota is allocated to each virtual disk; When the traffic usage quota of any of the virtual disks is exhausted, the virtual disk is prevented from sending read and write tasks to the corresponding physical disk to stop the read and write service of the virtual disk; After allocating traffic usage quotas to each of the virtual disks, the method further includes: Monitoring the read and write task information received by each of the virtual disks; For each of the virtual disks, determining a traffic usage value of the virtual disk according to the read and write task information received by the virtual disk; When the traffic usage value of the virtual disk reaches the traffic usage quota, determining that the traffic usage quota of the virtual disk is exhausted; The attribute information of the physical disk includes at least an IOPS upper limit value and a bandwidth of the physical disk.
2. The method according to claim 1, characterized in that The allocating a traffic usage quota to each virtual disk includes: According to the preset quota update cycle, the traffic usage quota is cyclically allocated to each of the virtual disks.
3. The method according to claim 1, characterized in that: The virtual disk includes a virtual disk processor, which is used to send read and write tasks to the physical disk, and preventing the virtual disk from sending read and write tasks to the corresponding physical disk includes: A blocking flag is set on the read / write task to be sent by the virtual disk, so that the virtual disk processor does not send the read / write task to the physical disk.
4. The method according to claim 1, characterized in that The traffic usage quota is divided into three types: read and write operation times quota, read throughput quota and write throughput quota.
5. The method according to claim 4, characterized in that The traffic usage value of the virtual disk includes three indicators: IOPS cumulative value, total read throughput cumulative value and write throughput cumulative value. The method further includes: If any one of the IOPS cumulative value, the total read throughput cumulative value, and the write throughput cumulative value of the virtual disk reaches the quota of the corresponding type, it is determined that the traffic usage value of the virtual disk reaches the traffic usage quota.
6. A virtual machine traffic control device, applied to a host machine, characterized in that: The device comprises: The acquisition module is used to obtain the property information of the physical disk corresponding to the virtual disk of each currently deployed virtual machine; A management module, configured to allocate a traffic usage quota to each virtual disk according to the traffic control requirements of the user virtual machine and the attribute information of the physical disk corresponding to each virtual disk; A control module, used for preventing any virtual disk from sending read and write tasks to the corresponding physical disk when the traffic usage quota of any virtual disk is exhausted, so as to stop the read and write service of the virtual disk; The management module is further used for: After allocating traffic usage quotas to each of the virtual disks, monitoring read and write task information received by each of the virtual disks; For each of the virtual disks, determining a traffic usage value of the virtual disk according to the read and write task information received by the virtual disk; When the traffic usage value of the virtual disk reaches the traffic usage quota, determining that the traffic usage quota of the virtual disk is exhausted; The attribute information of the physical disk includes at least an IOPS upper limit value and a bandwidth of the physical disk.
7. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Network access method of virtual machine and related equipment
CN110198243A
Flow regulation and control method and device for servers in distributed cluster
CN110661824A
System and method for monitoring virtual machine
US20120311577A1
Virtualizing DCB settings for virtual network adapters
US20190089637A1
