A test method of a virtual machine, an electronic device, a storage medium and a product
By dynamically adjusting test parameters based on real-time virtual machine running status indicators, the problem of inaccurate test results caused by virtual machine resource overload is solved, achieving efficient and accurate virtual machine performance testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, virtual machine performance testing suffers from inaccurate results due to the fixed test command parameters, which can lead to virtual machine resource overload, especially during multi-node parallel testing.
By acquiring real-time running status metrics in the virtual machine cluster, dynamically adjusting test parameters, generating and sending target test commands, the system controls the virtual machines to perform performance tests, ensuring that the test parameters are adapted to the actual running capabilities of the virtual machines.
It effectively avoids virtual machine resource overload, ensures the accuracy and rationality of test results, reduces manual intervention, and improves the testing efficiency of large-scale virtual machine clusters.
Smart Images

Figure CN122240237A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of cloud computing technology, and in particular to a virtual machine testing method, electronic device, storage medium, and product. Background Technology
[0002] With the development of cloud computing technology, performance and stability testing of virtual machines in cloud platforms has become a key aspect of ensuring service quality.
[0003] In related technologies, it is usually necessary to manually log in to each virtual machine to execute test commands to test the virtual machines. This method is cumbersome and time-consuming, especially when there are many virtual machines. Alternatively, different testing tools can be used to test the virtual machines. However, the test command formats of different tools vary greatly, and manual switching is prone to errors. Furthermore, batch execution tools can only deliver test commands in batches. If the test command parameters are fixed during multi-node parallel testing, it may overload the processor, memory, and other resources of the virtual machines, resulting in inaccurate test results for multiple virtual machines. Summary of the Invention
[0004] To address the aforementioned technical problems, this disclosure provides a virtual machine testing method, electronic device, storage medium, and product to resolve the issue of inaccurate test results caused by overloading the processor, memory, and other resources of virtual machines due to fixed test command parameters for multiple virtual machines.
[0005] In a first aspect, this disclosure provides a method for testing virtual machines. The method includes: during the performance testing process of each virtual machine in the cluster running a testing tool based on an initial test instruction, acquiring at least one running status indicator for each virtual machine, wherein the testing tool is configured with first test parameter information; adjusting the first test parameter information to second test parameter information based on the at least one running status indicator; and generating and sending a target test instruction to each virtual machine based on the second test parameter information to control each virtual machine to run the testing tool based on the target test instruction to perform performance testing, thereby obtaining the test results of each virtual machine in the cluster.
[0006] In one optional implementation, the test parameter information includes multiple test parameters; adjusting the first test parameter information to the second test parameter information based on at least one operating status indicator includes: comparing each operating status indicator with the threshold range corresponding to each operating status indicator; if each operating status indicator is within the threshold range corresponding to each operating status indicator, then determining the second test parameter information as the first test parameter information; or, if there is a first operating status indicator that is not within the threshold range corresponding to the first operating status indicator, then adjusting at least one test parameter associated with the first operating status indicator to obtain the second test parameter information, wherein the first operating status indicator is any one of the at least one operating status indicator.
[0007] In one optional implementation, at least one operational status indicator includes processor utilization, memory utilization, disk latency, and network latency; multiple test parameters include concurrency stress parameters, memory stress parameters, disk stress parameters, and network stress parameters. If a first operational status indicator is outside the threshold range corresponding to the first operational status indicator, then at least one test parameter associated with the first operational status indicator is adjusted to obtain second test parameter information, including: if the first operational status indicator is processor utilization, then the concurrency pressure parameter in the first test parameter information is reduced to obtain second test parameter information; or, if the first operational status indicator is memory utilization, then the memory pressure parameter in the first test parameter information is reduced to obtain second test parameter information; or, if the first operational status indicator is disk latency, then the disk pressure parameter in the first test parameter information is reduced to obtain second test parameter information; or, if the first operational status indicator is network latency, then the network pressure parameter in the first test parameter information is reduced to obtain second test parameter information.
[0008] In an optional implementation, the method further includes: after obtaining the test results of each virtual machine in the cluster, extracting at least one performance index value of each virtual machine from the test results; detecting whether the first performance index value of each virtual machine meets a preset condition, wherein the first performance index value is any one of the at least one performance index value; and determining that the cluster is in a stable state if the performance index values of all virtual machines meet the preset condition.
[0009] In an optional implementation, the method further includes: during the performance testing process of each virtual machine in the cluster running the test tool based on the target test instructions, recording the core status information of each virtual machine at a fixed frequency, the core status information including the virtual machine identifier of each virtual machine, the tool identifier of the test tool, the test progress, and the test parameter information configured by the test tool; when the performance testing of the first virtual machine is interrupted, the performance testing of the first virtual machine is resumed again based on the latest core status information of the first virtual machine.
[0010] In one optional implementation, each virtual machine in the cluster runs a test tool to perform performance testing based on an initial test instruction, including: obtaining a list of multiple virtual machines to be tested and first test parameter information for each of the multiple test tools, wherein the list information includes the virtual machine identifier of each virtual machine in the multiple virtual machines; generating an initial test instruction based on the first test parameter information; and sending the initial test instruction to each virtual machine based on the list information to control each virtual machine to run the test tool to perform performance testing based on the initial test instruction.
[0011] In one optional implementation, the list information also includes the standby node identifier of the standby node corresponding to the master node to which each virtual machine belongs; the method further includes: during the performance testing process of each virtual machine in the cluster running the test tool based on the target test instructions, when the master node to which the second virtual machine belongs fails, the second virtual machine is restored to run the test tool on the standby node corresponding to the master node to perform performance testing.
[0012] Secondly, the present invention provides a testing apparatus for virtual machines, comprising: an acquisition module, configured to acquire at least one running status indicator for each virtual machine in a cluster during performance testing of a testing tool based on an initial test instruction, wherein the testing tool is configured with first test parameter information; an adjustment module, configured to adjust the first test parameter information to second test parameter information based on at least one of the running status indicators; and a processing module, configured to generate and send target test instructions to each virtual machine based on the second test parameter information, thereby controlling each virtual machine to run the testing tool based on the target test instructions to perform performance testing, and obtaining test results for each virtual machine in the cluster.
[0013] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the virtual machine testing method of the first aspect or any corresponding embodiment described above.
[0014] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the test method of the virtual machine of the first aspect or any corresponding embodiment thereof.
[0015] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute a test method for a virtual machine of the first aspect or any corresponding embodiment thereof.
[0016] The technical solution provided in this disclosure has the following advantages: The virtual machine testing method, electronic device, storage medium, and product provided in this disclosure are capable of acquiring at least one running status indicator for each virtual machine in a cluster during the performance testing process of each virtual machine running a testing tool based on an initial test instruction; adjusting the first test parameter information to the second test parameter information based on the at least one running status indicator; generating and sending target test instructions to each virtual machine based on the second test parameter information, so as to control each virtual machine to run the testing tool based on the target test instructions to perform performance testing, and obtaining the test results of each virtual machine in the cluster.
[0017] By acquiring real-time metrics of the virtual machine's actual operating status during testing and adjusting test parameters accordingly, the system ensures that test parameters always closely match the virtual machine's current actual operating capabilities (e.g., appropriately reducing test pressure parameters when the virtual machine is under high load and reasonably increasing test parameters when the virtual machine is idle). This effectively avoids problems such as test crashes due to excessively high initial parameters and failure to measure the true performance threshold due to excessively low parameters, thus fundamentally improving the rationality of performance testing. By independently sensing the operating status metrics of each virtual machine and adjusting test parameters accordingly, the system avoids the problem of fixed parameters for fixed test commands being ineffective for some virtual machines (e.g., high-configuration virtual machines failing to reach their performance limits, and low-configuration virtual machines malfunctioning due to excessive test pressure). This ensures that each virtual machine in the cluster can complete the test with parameters adapted to its own status, guaranteeing the accuracy of the overall cluster test results. Furthermore, the entire process of parameter adjustment, command issuance, and continuous testing is automated, eliminating the need for operations personnel to manually monitor the virtual machine's operating status, manually modify test parameters, and reissue commands, significantly reducing the workload of manual intervention. This is especially effective for large-scale virtual machine clusters, significantly improving the overall efficiency of performance testing. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a topology diagram of a virtual machine testing system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a virtual machine testing method provided according to an embodiment of this application; Figure 3 This is a structural block diagram of a virtual machine testing apparatus provided according to an embodiment of this application; Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0021] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0022] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0023] The embodiments of this application are applied to a scenario where performance testing is performed on multiple virtual machines.
[0024] In related technologies, it is usually necessary to manually log in to each virtual machine to execute test commands for testing. This method is cumbersome and time-consuming, especially when there are many virtual machines. Alternatively, different testing tools can be used to test the virtual machines. However, the test command formats of these tools vary greatly, and manual switching is prone to errors. Furthermore, batch execution tools can only distribute test commands in batches. If the test command parameters are fixed during multi-node parallel testing, it may overload the virtual machine's processor, memory, and other resources, resulting in inaccurate test results.
[0025] To address the aforementioned technical problems, this application provides a method for testing virtual machines. The method includes: during performance testing of each virtual machine in a cluster using a testing tool based on initial test instructions, acquiring at least one runtime status indicator for each virtual machine; the testing tool being configured with first test parameter information; adjusting the first test parameter information to second test parameter information based on the at least one runtime status indicator; and generating and sending target test instructions to each virtual machine based on the second test parameter information to control each virtual machine to run the testing tool based on the target test instructions for performance testing, thereby obtaining the test results of each virtual machine in the cluster. This allows for adjustment of the testing tool's test parameter information based on the virtual machine's runtime status indicators, thus avoiding the problem of inaccurate virtual machine test results caused by overloading virtual machine resources such as processors and memory due to fixed test command parameters of the testing tool.
[0026] The following is based on Figure 1 Taking the virtual machine test system shown as an example, the method provided in the embodiments of this application will be described.
[0027] like Figure 1 As shown, Figure 1 This is a topology diagram of a virtual machine testing system provided in an embodiment of this application. Figure 1 In the virtual machine testing system 100, there are virtual machine testing devices 101, a first virtual machine 102, and a second virtual machine 103.
[0028] The virtual machine testing device 101 can be any device with communication and computing capabilities. For example, the virtual machine testing device 101 can be a server or a cloud server. The virtual machine testing device 101 can be the host machine of the first virtual machine 102 or the second virtual machine 103. The virtual machine testing device includes a resource-aware scheduler, a fault tolerance manager, and a structured parser.
[0029] The virtual machine testing device loads a list of target virtual machines (including master and standby nodes) and a test tool feature library; adjusts the initial parameters of the test tools based on the real-time resource status of the virtual machines; executes adapted test commands on each virtual machine through a multi-threaded concurrency mechanism, while the fault tolerance manager saves checkpoints in real time; and a structured parser extracts metrics for each virtual machine, stores them in a database, and generates a visual report. The test tool feature library predefines feature information for at least two types of test tools, including test instruction templates, resource consumption models, and result parsing rules. Test instruction templates include multiple test parameters; the resource consumption model monitors the basic usage ratio of processor, memory, and network resources for each virtual machine by each test tool; and the result parsing rules determine the output file format for each test tool and define the extraction logic for key metrics of the output virtual machines (e.g., regular expressions, output file storage paths).
[0030] The first virtual machine 102 or the second virtual machine 103 can be any virtual machine with communication and computing capabilities. Various testing tools are deployed on the virtual machines.
[0031] Figure 1 The virtual machine testing system shown is for illustrative purposes only and is not intended to limit the technical solutions of this application. Those skilled in the art should understand that in specific implementations, the virtual machine testing system may include more devices, without limitation.
[0032] This embodiment provides a method for testing virtual machines, which can be used with the aforementioned virtual machine testing apparatus. Figure 2 This is a flowchart illustrating a virtual machine testing method according to an embodiment of this application; as shown. Figure 2 As shown, the process includes the following steps: S201: During the performance testing process of each virtual machine in the cluster running the test tool based on the initial test instructions, at least one running status indicator of each virtual machine is obtained.
[0033] The testing tool is configured with initial test parameter information. This information includes multiple test parameters, such as concurrency stress parameters, memory stress parameters, disk stress parameters, and network stress parameters. Specifically, these parameters may include concurrency stress parameters (number of concurrent threads, maximum prime number limit for processors), disk stress parameters (read / write request queue depth), network stress parameters (number of concurrent connections for network data transmission), and memory stress parameters.
[0034] In this embodiment of the application, the testing tool can be any performance testing or stability testing tool. For example, the testing tool can be an input / output performance testing tool (Flexible I / O Tester, fio), a system benchmark testing tool (System Benchmark, sysbench), or a system stress testing tool (System Stress Tester).
[0035] Running status metrics can be any value that a virtual machine displays during operation. For example, running status metrics can be processor utilization, memory utilization, disk latency, and network latency.
[0036] In some optional implementations, before acquiring at least one runtime status indicator for each virtual machine, the virtual machine testing device may also acquire a list of multiple virtual machines to be tested and first test parameter information for each of the multiple testing tools; generate initial test instructions based on the first test parameter information; and send the initial test instructions to each virtual machine based on the list information to control each virtual machine to run the testing tool for performance testing based on the initial test instructions.
[0037] The list information includes the virtual machine identifier of each virtual machine in multiple virtual machines, the standby node identifier of the standby node corresponding to the master node to which each virtual machine belongs, and the master node identifier.
[0038] S202, based on at least one operating status indicator, adjust the first test parameter information to the second test parameter information.
[0039] In some optional implementations, each operating status indicator is compared with the threshold range corresponding to each operating status indicator; if each operating status indicator is within the threshold range corresponding to each operating status indicator, then the second test parameter information is determined as the first test parameter information; or, if there is a first operating status indicator that is not within the threshold range corresponding to the first operating status indicator, then at least one test parameter associated with the first operating status indicator is adjusted to obtain the second test parameter information.
[0040] The first operational status indicator is any one of at least one operational status indicator.
[0041] The threshold range can be set according to actual needs and is not limited. For example, the threshold range corresponding to processor utilization can be less than 70%.
[0042] Specifically, if the first operating status indicator is processor utilization, then the concurrency pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; or, if the first operating status indicator is memory utilization, then the memory pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; or, if the first operating status indicator is disk latency, then the disk pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; or, if the first operating status indicator is network latency, then the network pressure parameter in the first test parameter information is reduced to obtain the second test parameter information.
[0043] For example, if the processor utilization is not within the threshold range, the processor-intensive parameters in the first test parameter information are reduced (e.g., the number of threads in sysbench is halved); if the memory utilization is not within the threshold range, the memory consumption parameters are automatically reduced (e.g., the test file size in fio is halved).
[0044] S203, based on the second test parameter information, generates and sends target test instructions to each virtual machine, so as to control each virtual machine to run the test tool to perform performance testing based on the target test instructions, and obtain the test results of each virtual machine in the cluster.
[0045] In some optional implementations, during the performance testing process of each virtual machine in the cluster running the test tool based on the target test instructions, the core status information of each virtual machine is recorded at a fixed frequency; when the performance testing of the first virtual machine is interrupted, the performance testing of the first virtual machine is resumed again based on the latest core status information of the first virtual machine.
[0046] The core status information (also known as checkpoint) includes the virtual machine identifier for each virtual machine, the tool identifier for the testing tool, the test progress, and the test parameter information configured for the testing tool.
[0047] For example, when the first virtual machine is interrupted while running the test tool for performance testing, the latest kernel status information of the first virtual machine is automatically loaded after the fault is recovered; based on the kernel status information, the first virtual machine is restored to continue running the test tool for performance testing from the breakpoint, so as to avoid repeating the performance test.
[0048] Optionally, during the performance testing process of each virtual machine in the cluster running the test tool based on the target test instructions, if the master node to which the second virtual machine belongs fails, the second virtual machine is restored on the backup node corresponding to the master node to run the test tool for performance testing.
[0049] Understandably, if a node failure or network interruption occurs during testing, the entire test needs to be re-executed, resulting in wasted resources. Therefore, if the virtual machine's testing device detects a failure in the master node to which the virtual machine belongs, it enables breakpoint resumption or replaces the master node with a backup node to ensure test continuity.
[0050] In some optional implementations, after obtaining the test results of each virtual machine in the cluster, at least one performance index value of each virtual machine is extracted from the test results; it is then checked whether the first performance index value of each virtual machine meets a preset condition; if the performance index values of all virtual machines meet the preset condition, the cluster is determined to be in a stable state.
[0051] The first performance metric is any one of at least one performance metric values. Performance metric values can be virtual machine latency, bandwidth, or input / output operations per second.
[0052] In this embodiment of the application, the preset condition may be that the various performance indicators of the virtual machine are within a reasonable range. For example, the latency of the virtual machine is less than a preset value.
[0053] based on Figure 2 The method described above involves obtaining at least one running status indicator for each virtual machine in the cluster during the performance testing process of each virtual machine running the testing tool based on the initial test instructions; adjusting the first test parameter information to the second test parameter information based on the at least one running status indicator; generating and sending the target test instructions to each virtual machine based on the second test parameter information, so as to control each virtual machine to run the testing tool based on the target test instructions to perform performance testing, and obtaining the test results of each virtual machine in the cluster.
[0054] By acquiring real-time metrics of the virtual machine's actual operating status during testing and adjusting test parameters accordingly, the system ensures that test parameters always closely match the virtual machine's current actual operating capabilities (e.g., appropriately reducing test pressure parameters when the virtual machine is under high load and reasonably increasing test parameters when the virtual machine is idle). This effectively avoids problems such as test crashes due to excessively high initial parameters and failure to measure the true performance threshold due to excessively low parameters, thus fundamentally improving the rationality of performance testing. By independently sensing the operating status metrics of each virtual machine and adjusting test parameters accordingly, the system avoids the problem of fixed parameters for fixed test commands being ineffective for some virtual machines (e.g., high-configuration virtual machines failing to reach their performance limits, and low-configuration virtual machines malfunctioning due to excessive test pressure). This ensures that each virtual machine in the cluster can complete the test with parameters adapted to its own status, guaranteeing the accuracy of the overall cluster test results. Furthermore, the entire process of parameter adjustment, command issuance, and continuous testing is automated, eliminating the need for operations personnel to manually monitor the virtual machine's operating status, manually modify test parameters, and reissue commands, significantly reducing the workload of manual intervention. This is especially effective for large-scale virtual machine clusters, significantly improving the overall efficiency of performance testing.
[0055] This embodiment also provides a virtual machine testing device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0056] This embodiment provides a testing device for virtual machines, such as... Figure 3 As shown, Figure 3 This is a structural block diagram of a virtual machine testing apparatus provided according to an embodiment of this application; the apparatus includes: The acquisition module 301 is used to acquire at least one running status indicator for each virtual machine in the cluster during the performance test process of the test tool running based on the initial test instructions. The test tool is configured with first test parameter information.
[0057] The adjustment module 302 is used to adjust the first test parameter information to the second test parameter information based on at least one operating status indicator.
[0058] The processing module 303 is used to generate and send target test instructions to each virtual machine based on the second test parameter information, so as to control each virtual machine to run the test tool to perform performance testing based on the target test instructions and obtain the test results of each virtual machine in the cluster.
[0059] In some optional implementations, the test parameter information includes multiple test parameters; the adjustment module 302 is specifically used to compare each operating status indicator with the threshold range corresponding to each operating status indicator; if each operating status indicator is within the threshold range corresponding to each operating status indicator, then the second test parameter information is determined to be the first test parameter information; or, if there is a first operating status indicator that is not within the threshold range corresponding to the first operating status indicator, then at least one test parameter associated with the first operating status indicator is adjusted to obtain the second test parameter information, wherein the first operating status indicator is any one of the at least one operating status indicator.
[0060] In some optional implementations, at least one operational status metric includes processor utilization, memory utilization, disk latency, and network latency; multiple test parameters include concurrency stress parameters, memory stress parameters, disk stress parameters, and network stress parameters. The adjustment module 302 is specifically used to: if the first operating status indicator is processor utilization, reduce the concurrent pressure parameter in the first test parameter information to obtain the second test parameter information; or if the first operating status indicator is memory utilization, reduce the memory pressure parameter in the first test parameter information to obtain the second test parameter information; or if the first operating status indicator is disk latency, reduce the disk pressure parameter in the first test parameter information to obtain the second test parameter information; or if the first operating status indicator is network latency, reduce the network pressure parameter in the first test parameter information to obtain the second test parameter information.
[0061] In some optional implementations, the processing module 303 is further configured to, after obtaining the test results of each virtual machine in the cluster, extract at least one performance index value of each virtual machine from the test results; detect whether the first performance index value of each virtual machine meets a preset condition, wherein the first performance index value is any one of the at least one performance index value; and determine that the cluster is in a stable state if the performance index values of all virtual machines meet the preset condition.
[0062] In some optional implementations, the processing module 303 is also used to record the core status information of each virtual machine at a fixed frequency during the performance testing process of each virtual machine running the test tool based on the target test instructions in the cluster. The core status information includes the virtual machine identifier of each virtual machine, the tool identifier of the test tool, the test progress, and the test parameter information configured by the test tool. When the performance test of the first virtual machine is interrupted, the first virtual machine resumes running the test tool for performance testing according to the latest core status information of the first virtual machine.
[0063] In some optional implementations, the acquisition module 301 is specifically used to acquire a list of multiple virtual machines to be tested and first test parameter information of each of the multiple testing tools. The list information includes the virtual machine identifier of each virtual machine in the multiple virtual machines. Based on the first test parameter information, an initial test instruction is generated. Based on the list information, the initial test instruction is sent to each virtual machine to control each virtual machine to run the testing tool to perform performance testing based on the initial test instruction.
[0064] In some optional implementations, the list information also includes the standby node identifier of the standby node corresponding to the master node to which each virtual machine belongs; the processing module 303 is also used to restore the second virtual machine to run the test tool for performance testing on the standby node corresponding to the master node when the master node to which the second virtual machine belongs fails during the performance testing process of each virtual machine in the cluster running the test tool based on the target test instructions.
[0065] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0066] In this embodiment, the virtual machine testing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0067] This invention also provides an electronic device having the above-described features. Figure 3 The test setup for the virtual machine shown.
[0068] Please see Figure 4 , Figure 4 This is a schematic diagram of the hardware structure of the electronic device according to an embodiment of this application, such as... Figure 4 As shown, the electronic device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4Take a processor 10 as an example.
[0069] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0070] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0071] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0072] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0073] The electronic device also includes a communication interface 30 for communicating with other devices or communication networks.
[0074] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0075] This invention provides a computer program product, which includes computer instructions for causing a computer to execute the method of any embodiment of this invention.
[0076] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0077] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A test method of a virtual machine, characterized by, The method includes: During the performance testing process of each virtual machine in the cluster running the test tool based on the initial test instructions, at least one running status indicator of each virtual machine is obtained, and the test tool is configured with first test parameter information; Based on at least one of the aforementioned operational status indicators, the first test parameter information is adjusted to the second test parameter information; Based on the second test parameter information, target test instructions are generated and sent to each of the virtual machines to control each of the virtual machines to run the test tool to perform performance testing based on the target test instructions, and to obtain the test results of each of the virtual machines in the cluster.
2. The method of claim 1, wherein, The test parameter information includes multiple test parameters; adjusting the first test parameter information to second test parameter information based on at least one of the operating status indicators includes: Each of the operational status indicators is compared with the threshold range corresponding to each of the operational status indicators; If each of the operating status indicators falls within the threshold range corresponding to each operating status indicator, then the second test parameter information is determined to be the first test parameter information; Alternatively, if a first operating status indicator is not within the threshold range corresponding to the first operating status indicator, then at least one of the test parameters associated with the first operating status indicator is adjusted to obtain the second test parameter information, wherein the first operating status indicator is any one of at least one operating status indicator.
3. The method of claim 2, wherein, At least one of the aforementioned operational status metrics includes processor utilization, memory utilization, disk latency, and network latency; multiple of the aforementioned test parameters include concurrency stress parameters, memory stress parameters, disk stress parameters, and network stress parameters; If a first operating status indicator is not within the threshold range corresponding to the first operating status indicator, then at least one of the test parameters associated with the first operating status indicator is adjusted to obtain the second test parameter information, including: If the first operating status indicator is the processor utilization rate, then the concurrency pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; Alternatively, if the first operating status indicator is the memory usage rate, then the memory pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; Alternatively, if the first operating status indicator is the disk latency, then the disk pressure parameter in the first test parameter information is reduced to obtain the second test parameter information; Alternatively, if the first operational status indicator is the network latency, then the network pressure parameter in the first test parameter information is reduced to obtain the second test parameter information.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: After obtaining the test results of each virtual machine in the cluster, at least one performance metric value for each virtual machine is extracted from the test results; Detect whether the first performance index value of each virtual machine meets a preset condition, wherein the first performance index value is any one of at least one performance index value. If the performance metrics of all the virtual machines meet the preset conditions, then the cluster is determined to be in a stable state.
5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: During the performance testing process of each virtual machine in the cluster running the testing tool based on the target test instruction, the core status information of each virtual machine is recorded at a fixed frequency. The core status information includes the virtual machine identifier of each virtual machine, the tool identifier of the testing tool, the test progress, and the test parameter information configured by the testing tool. When the first virtual machine is interrupted while running the test tool for performance testing, the first virtual machine is resumed running the test tool for performance testing based on the latest kernel status information of the first virtual machine.
6. The method according to any one of claims 1-3, characterized in that, Each virtual machine in the cluster runs a testing tool based on the initial test command to perform performance tests, including: Obtain a list of multiple virtual machines to be tested and first test parameter information for each of the multiple testing tools, wherein the list information includes the virtual machine identifier of each of the multiple virtual machines; Based on the first test parameter information, an initial test instruction is generated; Based on the list information, the initial test command is sent to each of the virtual machines to control each of the virtual machines to run the test tool to perform performance testing based on the initial test command.
7. The method according to claim 6, characterized in that, The list information also includes the standby node identifier of the standby node corresponding to the master node to which each virtual machine belongs; the method further includes: During the performance testing process of each virtual machine in the cluster running the test tool based on the target test instruction, if the master node to which the second virtual machine belongs fails, the second virtual machine is restored on the standby node corresponding to the master node to run the test tool for performance testing.
8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the virtual machine testing method of any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the test method of the virtual machine according to any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to execute the testing method of the virtual machine according to any one of claims 1 to 7.