Automated testing method, device and system for multi-virtual machine load of solid state drive

By automatically detecting and configuring virtual machine resources, it solves the tedious preparation process and resource waste problems in virtual machine load testing, achieves efficient testing processes and resource utilization, and is suitable for multi-virtual machine scenarios.

CN114780207BActive Publication Date: 2024-10-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210468944.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2024-10-18
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

In virtual machine load testing, existing technology requires manual creation and configuration of multiple virtual machines, resulting in a cumbersome test preparation phase and non-adaptive resource configuration, which wastes time and resources.

Method used

Provides an automated multi-virtual machine load testing method for solid-state drives. By automatically detecting the number of virtual machines, adaptively creating NVMe solid-state drive namespaces and PCIe devices, maximizing the allocation of queue and interrupt resources, automatic mapping and testing, and simplifying the testing process .

Benefits of technology

Significantly save testing manpower, improve testing efficiency, ensure full utilization of resources, adapt to different testing scenarios, and simplify test preparation and execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780207B_ABST
    Figure CN114780207B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of virtual machine load testing, and specifically provides a method, device, and system for automated testing of multi-virtual machine loads of a solid-state hard disk. The method comprises the following steps: after the virtual machine is created, the number of online virtual machines is automatically detected to adaptively create a namespace for an NVMe solid-state hard disk; including the number and size value of the namespace; a virtual PCIe device is created according to the size value of the created namespace, and queue interrupt resources are allocated to the virtual PCIe device to the maximum extent; after the virtual PCIe device is created, it is automatically mapped to the virtual machine; after the virtual PCIe device is detected on the virtual machine side, a test program is uploaded and the test is started. After the test is completed, the virtual state is restored, and the test record is downloaded and a test analysis is generated. By automatically configuring programs for virtual machines, automatically testing, and uploading test logs, test manpower is greatly saved and test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtual machine load testing, and in particular to an automated testing method, device and system for multi-virtual machine loads of a solid state drive. Background Art

[0002] SR-IOV is a hardware I / O virtualization technology standard. As a hardware I / O virtualization solution, SR-IOV defines that I / O devices are natively shareable. One SR-IOV device can create multiple VF virtual devices. These virtual devices are assigned to different virtual machines to achieve the sharing of physical hardware. The combination of NVMe SSD and SR-IOV can share physical resources in multiple virtual machines and give full play to the high performance of SSD. Especially in virtualization and cloud computing scenarios, the virtualization technology of SR-IOV can reduce the number of PCIe devices required by customers. At the same time, the multi-namespace management implemented by NVMe SSD and different namespaces are assigned to different virtual hosts to achieve mutual isolation of data IO and QoS performance guarantee.

[0003] Usually, in the R&D stage, it is necessary to map the virtual hard disk after the virtual machine is established to test the program. Generally, multiple virtual machines are built at the same time for testing, and virtual PCIe devices are allocated to the virtual machines. Currently, virtual machines are generally built on the host through KVM. After the construction is completed, multiple namespaces are created on the host, and virtual PCIe devices are created. Queues and interrupt resources are allocated to the PCIe devices, and then the virtual machines are logged in to perform relevant tests. The entire test process switches back and forth between the host and each virtual machine. If the hardware conditions of the host machine are met, dozens or even hundreds of virtual machines can be built. On so many virtual machines, if you switch back and forth between the host and each virtual machine one by one through the interface, it is very time-consuming. When the virtual machine changes or the test program changes, the NVMe disk needs to recreate the namespace, reallocate the virtual device, log in to the virtual machine again, and modify and run the test program. The entire test preparation stage becomes very cumbersome. In addition, the queues and interrupt resources allocated to the virtual PCIe cannot adaptively achieve the optimal configuration, which wastes resources. Summary of the invention

[0004] When the virtual machine or the test program changes, the NVMe disk needs to recreate the namespace, reallocate the virtual device, re-login to the virtual machine, and modify and run the test program. The entire test preparation phase becomes very cumbersome. In addition, the queues and interrupt resources allocated to the virtual PCIe cannot adaptively achieve the optimal configuration, wasting resources. The present invention provides an automated testing method, device, and system for multi-virtual machine loads of solid-state hard disks.

[0005] The technical solution of the present invention is:

[0006] In a first aspect, the technical solution of the present invention provides an automated testing method for multi-virtual machine loads of a solid state drive, comprising the following steps:

[0007] After the virtual machine is created, the number of online virtual machines is automatically detected and the namespace of the NVMe SSD is adaptively created, including the number and size of the namespace;

[0008] Create a virtual PCIe device according to the size value of the created namespace, and allocate queue interrupt resources to the virtual PCIe device to the maximum extent possible;

[0009] After the virtual PCIe device is created, it is automatically mapped to the virtual machine;

[0010] After the virtual PCIe device is detected on the virtual machine side, the test program is uploaded and the test is started.

[0011] By automatically configuring programs and performing tests for virtual machines, testing manpower is greatly saved and testing efficiency is improved.

[0012] Further, after detecting that a virtual PCIe device is found on the virtual machine side and the test program is uploaded, the step of starting the test also includes:

[0013] After the test is completed, the virtual state is restored and the test records are downloaded and test analysis is generated.

[0014] Start automatic detection and automatic testing for each virtual machine, and automatically upload test records to save testing time.

[0015] Furthermore, after the virtual machine is created, the steps of automatically detecting the number of online virtual machines and adaptively creating a namespace for the NVMe solid-state drive include:

[0016] After the virtual machine is created, the online virtual machine is detected through the KVM command, and the information of all virtual machines is recorded in the virtual machine test status table;

[0017] Obtain the number and names of online virtual machines according to the virtual machine test status table;

[0018] Create the optimal number and size of NVMe SSD namespaces based on the number of online VMs.

[0019] Automatically detect the number of online virtual machines and fully allocate disk capacity based on the number of online virtual machines.

[0020] Further, the steps of creating a virtual PCIe device according to the size value of the created namespace and maximally allocating queue interrupt resources to the virtual PCIe device include:

[0021] Create a virtual PCIe device based on the size value of the namespace;

[0022] Get the maximum number of queues and interrupt resources supported by the NVMe SSD, and allocate them to each virtual PCIe device; the allocation adopts average allocation or customized allocation, and specifies the specific number of queues and interrupt resources for the virtual PCIe device.

[0023] It can adaptively create the largest namespace capacity and allocate the most queues and interrupt resources to virtual PCIe devices; it can also adopt a customized mode to customize the namespace capacity and allocated resources. While ensuring efficiency, it covers different test scenarios.

[0024] Furthermore, after the virtual PCIe device is created, the steps of automatically mapping it to the virtual machine include:

[0025] After the virtual PCIe device is created, assign the virtual PCIe device to each virtual machine;

[0026] According to the name of the virtual machine, obtain the MAC address list of each virtual machine with the name, and convert the MAC address list into an IP address list.

[0027] After the virtual machine is established, the automatic discovery program will detect the online virtual machine through KVM instructions and record all virtual machine related information such as IP and MAC addresses to the virtual machine test status table.

[0028] Further, after the virtual PCIe device is found on the virtual machine side, the test program is uploaded and the test is started, and the steps of starting the test include:

[0029] After obtaining the IP address list of the virtual machine, log in to the virtual machine and check whether the virtual PCIe device is found on the virtual machine. If found, import the test program into the virtual machine;

[0030] Start the test and set the virtual machine being tested to "Testing" in the virtual machine test status table.

[0031] It will periodically check whether new virtual machines are created. If new virtual machines are created, the virtual machine test status table will be updated and the status will be set to "Not Started".

[0032] Furthermore, the step of importing the test program into the virtual machine includes:

[0033] Import the test program into the virtual machine, and set the virtual machine with the uploaded test program to "Test program imported" in the virtual machine status table.

[0034] Further, after the test is completed, the steps of restoring the virtual state and downloading the test record and generating the test analysis include:

[0035] After the test is completed, upload the test log and update the virtual machine test status table to "Test Completed";

[0036] Unmap the virtual machine and restore the virtual machine to its original state;

[0037] Export the test results of the corresponding virtual machine at the corresponding time node, making the test results clear at a glance.

[0038] In a second aspect, the technical solution of the present invention provides an automated testing device for multi-virtual machine loads of a solid-state hard disk, including a detection creation module, a configuration module, an allocation module, and a detection startup module;

[0039] The detection and creation module is used to automatically detect the number of online virtual machines after the virtual machine is created and adaptively create the namespace of the NVMe solid-state drive; it includes the number and size of the namespace;

[0040] The configuration module creates a virtual PCIe device according to the size value of the created namespace and allocates queue interrupt resources to the virtual PCIe device to the maximum extent possible.

[0041] The allocation module automatically maps the virtual PCIe device to the virtual machine after it is created.

[0042] The detection startup module is used to detect that after a virtual PCIe device is found on the virtual machine side, the test program is uploaded and the test is started.

[0043] Furthermore, the device also includes a post-test module, which is used to restore the virtual state and download the test records and generate test analysis after the test is completed.

[0044] Start automatic detection and automatic testing for each virtual machine, and automatically upload test records to save testing time.

[0045] Further, the detection creation module includes a detection recording unit, an acquisition unit, and a resource creation unit;

[0046] A detection and recording unit is used to detect online virtual machines through KVM instructions after the virtual machine is created, and record the information of all virtual machines into the virtual machine test status table;

[0047] An acquisition unit, used for acquiring the number and names of online virtual machines according to the virtual machine test status table;

[0048] The resource creation unit is used to create the optimal number and size of NVMe solid-state drive namespaces according to the number of online virtual machines.

[0049] Automatically detect the number of online virtual machines and fully allocate disk capacity based on the number of online virtual machines.

[0050] Further, the configuration module includes a virtual device creation unit and a resource configuration unit;

[0051] A virtual device creation unit, used to create a virtual PCIe device according to the size value of the namespace;

[0052] The resource configuration unit is used to obtain the maximum number of queues and interrupt resources supported by the NVMe SSD and allocate them to each virtual PCIe device; wherein the allocation adopts average allocation or customized allocation to specify the specific number of queues and interrupt resources for the virtual PCIe device.

[0053] It can adaptively create the largest namespace capacity and allocate the most queues and interrupt resources to virtual PCIe devices; it can also adopt a customized mode to customize the namespace capacity and allocated resources. While ensuring efficiency, it covers different test scenarios.

[0054] Further, the allocation module includes an allocation unit and a list generation unit;

[0055] The allocation unit is used to allocate the virtual PCIe device to each virtual machine after the virtual PCIe device is created;

[0056] The list generating unit is used to obtain the MAC address list of each virtual machine with the name according to the name of the virtual machine, and convert the MAC address list into an IP address list.

[0057] After the virtual machine is established, the automatic discovery program will detect the online virtual machine through KVM instructions and record all virtual machine related information such as IP and MAC addresses to the virtual machine test status table.

[0058] Further, the detection startup module includes a detection import unit, a startup test unit and a virtual machine test status table setting unit;

[0059] The detection import unit is used to obtain the IP address list of the virtual machine, log in to the virtual machine, and detect whether the virtual PCIe device is found on the virtual machine. If found, the test program is imported into the virtual machine;

[0060] Start the test unit, which is used to start the virtual machine test;

[0061] The virtual machine test status table setting unit is used to set the virtual machine under test as "under test" in the virtual machine test status table; it is also used to set the virtual machine to which the test program has been uploaded as "imported test program" in the virtual machine status table when the detection import unit imports the test program into the virtual machine.

[0062] The detection import unit will periodically detect whether a new virtual machine is created. If a new virtual machine is created, the virtual machine test status table will be updated and the status will be set to "not started".

[0063] Furthermore, the test post-module includes a test log uploading unit, a state recovery unit, and a test result exporting unit;

[0064] The test log uploading unit is used to upload the test log after the test is completed, and at the same time, the virtual machine test status table setting unit updates the virtual machine test status table to "test completed";

[0065] A state recovery unit, used to cancel the mapping of the virtual machine and restore the initial state of the virtual machine;

[0066] The test result export unit is used to export the test results of the corresponding virtual machine at the corresponding time node, making the test results clear at a glance.

[0067] In a third aspect, the present invention further provides an automated testing system for multi-virtual machine loads of a solid-state hard disk, including a host machine, on which a testing device is provided; after a virtual machine is created on the host machine, the testing device is started to perform a virtual machine test; the testing device is the automated testing device for multi-virtual machine loads of a solid-state hard disk described in the second aspect;

[0068] After the virtual machine test is completed, the test device will cancel the mapping of the virtual machine and restore the initial state of the virtual machine.

[0069] It can be seen from the above technical solutions that the present invention has the following advantages: adaptive allocation of resources to ensure full utilization of scarce test resources, such as fully allocating disk capacity and virtual PCIe devices based on the number of online virtual machines, and allocating the largest queue and interrupt resources for the devices; a customized mode can also be adopted to customize the capacity of the namespace creation and the number of resources allocated to the virtual PCIe devices, thereby meeting the test requirements of different test scenarios and improving test coverage; the device greatly saves test manpower and improves test efficiency by automatically configuring programs for virtual machines, automatically testing, and uploading test logs.

[0070] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect.

[0071] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the embodiments of the present invention 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0073] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0074] Figure 2 is a schematic block diagram of an apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION

[0075] Usually, in the R&D stage, it is necessary to map the virtual hard disk after the virtual machine is established to test the program. Generally, multiple virtual machines are built at the same time for testing, and virtual PCIe devices are allocated to the virtual machines. Currently, virtual machines are generally built on the host through KVM. After the construction is completed, multiple namespaces are created on the host, and virtual PCIe devices are created. Queues and interrupt resources are allocated to the PCIe devices, and then the virtual machines are logged in to perform relevant tests. The entire test process switches back and forth between the host and each virtual machine. If the hardware conditions of the host machine are met, dozens or even hundreds of virtual machines can be built. On so many virtual machines, if you switch back and forth between the host and each virtual machine one by one through the interface, it is very time-consuming. When the virtual machine changes or the test program changes, the NVMe disk needs to recreate the namespace, reallocate the virtual device, log in to the virtual machine again, and modify and run the test program. The entire test preparation stage becomes very cumbersome. In addition, the queues and interrupt resources allocated to the virtual PCIe cannot adaptively achieve the optimal configuration, which wastes resources. In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0076] like Figure 1 As shown, an embodiment of the present invention provides an automated testing method for multi-virtual machine loads of a solid state drive, comprising the following steps:

[0077] Step 1: After the virtual machine is created, the number of online virtual machines is automatically detected and the namespace of the NVMe SSD is adaptively created, including the number and size of the namespace;

[0078] Step 2: Create a virtual PCIe device according to the size value of the created namespace, and allocate queue interrupt resources to the virtual PCIe device to the maximum extent possible;

[0079] Step 3: After the virtual PCIe device is created, it is automatically mapped to the virtual machine;

[0080] This process actually allocates the created virtual PCIe device to each virtual machine;

[0081] Step 4: After detecting the virtual PCIe device on the virtual machine side, start uploading the test program and start the test.

[0082] Automatically detect the number of online virtual machines, adaptively create the namespace of the NVMe SSD disk, create a virtual PCIe device, and maximize the allocation of queue interrupt resources to the virtual PCIe device; after the virtual PCIe device is created, it is automatically mapped to the virtual machine, and the timely detection mechanism is started. After the virtual PCIe device is discovered on the virtual machine side, the host starts uploading the test program and starts the test. By automatically configuring programs for virtual machines and automatically testing, testing manpower is greatly saved and testing efficiency is improved.

[0083] In some embodiments, the method further comprises:

[0084] Step 5: After the test is completed, restore the virtual state and download the test records and generate test analysis.

[0085] Automatic detection and automatic testing are enabled for each virtual machine, and test records are automatically uploaded to save test time. Taking performance testing as an example, by analyzing the test logs, key parameters such as bandwidth, iops, latency, etc. are identified, and the test results are clear at a glance.

[0086] In some embodiments, in step 1, after the virtual machine is created, the step of automatically detecting the number of online virtual machines and adaptively creating a namespace for the NVMe solid-state drive includes:

[0087] Step 11: After the virtual machine is created, the online virtual machine is detected through the KVM command, and the information of all virtual machines is recorded in the virtual machine test status table;

[0088] Step 12: Obtain the number and names of online virtual machines according to the virtual machine test status table;

[0089] Step 13: Create the optimal number and size of NVMe SSD namespaces based on the number of online virtual machines. The number of namespaces can correspond to the value of num. For example, if one virtual machine corresponds to one namespace, the disk capacity is 7.68T, and the average capacity allocated to each virtual PCIe device is 153G; you can also use a customized mode to customize the capacity of the namespace.

[0090] Automatically detect the number of online virtual machines and fully allocate disk capacity based on the number of online virtual machines.

[0091] In some embodiments, in step 2, the steps of creating a virtual PCIe device according to the size value of the created namespace and maximizing the allocation of queue interrupt resources to the virtual PCIe device include:

[0092] Step 21: Create a virtual PCIe device according to the size value of the namespace;

[0093] Step 22: Obtain the maximum number of queues and interrupt resources supported by the NVMe SSD, and allocate them to each virtual PCIe device; wherein the allocation adopts average allocation or customized allocation, and specifies the specific number of queues and interrupt resources for the virtual PCIe device.

[0094] It can adaptively create the largest namespace capacity and allocate the most queues and interrupt resources to virtual PCIe devices; it can also adopt a customized mode to customize the namespace capacity and allocated resources. While ensuring efficiency, it covers different test scenarios.

[0095] In some embodiments, in step 3, after the virtual PCIe device is created, the step of automatically mapping it to the virtual machine includes:

[0096] Step 31: After the virtual PCIe device is created, assign the virtual PCIe device to each virtual machine;

[0097] Step 32: According to the name of the virtual machine, obtain the MAC address list of each virtual machine with the name, and convert the MAC address list into an IP address list.

[0098] After the virtual machine is established, the automatic discovery program will detect the online virtual machine through KVM instructions and record all virtual machine related information such as IP and MAC addresses to the virtual machine test status table.

[0099] In some embodiments, in step 4, the steps of uploading a test program after detecting that a virtual PCIe device is found on the virtual machine side and starting the test include:

[0100] Step 41: After obtaining the IP address list of the virtual machine, log in to the virtual machine and detect whether the virtual PCIe device is found on the virtual machine. If found, import the test program into the virtual machine;

[0101] Step 42: Start the test and set the virtual machine being tested as "under testing" in the virtual machine test status table.

[0102] It will periodically check whether new virtual machines are created. If new virtual machines are created, the virtual machine test status table will be updated and the status will be set to "Not Started".

[0103] It should be noted that the steps of importing the test program into the virtual machine include:

[0104] Import the test program into the virtual machine, and set the virtual machine with the uploaded test program to "Test program imported" in the virtual machine status table.

[0105] In some embodiments, in step 5, after the test is completed, the steps of restoring the virtual state and downloading the test record and generating the test analysis include:

[0106] Step 51: After the test is completed, upload the test log and update the virtual machine test status table to "test completed";

[0107] Step 52: cancel the mapping of the virtual machine and restore the initial state of the virtual machine;

[0108] Step 53: Export the test results of the corresponding virtual machines at the corresponding time nodes, so that the test results are clear at a glance.

[0109] Automatically detect the number of online virtual machines, and fully allocate the disk capacity according to the number of online virtual machines. It can adaptively create the largest namespace capacity and allocate the most queues and interrupt resources for virtual PCIe devices. It can also adopt a customized mode to customize the namespace capacity and allocated resources. While ensuring efficiency, it covers different test scenarios. Start the background mechanism for each virtual machine, which includes automatic detection, automatic testing, and automatic upload of test records.

[0110] like Figure 2 As shown, an embodiment of the present invention provides an automated testing device for multi-virtual machine loads of a solid state drive, including a detection creation module, a configuration module, an allocation module, and a detection startup module;

[0111] The detection and creation module is used to automatically detect the number of online virtual machines after the virtual machine is created and adaptively create the namespace of the NVMe solid-state drive; it includes the number and size of the namespace;

[0112] The configuration module creates a virtual PCIe device according to the size value of the created namespace and allocates queue interrupt resources to the virtual PCIe device to the maximum extent possible.

[0113] The allocation module automatically maps the virtual PCIe device to the virtual machine after it is created.

[0114] The detection startup module is used to detect that after a virtual PCIe device is found on the virtual machine side, the test program is uploaded and the test is started.

[0115] In some embodiments, the device further includes a post-test module for restoring the virtual state and downloading the test records and generating test analysis after the test is completed.

[0116] Start automatic detection and automatic testing for each virtual machine, and automatically upload test records to save testing time.

[0117] In some embodiments, the detection creation module includes a detection recording unit, an acquisition unit, and a resource creation unit;

[0118] A detection and recording unit is used to detect online virtual machines through KVM instructions after the virtual machine is created, and record the information of all virtual machines into the virtual machine test status table;

[0119] An acquisition unit, used for acquiring the number and names of online virtual machines according to the virtual machine test status table;

[0120] The resource creation unit is used to create the optimal number and size of NVMe solid-state drive namespaces according to the number of online virtual machines.

[0121] Automatically detect the number of online virtual machines and fully allocate disk capacity based on the number of online virtual machines.

[0122] In some embodiments, the configuration module includes a virtual device creation unit and a resource configuration unit;

[0123] A virtual device creation unit, used to create a virtual PCIe device according to the size value of the namespace;

[0124] The resource configuration unit is used to obtain the maximum number of queues and interrupt resources supported by the NVMe SSD and allocate them to each virtual PCIe device; wherein the allocation adopts average allocation or customized allocation to specify the specific number of queues and interrupt resources for the virtual PCIe device.

[0125] It can adaptively create the largest namespace capacity and allocate the most queues and interrupt resources to virtual PCIe devices; it can also adopt a customized mode to customize the namespace capacity and allocated resources. While ensuring efficiency, it covers different test scenarios.

[0126] In some embodiments, the allocation module includes an allocation unit and a list generation unit;

[0127] The allocation unit is used to allocate the virtual PCIe device to each virtual machine after the virtual PCIe device is created;

[0128] The list generating unit is used to obtain the MAC address list of each virtual machine with the name according to the name of the virtual machine, and convert the MAC address list into an IP address list.

[0129] After the virtual machine is established, the automatic discovery program will detect the online virtual machine through KVM instructions and record all virtual machine related information such as IP and MAC addresses to the virtual machine test status table.

[0130] In some embodiments, the detection startup module includes a detection import unit, a startup test unit, and a virtual machine test status table setting unit;

[0131] The detection import unit is used to obtain the IP address list of the virtual machine, log in to the virtual machine, and detect whether the virtual PCIe device is found on the virtual machine. If found, the test program is imported into the virtual machine;

[0132] Start the test unit, which is used to start the virtual machine test;

[0133] The virtual machine test status table setting unit is used to set the virtual machine under test as "under test" in the virtual machine test status table; it is also used to set the virtual machine to which the test program has been uploaded as "imported test program" in the virtual machine status table when the detection import unit imports the test program into the virtual machine.

[0134] The detection import unit will periodically detect whether a new virtual machine is created. If a new virtual machine is created, the virtual machine test status table will be updated and the status will be set to "not started".

[0135] In some embodiments, the test post-module includes a test log uploading unit, a state recovery unit, and a test result exporting unit;

[0136] The test log uploading unit is used to upload the test log after the test is completed, and at the same time, the virtual machine test status table setting unit updates the virtual machine test status table to "test completed";

[0137] A state recovery unit, used to cancel the mapping of the virtual machine and restore the initial state of the virtual machine;

[0138] The test result export unit is used to export the test results of the corresponding virtual machine at the corresponding time node, making the test results clear at a glance.

[0139] In the test device, the number of online virtual machines is automatically detected. According to the number of online virtual machines, the disk capacity is fully allocated. The maximum namespace capacity can be adaptively created to allocate the most queues and interrupt resources to virtual PCIe devices. Customized modes can also be used to customize the namespace capacity and allocated resources. While ensuring efficiency, different test scenarios are covered. In the test device, a background mechanism is started for each virtual machine, which includes automatic detection, automatic testing, and automatic uploading of test records. The test device has a one-click analysis function. This function makes the test results clear at a glance.

[0140] An embodiment of the present invention also provides an automated testing system for multi-virtual machine loads of a solid-state hard disk, including a host machine, on which a testing device is provided; after the virtual machine is created on the host machine, the testing device is started to perform a virtual machine test; after the testing device is started, a virtual machine test status table will be maintained to record all detected virtual machines and the status of each virtual machine test.

[0141] After the virtual machine is established, the automatic discovery program will detect the online virtual machine through KVM instructions, and record all virtual machine related information such as IP and MAC addresses to the virtual machine test status table, and set the test status of each virtual machine to "Not Started". The automatic discovery program will periodically detect whether a new virtual machine is established. If a new virtual machine is established, the virtual machine test status table will be updated and the status will be set to "Not Started".

[0142] The working process of the test device is as follows:

[0143] 1. Execute virsh list to obtain the number num and name sName of online virtual machines;

[0144] 2. According to the value of num, execute the nvme CLI command: nvme create to create the optimal number and size of NVMe SSD namespaces. The number of namespaces can correspond to the value of num. For example, if one virtual machine corresponds to one namespace, the disk capacity is 7.68T, and the average capacity allocated to each virtual PCIe device is 153G; you can also use the customized mode to customize the capacity size of namespce.

[0145] 3. According to the value of namespace, modify the value of sriov_numbvfs, that is, turn on the SR IOV function and create a virtual PCIe device. The value of namespace is generally consistent with the virtual PCIe device;

[0146] 4. Get the maximum number of queues and interrupt resources supported by the NVMe SSD and distribute them evenly to each virtual PCIe device; you can also use a customized mode to specify the specific number of queues and interrupt resources for the virtual PCIe device.

[0147] 5. Allocate the virtual PCIe device to each virtual machine;

[0148] 6. According to sNmae, execute the virsh dumpxml command to obtain the mac address list of each SName virtual machine, and convert the mac address list into an ip address list;

[0149] 7. After the test device gets the IP list of the virtual machine, it will start a background process for each virtual machine, log in to the virtual machine in the process, and start the timely detection mechanism to detect whether the virtual PCIe device is found on the virtual machine. Once found, the test device starts to upload the test program to the virtual machine; the test device sets the virtual machine with the uploaded test program as "Imported test program" in the status table. Before this, it is "Prepare for test".

[0150] 8. After the test program is uploaded to the virtual machine, the test of the execution program is started in the background process of each virtual machine; the test device sets the virtual machine being tested as "under testing" in the status table.

[0151] 9. In the background process started by the test device for the virtual machine, it regularly checks whether the test program has been executed. Once the execution is completed, the upload of the test log is started. After the upload is successful, the test device will update the virtual machine test status table to "test completed".

[0152] 10. After the virtual machine test is completed, the test device will cancel the VF mapping and restore the virtual machine to its original state.

[0153] 11. The test device is designed with the function of generating test reports. Users can select this function at any time to export the test results of the corresponding time node and the corresponding virtual machine. Taking performance testing as an example, by analyzing the test log, key parameters such as bandwidth, iops, latency, etc. are identified, and the test results are clear at a glance.

[0154] The test device in this embodiment runs on the host machine. If the hardware conditions of the host machine are met, dozens or even hundreds of virtual machines can be built. On so many virtual machines, if you switch back and forth between the host machine and each virtual machine one by one through the interface. It is a waste of time. When the virtual machine changes or the test program changes, the NVMe disk needs to recreate the namespace, reallocate the virtual device, re-login to the virtual machine, modify and run the test program. The preparation stage of the entire test becomes very cumbersome. In addition, the queues and interrupt resources allocated to the virtual PCIe cannot adaptively achieve the optimal configuration, which wastes resources. The test device running on the host machine provided in this embodiment can automatically detect the number of online virtual machines, adaptively create the namespace of the NVMe SSD disk, create a virtual PCIe device, and maximize the allocation of queue interrupt resources to the virtual PCIe device; after the virtual PCIe device is created, it is automatically mapped to the virtual machine, and the timely detection mechanism is started. After the virtual PCIe device is discovered on the virtual machine side, the host starts uploading the test program and starts the test. Start the timely detection mechanism, and after the test is completed, download the test records to the host machine and generate test analysis.

[0155] The embodiment of the present invention also provides a computer device, which may include: a processor, a communication interface, a memory and a bus, wherein the processor, the communication interface and the memory communicate with each other through the bus. The bus can be used for information transmission between electronic devices and sensors. The processor can call the logic instructions in the memory to execute the following method: Step 1: After the virtual machine is created, the number of online virtual machines is automatically detected to adaptively create a namespace for the NVMe solid-state drive; including the number and size value of the namespace; Step 2: Create a virtual PCIe device according to the size value of the created namespace, and maximize the allocation of queue interrupt resources to the virtual PCIe device; Step 3: After the virtual PCIe device is created, it is automatically mapped to the virtual machine; Step 4: After the virtual PCIe device is found on the virtual machine side, start uploading the test program and start the test. Step 5: After the test is completed, the virtual state is restored and the test record is downloaded and the test analysis is generated.

[0156] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0157] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. An automated testing method for multi-virtual machine loads of a solid state drive, characterized in that: The steps include: After the virtual machine is created, the number of online virtual machines is automatically detected and the namespace of the NVMe SSD is adaptively created, including the number and size of the namespace; Create a virtual PCIe device according to the size value of the created namespace, and allocate queue interrupt resources to the virtual PCIe device to the maximum extent possible; After the virtual PCIe device is created, it is automatically mapped to the virtual machine; After the virtual PCIe device is detected on the virtual machine side, the test program is uploaded and the test is started; After the virtual machine is created, the steps to automatically detect the number of online virtual machines and adaptively create a namespace for the NVMe SSD include: After the virtual machine is created, the online virtual machine is detected through the KVM command, and the information of all virtual machines is recorded in the virtual machine test status table; Obtain the number and names of online virtual machines according to the virtual machine test status table; Create the optimal number and size of NVMe SSD namespaces based on the number of online virtual machines; The steps of creating a virtual PCIe device according to the size value of the created namespace and maximally allocating queue interrupt resources to the virtual PCIe device include: Create a virtual PCIe device based on the size value of the namespace; Get the maximum number of queues and interrupt resources supported by the NVMe SSD, and allocate them to each virtual PCIe device; the allocation adopts average allocation or customized allocation, and specifies the specific number of queues and interrupt resources for the virtual PCIe device; After the virtual PCIe device is created, the steps to automatically map it to the virtual machine include: After the virtual PCIe device is created, assign the virtual PCIe device to each virtual machine; According to the name of the virtual machine, obtain the MAC address list of each virtual machine with the name, and convert the MAC address list into an IP address list.

2. The automated testing method for multi-virtual machine load of a solid state drive according to claim 1, characterized in that: After the virtual PCIe device is detected on the virtual machine side, the test program is uploaded and the test is started, and the following steps are included: After the test is completed, the virtual state is restored and the test records are downloaded and test analysis is generated.

3. The automated testing method for multi-virtual machine load of a solid state drive according to claim 2, characterized in that: After the virtual PCIe device is detected on the virtual machine side, the test program is uploaded and the steps of starting the test include: After obtaining the IP address list of the virtual machine, log in to the virtual machine and check whether the virtual PCIe device is found on the virtual machine. If found, import the test program into the virtual machine; Start the test and set the virtual machine being tested to "testing" in the virtual machine test status table.

4. The automated testing method for multi-virtual machine load of a solid state drive according to claim 3, characterized in that: The steps to import the test program into the virtual machine include: Import the test program into the virtual machine, and set the virtual machine with the uploaded test program as "test program imported" in the virtual machine status table.

5. The automated testing method for multi-virtual machine load of a solid state drive according to claim 4, characterized in that: After the test is completed, the steps of restoring the virtual state and downloading the test records and generating the test analysis include: After the test is completed, upload the test log and update the virtual machine test status table to "Test Completed"; Unmap the virtual machine and restore the virtual machine to its original state; Export the test results of the corresponding virtual machine at the corresponding time node.

6. An automated testing device for multi-virtual machine loads of a solid state drive, characterized in that: It includes a detection creation module, a configuration module, an allocation module and a detection startup module; The detection and creation module is used to automatically detect the number of online virtual machines after the virtual machine is created and adaptively create the namespace of the NVMe solid-state drive; These include the number and size values ​​of namespaces; The configuration module creates a virtual PCIe device according to the size value of the created namespace and allocates queue interrupt resources to the virtual PCIe device to the maximum extent possible. The allocation module automatically maps the virtual PCIe device to the virtual machine after it is created. The detection startup module is used to detect that after a virtual PCIe device is found on the virtual machine side, the test program is uploaded and the test is started; The detection creation module includes a detection recording unit, an acquisition unit, and a resource creation unit; A detection and recording unit is used to detect online virtual machines through KVM instructions after the virtual machine is created, and record the information of all virtual machines into the virtual machine test status table; An acquisition unit, used for acquiring the number and names of online virtual machines according to the virtual machine test status table; A resource creation unit, used to create the optimal number and size of NVMe SSD namespaces according to the number of online virtual machines; The configuration module includes a virtual device creation unit and a resource configuration unit; A virtual device creation unit, used to create a virtual PCIe device according to the size value of the namespace; A resource configuration unit is used to obtain the maximum number of queues and interrupt resources supported by the NVMe SSD and allocate them to each virtual PCIe device; The allocation adopts average allocation or customized allocation, and specifies the specific number of queues and interrupt resources for the virtual PCIe device; The allocation module includes an allocation unit and a list generation unit; The allocation unit is used to allocate the virtual PCIe device to each virtual machine after the virtual PCIe device is created; The list generating unit is used to obtain the MAC address list of each virtual machine with the name according to the name of the virtual machine, and convert the MAC address list into an IP address list.

7. An automated testing system for multi-virtual machine loads of solid state drives, characterized in that: The host machine comprises a test device; after the virtual machine is created on the host machine, the test device is started to test the virtual machine; the test device is the automated test device for the multi-virtual machine load of the solid state drive according to claim 6; After the virtual machine test is completed, the test device will cancel the mapping of the virtual machine and restore the initial state of the virtual machine.

Citation Information

Patent Citations

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

    CN111063387A

  • Method, system and device for controlling data access operation and storage medium

    CN111198663A