Disk testing method, device, equipment and medium for virtual machine environment

By configuring the test environment and virtual storage space in a virtual machine environment, allocating system resources, and running test scripts in the virtual machine, the problem of low performance testing efficiency of NVMe disks in KVM virtual machines is solved, and efficient performance testing is achieved.

CN115910191BActive Publication Date: 2026-01-02成都芯忆联信息技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211644722.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2026-01-02
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

Existing methods for testing NVMe disk performance in KVM virtual machines are inefficient and cannot perform performance tests effectively.

Method used

Configure the test environment, create virtual storage space in the disk space according to the protocol rules, allocate system resources, and run test scripts through the virtual machine to conduct performance tests.

Benefits of technology

It improves the efficiency of virtual function performance testing of NVMe disks in a virtual machine environment, and realizes efficient performance testing of storage units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115910191B_ABST
    Figure CN115910191B_ABST
Patent Text Reader

Abstract

The application discloses a disk testing method, device and equipment for a virtual machine environment and a medium. The method comprises the following steps: configuring a test environment according to a test instruction, configuring a corresponding virtual storage space in the disk space of the test environment according to a protocol rule, allocating system resources to the storage unit of the virtual storage space, and mounting the storage unit to the created virtual machine. The virtual machine runs a test script corresponding to the test instruction to perform performance testing on the storage unit and obtain a corresponding test result. Through the above method, the virtual storage space containing multiple independent storage units can be configured, and the non-system resources of the storage unit are allocated. Then, the virtual machine mounting the storage unit executes the test instruction and performs performance testing on the storage unit, thereby improving the efficiency of performance testing on the virtual function of the NVMe disk in the virtual machine environment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud computing, and particularly relates to a disk testing method and device for a virtual machine environment, equipment and a medium. BACKGROUND

[0002] An NVMe disk is a storage device based on a non-volatile memory host controller interface specification. The NVMe disk can be assembled in a computer device such as a virtual machine for use. Before use, the virtual machine needs to test each component configured in the virtual machine, including performance testing of the virtual function of the NVMe disk. However, in the prior art method, the NVMe disk configured by the KVM (Kernel-based Virtual Machine) virtual machine based on the Linux system cannot be quickly tested for performance. Therefore, the testing method for the KVM virtual machine in the prior art method has the problem that the configured NVMe disk cannot be efficiently tested for performance. SUMMARY

[0003] The embodiments of the present application provide a disk testing method and device for a virtual machine environment, equipment and a medium, aiming at solving the problem that the testing method for the KVM virtual machine in the prior art method cannot efficiently test the performance of the configured NVMe disk.

[0004] In a first aspect, the embodiments of the present application provide a disk testing method for a virtual machine environment, which comprises:

[0005] If a test instruction is received, a test environment is configured according to the test instruction;

[0006] A virtual storage space corresponding to a pre-stored protocol rule is configured in a disk space of the test environment according to the protocol rule; the virtual storage space comprises a plurality of storage units;

[0007] System resources are allocated to the storage units in the virtual storage space;

[0008] A virtual machine is created and the storage units are mounted to the virtual machine;

[0009] A test script corresponding to the test instruction is run in the virtual machine to test the performance of the storage units, and a corresponding test result is obtained.

[0010] In a second aspect, the embodiments of the present application provide a disk testing device for a virtual machine environment, which comprises:

[0011] A test environment configuration unit is configured to configure a test environment according to a test instruction if the test instruction is received;

[0012] a virtual storage space configuration unit configured to configure a virtual storage space corresponding to a pre-stored protocol rule in a disk space of the test environment according to the protocol rule, the virtual storage space comprising a plurality of storage units;

[0013] a system resource allocation unit configured to allocate system resources to the storage units in the virtual storage space;

[0014] a storage unit mounting unit configured to create a virtual machine and mount the storage units to the virtual machine;

[0015] a test result acquisition unit configured to run a test script corresponding to the test instruction in the virtual machine to perform performance testing on the storage units and obtain corresponding test results.

[0016] In a third aspect, an embodiment of the present application further provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the disk testing method for a virtual machine environment according to the first aspect when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program causes a processor to execute the disk testing method for a virtual machine environment according to the first aspect when the processor executes the computer program.

[0018] The embodiments of the present application provide a disk testing method, device, equipment and medium for a virtual machine environment, which comprises the following steps: configuring a test environment according to a test instruction, configuring a corresponding virtual storage space in a disk space of the test environment according to a protocol rule, allocating system resources to storage units of the virtual storage space, mounting the storage units to a created virtual machine, running a test script corresponding to the test instruction in the virtual machine to perform performance testing on the storage units and obtaining corresponding test results. Through the above method, the virtual storage space containing a plurality of independent storage units can be configured, and the system resources of the storage units are allocated, then the virtual machine mounting the storage units is used to execute the test instruction and perform performance testing on the storage units, thereby improving the efficiency of performance testing on the virtual function of the NVMe disk in the virtual machine environment. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0020] Figure 1 A flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 1.

[0021] Figure 2 A sub-flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 2.

[0022] Figure 3 Another sub-flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 3.

[0023] Figure 4 Another flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 4.

[0024] Figure 5 Still another sub-flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 5.

[0025] Figure 6 A schematic block diagram of a disk testing apparatus for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 6.

[0026] Figure 7 A schematic block diagram of a computer device provided by an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0028] It should be understood that the terms "comprise" and "include" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0029] It should also be understood that the terms used in the present application specification are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0030] It should be further understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items, and that the term "at least one of' as used herein means one, two, three, four, five, six, seven, eight, nine, or more items or things. It should be further understood that the terms "comprise" "comprises" "comprising" "include" "includes" "including" "have" "has" "having" or variants thereof are used synonymously to denote or refer to a combination, interaction or aggregation of one or more items or things that can be collected, grouped or arranged together under 1 or more common attributes, characteristics or properties.

[0031] Referring to Figure 1 , Figure 1 A flowchart of a disk testing method for a virtual machine environment provided by an embodiment of the present application is shown in FIG. 1. The disk testing method for a virtual machine environment is applied to a management server or a cluster server based on a Linux system. The disk testing method for a virtual machine environment is executed by application software installed in the management server or the cluster server. The management server or the cluster server can be used to execute the disk testing method for a virtual machine environment to test the performance of a virtual function of an NVMe disk in a virtual machine environment. The management server and the cluster server can be a server end for data storage and processing, such as a server end constructed in an enterprise or a government department. As shown in FIG. 1, the method includes steps S110-S150. Figure 1

[0032] S110, if a test instruction is received, configuring a test environment according to the test instruction.

[0033] ​If the test instruction is received, the test environment is configured according to the test instruction. The server can receive the test instruction input by the user, and if the test instruction is received, the corresponding test environment is configured for the server according to the test instruction. Specifically, the server can be configured with a test environment corresponding to the test type in the test instruction. For example, the test type is to perform performance testing on the virtual function of the NVMe disk, the BIOS (Basic Input Output System) of the server is controlled to close the VMD (Volume Management Device) function, and the server system is controlled to open the IOMMU (input / output memory management unit) function. Due to the current disclosure of KVM (Kernel-based Virtual Machine), if the VMD is opened, the NVMe disk cannot be found on the interface of the KVM adding PCIE device, the virtual storage unit in the disk cannot be bound with the virtual machine, and thus the configuration of the NVMe disk cannot be realized, so the VMD function needs to be closed during the test process. The IOMMU controls the mapping conversion of the dma (Direct Memory Access) address of each device to the actual physical address, thereby realizing the isolation of the address space of each storage unit in the disk, so that the server can only access a specific storage area. Therefore, in order to realize the isolated use of each virtual storage unit in the disk, the IOMMU must be opened.

[0034] S120, according to the pre-stored protocol rule, a virtual storage space corresponding to the protocol rule is configured in the disk space of the test environment.

[0035] According to a pre-stored protocol rule, a virtual storage space corresponding to the protocol rule is configured in a disk space of the test environment, and the virtual storage space includes a plurality of storage units. The storage units include physical storage units and virtual storage units. According to the protocol rule, a virtual storage space corresponding to the protocol rule can be configured in the disk space of the test environment. Specifically, the disk space is the disk storage space of the NVMe disk assembled by the server and available for testing. For example, the protocol type of the protocol rule is the NVMe protocol, and a plurality of storage units are configured according to the NVMe protocol to form the virtual storage space. The NVMe disk assembled by the server is a disk supporting the SR-IOV function. The SR-IOV (Single Root I / O Virtualization) function disk allows the operating system and hypervisor such as Microsoft's Hyper-V or VMware's ESXi to encapsulate, manage, and even share the disk I / O device of the server, just like the SR-IOV encapsulates the network card device.

[0036] In an embodiment, as shown in FIG. 1, step S120 specifically includes sub-steps S121 and S122. Figure 2

[0037] S121, according to the physical storage configuration parameter in the protocol rule, configuring a corresponding physical storage unit; and S122, according to the virtual storage configuration parameter in the protocol rule, configuring a corresponding virtual storage unit.

[0038] Specifically, the storage units in the virtual storage space can be divided into physical storage units (PF, Physical functions) and virtual storage units (VF, Virtual function). According to the physical storage configuration parameter in the protocol rule, a corresponding physical storage unit can be configured. For example, the physical storage configuration parameter can be the configuration quantity, configuration space, and other parameter information of the physical storage unit. Then, according to the configuration quantity, a corresponding physical storage unit can be configured, and according to the configuration space, a corresponding storage space is allocated to each physical storage unit. Similarly, the virtual storage configuration parameter can be the configuration quantity, configuration space, and other parameter information of the virtual storage unit. Then, according to the virtual storage configuration parameter, a corresponding number of virtual storage units can be configured, and a corresponding storage space is allocated to each virtual storage unit.

[0039] S130, allocating system resources to the storage units in the virtual storage space.

[0040] ​Allocate system resources to the storage units in the virtual storage space. After configuring the virtual storage space, the system resources can also be allocated to each storage unit in the virtual storage space, that is, the system resources of the server are allocated to each storage unit.

[0041] In a specific embodiment, as shown in Figure 3 Step S130 specifically includes sub-steps S131, S132 and S133.

[0042] S131, generate a preset number of namespaces; S132, bind the namespaces to the storage units; S133, configure the queue resources corresponding to the pre-stored resource configuration information to the transmission queues in the storage units.

[0043] Specifically, a preset number of namespaces are first generated, and the capacity of each namespace needs to be configured during the generation of the namespaces. The namespaces are bound to a corresponding number of storage units according to the capacity of the namespaces. The storage units used for binding here are virtual storage units, that is, a corresponding number of virtual storage units are bound to each namespace, and one virtual storage unit can only be bound to one namespace. For example, if the capacity of a namespace is 10, the number of storage units that need to be bound to the namespace is also 10.

[0044] Then, the queue resources corresponding to the resource configuration information need to be configured to the transmission queues in the storage units, and the virtual storage control units in the transmission queues need to be configured with corresponding resources during this process.

[0045] For example, the resource configuration information can be represented as "nvme virt-mgmt / dev / nvme0-c 2-r 0-a 8-n 3"; where -c is the ID of the virtual storage control unit, -r is a specified resource type operation, 0 represents VQ resources, 8 represents SecondaryAssign, which is an action for allocating resources, -r 0-a 8 represents allocating VQ resources; -n is the resource quantity, -c 2-r 0-a 8-n 3 represents allocating 3 VQ resources to the virtual storage control unit with ID 2.

[0046] In a specific embodiment, as shown in Figure 4 Step S132 further includes step S1320 before step S132.

[0047] S1320, configure the read-write characteristic parameters of each storage unit according to the pre-stored parameter configuration information.

[0048] Before the namespace is bound with the storage unit, the read-write characteristic of each storage unit can also be set, specifically, the read-write characteristic includes the read-write limit speed and the read-write type, here the storage unit which the read-write characteristic parameter is configured is also the virtual storage unit. The read-write limit speed is the information which limits the total speed of the read-write of the storage unit, and the read-write type is the information which limits the specific mode of the read-write of the storage unit.

[0049] In a specific embodiment, as shown in FIG. 13, the step S1320 specifically includes sub-steps S1321 and S1322. Figure 5

[0050] S1321, configuring the read-write limit speed of each storage unit according to the speed threshold in the parameter configuration information; S1322, configuring the read-write type of each storage unit according to the type information in the parameter configuration information.

[0051] Specifically, the read-write limit speed of each storage unit can be configured according to the read-write speed threshold, for example, the read-write limit speed of the storage unit can be configured as 40K (read-write IOPS QoS limit is 40K), and the maximum transmission flow per second is 40Kb; further, the read-write type of each storage unit is configured according to the type information.

[0052] For example, the read-write limit speed is 40K, which is expressed in hexadecimal as 28, then the corresponding parameter can be set as “-cdw14=0x80000028”; the parameter configuration of the read-write type can be expressed as “-cdw13=0x10003”, wherein 0 represents the read-write bandwidth, 1 represents the write bandwidth, 2 represents the read bandwidth, 3 represents the read-write IOPS, 4 represents the write IOPS, and 5 represents the read IOPS.

[0053] S140, creating a virtual machine and mounting the storage unit to the virtual machine.

[0054] After the system resource allocation of the storage unit in the virtual storage space is completed, the virtual machine can be created in the server, specifically, the corresponding virtual machine can be created by using the system virtualization tool KVM, and each storage unit in the virtual storage space can be mounted to the virtual machine, for example, the physical storage unit (PF) and the virtual storage unit (VF) can be added to a certain VM virtual machine (VMware Workstation) in the KVM visualized graphical interface.

[0055] S150, running the test script corresponding to the test instruction in the virtual machine to perform performance test on the storage unit, and obtaining the corresponding test result.

[0056] ​The virtual machine runs a test script corresponding to the test instruction to perform performance testing on the storage unit, and a corresponding test result is obtained. After the storage unit is mounted to the virtual machine, the corresponding test script can be run in the virtual machine. For example, the fio script tool can be used to perform performance testing on the physical storage unit (PF) and the virtual storage unit (VF) in the virtual machine. That is, the test instruction can be executed by the virtual machine mounted with the storage unit to perform performance testing on the storage unit, thereby improving the efficiency of performance testing on the virtual function of the NVMe disk in the virtual machine environment.

[0057] In the method for testing a disk in a virtual machine environment provided in the embodiments of the present application, the method comprises: configuring a test environment according to a test instruction, configuring a corresponding virtual storage space in a disk space of the test environment according to a protocol rule, allocating system resources to a storage unit of the virtual storage space, mounting the storage unit to a created virtual machine, and running a test script corresponding to the test instruction through the virtual machine to perform performance testing on the storage unit and obtain a corresponding test result. Through the above method, the virtual storage space containing multiple storage units independent of each other can be configured, and the system resources of the storage unit can be allocated. Then, the test instruction can be executed by the virtual machine mounted with the storage unit to perform performance testing on the storage unit, thereby improving the efficiency of performance testing on the virtual function of the NVMe disk in the virtual machine environment.

[0058] The embodiments of the present application also provide a disk testing device for a virtual machine environment. The disk testing device for a virtual machine environment can be configured in a management server or a cluster server. The disk testing device for a virtual machine environment is used to execute any of the above-mentioned embodiments of the method for testing a disk in a virtual machine environment. Specifically, refer to Figure 6 , Figure 6 The schematic block diagram of the disk testing device for a virtual machine environment provided in the embodiments of the present application is shown in the figure.

[0059] As Figure 6 shown, the disk testing device for a virtual machine environment 100 comprises a test environment configuration unit 110, a virtual storage space configuration unit 120, a system resource allocation unit 130, a storage unit mounting unit 140, and a test result acquisition unit 150.

[0060] The test environment configuration unit 110 is used to configure a test environment according to a test instruction if the test instruction is received.

[0061] The virtual storage space configuration unit 120 is used to configure a virtual storage space corresponding to a protocol rule in a disk space of the test environment according to the pre-stored protocol rule. The virtual storage space comprises multiple storage units.

[0062] In a specific embodiment, the storage unit includes a physical storage unit and a virtual storage unit, and the virtual storage space configuration unit 120 includes: a physical storage unit configuration unit configured to configure a corresponding physical storage unit according to a physical storage configuration parameter in the protocol rule; and a virtual storage unit configuration unit configured to configure a corresponding virtual storage unit according to a virtual storage configuration parameter in the protocol rule.

[0063] The system resource allocation unit 130 is configured to allocate system resources to the storage unit in the virtual storage space.

[0064] In a specific embodiment, the system resource allocation unit includes: a namespace generation unit configured to generate a preset number of namespaces; a binding unit configured to bind the namespaces to the storage unit; and queue resource configuration information configured to configure a transmission queue in the storage unit with a queue resource corresponding to pre-stored resource configuration information.

[0065] In a specific embodiment, the system resource allocation unit further includes a read-write characteristic parameter configuration unit configured to configure a read-write characteristic parameter of each storage unit according to pre-stored parameter configuration information.

[0066] In a specific embodiment, the read-write characteristic parameter configuration unit includes: a read-write limit speed configuration unit configured to configure a read-write limit speed of each storage unit according to a speed threshold in the parameter configuration information; and a read-write type configuration unit configured to configure a read-write type of each storage unit according to type information in the parameter configuration information.

[0067] The storage unit mounting unit 140 is configured to create a virtual machine and mount the storage unit to the virtual machine.

[0068] The test result acquisition unit 150 is configured to run a test script corresponding to the test instruction to perform performance testing on the storage unit, and obtain a corresponding test result.

[0069] The disk testing device for a virtual machine environment provided in the embodiment of the present application applies the above-mentioned disk testing method for a virtual machine environment, and the method comprises the following steps: configuring a test environment according to a test instruction, configuring a corresponding virtual storage space in the disk space of the test environment according to a protocol rule, allocating system resources to a storage unit of the virtual storage space, and mounting the storage unit to a created virtual machine, running a test script corresponding to the test instruction through the virtual machine to perform performance testing on the storage unit and obtain a corresponding test result. Through the above-mentioned method, the virtual storage space containing a plurality of storage units independent of each other can be configured, and the system resources of the storage units are allocated, and then the virtual machine mounting the storage unit is used to execute the test instruction and perform performance testing on the storage unit, thereby improving the efficiency of performance testing on the virtual function of the NVMe disk in the virtual machine environment.

[0070] The above-mentioned disk testing device for a virtual machine environment can be implemented in the form of a computer program, which can run on a computer device as shown in the accompanying drawings. Figure 7

[0071] Please refer to Figure 7 , Figure 7 is a schematic block diagram of the computer device provided in the embodiment of the present application. The computer device can be a management server or a cluster server for executing the disk testing method for a virtual machine environment to perform performance testing on the virtual function of the NVMe disk in the virtual machine environment.

[0072] Please refer to Figure 7 , the computer device 500 comprises a processor 502, a memory and a network interface 505 connected through a system bus 501, wherein the memory can comprise a storage medium 503 and an internal memory 504.

[0073] The storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute the disk testing method for a virtual machine environment, wherein the storage medium 503 can be a volatile storage medium or a non-volatile storage medium.

[0074] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.

[0075] The internal memory 504 provides an environment for the running of the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can execute the disk testing method for a virtual machine environment.

[0076] The network interface 505 is used for network communication, such as providing transmission of data information, etc. Those skilled in the art can understand that Figure 7 ​The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0077] The processor 502 is configured to run the computer program 5032 stored in the memory, so as to implement the corresponding functions in the above-described disk testing method for a virtual machine environment.

[0078] Those skilled in the art can understand that Figure 7 The embodiment of the computer device shown in the figure does not constitute a limitation on the specific structure of the computer device. In other embodiments, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. For example, in some embodiments, the computer device can only include the memory and the processor. In such embodiments, the structure and functions of the memory and the processor are consistent with those of the memory 502 and the processor 502 in the embodiment shown in the figure, and will not be described here. Figure 7

[0079] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and the processor 502 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0080] In another embodiment of the present application, a computer readable storage medium is provided. The computer readable storage medium can be a volatile or non-volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the steps included in the above-described disk testing method for a virtual machine environment.

[0081] ​Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the devices, apparatuses and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here. Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in the foregoing description in terms of its general functionality, without regard to its specific combination of hardware and software. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0082] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic, for example, the division of the units is merely logical functional division, and actual implementation can have another division, or units with the same function can be combined into one unit, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other form of connection.

[0083] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0084] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or software functional unit.

[0085] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a computer readable storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned computer readable storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0086] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for disk testing in a virtual machine environment, characterized by, The method comprises: if a test instruction is received, configuring a test environment according to the test instruction; configuring a virtual storage space corresponding to a pre-stored protocol rule in a disk space of the test environment according to the protocol rule; the virtual storage space comprises a plurality of storage units; allocating system resources for the storage units in the virtual storage space; creating a virtual machine and mounting the storage units to the virtual machine; running a test script corresponding to the test instruction in the virtual machine to perform performance testing on the storage units, to obtain corresponding test results; the allocating system resources for the storage units in the virtual storage space comprises: generating a preset number of namespaces; binding the namespaces to the storage units; configuring queue resources corresponding to pre-stored resource configuration information for a transmission queue in the storage units.

2. The method for testing a disk for a virtual machine environment according to claim 1, wherein, The storage units comprise physical storage units and virtual storage units, and configuring a virtual storage space corresponding to a pre-stored protocol rule in a disk space of the test environment comprises: configuring corresponding physical storage units according to physical storage configuration parameters in the protocol rule; configuring corresponding virtual storage units according to virtual storage configuration parameters in the protocol rule.

3. The method for testing a disk for a virtual machine environment of claim 1, wherein, Before the binding the namespaces to the storage units, the method further comprises: configuring read-write characteristic parameters of the storage units according to pre-stored parameter configuration information.

4. The method for testing a disk for a virtual machine environment according to claim 3, wherein, The read-write characteristics comprise read-write limit speeds and read-write types, and the configuring read-write characteristic parameters of the storage units according to the pre-stored parameter configuration information comprises: configuring read-write limit speeds of the storage units according to speed threshold values in the parameter configuration information; configuring read-write types of the storage units according to type information in the parameter configuration information.

5. A disk testing apparatus for a virtual machine environment, characterized by, The device comprises: a test environment configuration unit, configured to configure a test environment according to a test instruction if the test instruction is received; a virtual storage space configuration unit, configured to configure a virtual storage space corresponding to a pre-stored protocol rule in a disk space of the test environment according to the protocol rule; the virtual storage space comprises a plurality of storage units; a system resource allocation unit, configured to allocate system resources for the storage units in the virtual storage space; a storage unit mounting unit, configured to create a virtual machine and mount the storage units to the virtual machine; a test result acquisition unit, configured to run a test script corresponding to the test instruction in the virtual machine to perform performance testing on the storage units, to obtain corresponding test results; the system resource allocation unit comprises: a namespace generation unit, configured to generate a preset number of namespaces; a binding unit, configured to bind the namespaces to the storage units; queue resource configuration information, configured to configure queue resources corresponding to pre-stored resource configuration information for a transmission queue in the storage units.

6. The disk testing apparatus for a virtual machine environment according to claim 5, wherein, The storage units comprise physical storage units and virtual storage units, and the virtual storage space configuration unit comprises: a physical storage unit configuration unit, configured to configure corresponding physical storage units according to physical storage configuration parameters in the protocol rule; a virtual storage unit configuration unit, configured to configure corresponding virtual storage units according to virtual storage configuration parameters in the protocol rule. A virtual storage unit configuration unit is configured to configure a corresponding virtual storage unit according to a virtual storage configuration parameter in the protocol rule.

7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the disk testing method for a virtual machine environment as claimed in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the disk testing method for a virtual machine environment as claimed in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Solid state disk performance test method, device and equipment and storage medium

    CN111063387A