Server energy consumption test method and device, electronic equipment and storage medium
By automatically creating virtual machines and installing relevant software on the server, and using the IPMI tool for power consumption settings and automated testing, the problem of low efficiency and high cost in existing server energy consumption testing technologies has been solved, achieving efficient and low-cost energy consumption testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-07-24
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies require manual installation of tools and deployment scripts for server energy consumption testing, which is inefficient and costly, especially when testing multiple servers in parallel, requiring multiple sets of hardware equipment.
By automatically creating virtual machines on each server under test and installing the Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software on the virtual machines, the power consumption settings at different levels are set using the IPMI tool, and automated energy consumption tests are performed at each power consumption level to obtain energy consumption test data.
It enables efficient and automated server energy consumption testing, reducing operational complexity and costs while improving testing efficiency.
Smart Images

Figure CN117009200B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a server energy consumption testing method, apparatus, electronic device, and storage medium. Background Technology
[0002] "Energy conservation and emission reduction" has become an important indicator for measuring a company's future sustainable development capabilities. To make rational use of servers and improve work efficiency while reducing operating costs, understanding server performance under different power consumption levels is crucial. Current technologies primarily use professional testing software such as SpecPower for server energy consumption testing. This requires manual installation of tools and scripts on each machine under test, which is cumbersome and inefficient. Furthermore, it necessitates the use of hardware such as power consumption testers, requiring multiple sets of hardware for parallel testing of multiple machines, resulting in high costs. Summary of the Invention
[0003] This invention provides a server energy consumption testing method, apparatus, electronic device, and storage medium to address the shortcomings of existing technologies that primarily use professional testing software such as Spec Power for server energy consumption testing. These technologies require manual installation of tools and deployment of scripts on each machine under test, resulting in low efficiency. Furthermore, they require the use of hardware such as power consumption testers for testing, and when testing multiple machines under test in parallel, multiple sets of hardware devices are required, leading to high costs.
[0004] In a first aspect, the present invention provides a server energy consumption testing method, applied to a control unit, wherein the control unit is connected to at least one server under test via a switch, the method comprising:
[0005] A virtual machine is automatically created on each server under test, and energy consumption testing software is installed on the virtual machine. The energy consumption testing software includes: Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software.
[0006] The IPMI tool is used to configure different levels of power consumption for each server under test.
[0007] At each power consumption level, the virtual machines on each server under test are controlled to perform automated power consumption tests based on the power consumption testing software and the automatic response software to obtain power consumption test data for each server under test.
[0008] In some embodiments, automatically creating a virtual machine on each server under test and installing energy consumption testing software on the virtual machine includes:
[0009] Obtain virtual machine deployment parameters;
[0010] Based on the virtual machine deployment parameters, a virtual machine is automatically created on each server under test, and an Internet Protocol (IP) address is assigned to the virtual machine on each server under test. The IP address is used to enable communication between each server under test and the virtual machine on it.
[0011] Based on the IP address of the virtual machine on each server under test, a software installation command is sent to the virtual machine on each server under test to install the energy consumption testing related software on the virtual machine on each server under test.
[0012] In some embodiments, the virtual machine deployment parameters include at least one of the following: the IP address of each server under test, the virtualization type, the number of central processing unit (CPU) cores of the created virtual machine, the memory size of the created virtual machine, the name of the local ISO installation image, the network name used, the version of the operating system installed on the created virtual machine, and the disk path format.
[0013] In some embodiments, the step of setting different levels of power consumption for each server under test using the IPMI tool includes:
[0014] With the virtual machines on each server under test in an idle state, the total power consumption of each server under test is obtained as the lower limit of power consumption for testing.
[0015] A preset number of equal division operations are performed between the lower power consumption limit and the preset upper power consumption limit to obtain different levels of power consumption;
[0016] Based on the different power consumption levels, the power consumption of each server under test is set using the IPMI tool.
[0017] In some embodiments, the step of controlling the virtual machines on each server under test to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software at each power consumption level, to obtain energy consumption test data for each server under test, includes:
[0018] At each power consumption level, each server under test is controlled to send an energy consumption test command to the virtual machine on each server under test, so that the virtual machine on each server under test executes the energy consumption test command based on the energy consumption test software and the automatic response software, and obtains the energy consumption test data of each server under test.
[0019] In some embodiments, the method further includes:
[0020] Obtain the energy consumption test data uploaded by each server under test;
[0021] The energy consumption test data is processed, and automated charts are generated to output the test results.
[0022] In some embodiments, the energy consumption test data includes multiple individual test data.
[0023] The process of processing the energy consumption test data, automatically generating charts, and outputting test results includes:
[0024] For each power consumption level, each individual test data is compared with the baseline system test data corresponding to each individual test data to obtain the index value corresponding to each individual test data.
[0025] The test score is obtained based on the index value corresponding to each individual test data item;
[0026] Based on the test scores at each power consumption level, automated charts are generated and the test results are output.
[0027] The baseline system test data is the test data obtained by evaluating and verifying the initial system performance of each server under test.
[0028] Secondly, the present invention also provides a server energy consumption testing device, comprising:
[0029] The configuration unit is used to automatically create virtual machines on each server under test and install energy consumption testing related software on the virtual machines. The energy consumption testing related software includes: the Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software.
[0030] The setting unit is used to set different levels of power consumption for each server under test using the IPMI tool.
[0031] The testing unit is used to control the virtual machines on each server under test to perform automated energy consumption tests based on the energy consumption testing software and the automatic response software at each power consumption level, so as to obtain the energy consumption test data of each server under test.
[0032] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the server energy consumption testing method described above.
[0033] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the server energy consumption testing method as described above.
[0034] This invention provides a server energy consumption testing method, apparatus, electronic device, and storage medium. It automatically creates a virtual machine on each server under test and installs energy consumption testing software on the virtual machine. The energy consumption testing software includes: an Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software. Through the IPMI tool, different power consumption levels are set for each server under test. At each power consumption level, the virtual machine on each server under test is controlled to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software, obtaining energy consumption test data for each server under test. The method is simple to operate, highly automated, and can greatly improve testing efficiency and reduce testing costs. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0036] Figure 1 This is a schematic diagram of the server energy consumption testing system provided in an embodiment of the present invention;
[0037] Figure 2 This is one of the flowcharts illustrating the server energy consumption testing method provided in this embodiment of the invention;
[0038] Figure 3 This is a schematic diagram of the process of automatically creating a virtual machine on each server under test and installing energy consumption testing software on the virtual machine, as provided in an embodiment of the present invention.
[0039] Figure 4 This is an example of energy consumption test results provided in an embodiment of the present invention;
[0040] Figure 5 This is a second schematic flowchart of the server energy consumption testing method provided in this embodiment of the invention;
[0041] Figure 6 This is a schematic diagram of the server energy consumption testing device provided by the present invention;
[0042] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0044] Figure 1 This is a schematic diagram of a server energy consumption testing system provided in an embodiment of the present invention. Figure 1 As shown, the control unit is connected to Server 1 under Test, Server 2 under Test 3 and Server 3 under Test 1 under Test 3 via a switch.
[0045] It should be noted that connecting the control unit to the server under test via a switch is one of the common ways to achieve network communication.
[0046] A switch is a network device used to establish connections within a local area network (LAN). It forwards and switches data packets based on Media Access Control (MAC) addresses. When both the control unit and the server under test are connected to the same switch, they can communicate through the switch.
[0047] In the aforementioned server energy consumption testing system, when the control unit sends a data packet to the server under test (DUT), the switch forwards the packet to the DUT based on the destination MAC address. Similarly, when the DUT sends a response data packet, the switch forwards the packet to the control unit. Connecting the control unit and the DUT via a switch enables high-speed, reliable data transmission and supports simultaneous communication with multiple DUTs. This method is frequently used when building server clusters within a local area network (LAN) or for network testing. The system requires no additional hardware deployment, reducing testing costs.
[0048] Figure 2 This is one of the flowcharts illustrating a server energy consumption testing method provided in an embodiment of the present invention. Figure 2 As shown, a server energy consumption testing method is provided, applied to a control unit. The control unit is connected to at least one server under test via a switch. The method includes the following steps:
[0049] Steps 210, 220, and 230. These method steps are merely one possible implementation of the present invention.
[0050] Step 210: Automatically create a virtual machine on each server under test, and install energy consumption testing related software on the virtual machine. The energy consumption testing related software includes: IPMI tool, energy consumption testing software, and automatic response software.
[0051] A virtual machine (VM) is a special type of software that creates an environment between a computer platform and the end user, allowing the end user to operate software within that environment. VMs allow multiple operating systems to run on the same computer without requiring additional hardware. This is extremely useful for developers, testers, and system administrators because it provides an isolated environment where different operating systems and software configurations can run. VMs can be used for energy consumption testing, security testing, software compatibility testing, and creating isolated development environments.
[0052] It's important to note that IPMI is a standard interface for remotely managing and monitoring server hardware. It allows administrators to connect to servers over a network to monitor their health, perform remote restarts, and manage system logs. IPMI is an operating system-independent management interface, so even if the server's operating system crashes or becomes inaccessible, administrators can still manage and maintain it through IPMI. Using IPMI can improve the efficiency and reliability of server management.
[0053] IPMI tools are software tools used to interact with the IPMI interface. These tools can communicate with the IPMI interface via command line or graphical interface to perform various management tasks, such as querying sensor information, configuring power management policies, and setting alarm thresholds. Common IPMI tools include ipmitool and OpenIPMI. Installing IPMI tools can improve the efficiency and reliability of server management.
[0054] Energy consumption testing software refers to software tools used to evaluate the energy consumption of a server under test. It helps developers analyze the energy usage and performance metrics of the server under different workloads, enabling optimization and improvement.
[0055] Auto-responding software refers to software capable of automatically replying to messages or performing certain tasks. It can automatically send pre-set replies or perform specified operations upon receiving specific types of messages or triggering events. This improves efficiency, saves time, and ensures timely responses to important information.
[0056] Optionally, before automatically creating virtual machines on each server under test, the operating system, hardware configuration, and energy consumption testing software required for the test of the server under test should be determined.
[0057] Optionally, depending on the needs of the virtualization environment, suitable automation tools can be selected, and corresponding scripts or configuration files can be written to automatically create virtual machines and install energy consumption testing software.
[0058] Optionally, a virtual machine can be automatically created on each server under test, and after installing the energy consumption testing software on the virtual machine, an automated script or configuration file can be run on each server under test to verify whether the virtual machine has been correctly created and the required software has been successfully installed.
[0059] Understandably, using virtual machines for testing can improve the flexibility, convenience, and security of energy consumption testing, while also saving testing costs and increasing testing efficiency.
[0060] Step 220: Use the IPMI tool to set different power consumption levels for each server under test.
[0061] Alternatively, different levels of overall power consumption limits can be applied to the server under test using the IPMI tool and the Baseboard Manager Controller (BMC).
[0062] Understandably, setting different power consumption levels for each server under test using IPMI tools before conducting energy consumption tests is to simulate different load conditions and usage scenarios. This allows for a more comprehensive evaluation of the server's energy consumption, performance, and stability during actual operation. By setting different power consumption levels, the energy consumption performance of the server under test under different loads can be observed, thereby determining the optimal energy consumption strategy for the server under different workloads. This is crucial for optimizing server energy utilization and performance tuning, and also helps in evaluating the server's energy-saving performance and potential.
[0063] Step 230: At each power consumption level, control the virtual machines on each server under test to perform automated power consumption tests based on power consumption testing software and automatic response software to obtain power consumption test data for each server under test.
[0064] Optionally, when using energy consumption testing software for energy consumption testing, automatic response software can be used in conjunction to automate the execution of energy consumption testing tasks. Energy consumption testing tasks can be a series of load tests, performance tests, or other types of tests.
[0065] Optionally, the energy consumption test data for each server under test can be the power consumption and performance readings of each server under test, or an energy consumption test report generated by energy consumption testing software.
[0066] Optionally, the control unit can implement steps 210 to 230 above through a management script. The management script can be a script written in Python, such as manager.sh.
[0067] In this embodiment of the invention, a virtual machine is automatically created on each server under test, and energy consumption testing software is installed on the virtual machine. The energy consumption testing software includes: the Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software. Through the IPMI tool, different levels of power consumption settings are made for each server under test. At each power consumption level, the virtual machine on each server under test is controlled to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software, thereby obtaining energy consumption test data for each server under test. The operation is simple, highly automated, and flexible, which can greatly improve testing efficiency and reduce testing costs.
[0068] It should be noted that each embodiment of the present invention can be freely combined, rearranged, or executed individually, and does not need to rely on or depend on a fixed execution order.
[0069] Figure 3 This is a schematic diagram illustrating the process of automatically creating a virtual machine on each server under test and installing energy consumption testing software on the virtual machine, as provided in an embodiment of the present invention. Figure 3 As shown, in some embodiments, step 210 automatically creates a virtual machine on each server under test and installs energy consumption testing related software on the virtual machine, including steps 211, 212 and 213.
[0070] Step 211: Obtain virtual machine deployment parameters.
[0071] Alternatively, you can locate the virtual machine based on its IP address, find the relevant configuration information or attribute options, and locate the virtual machine deployment parameters.
[0072] Alternatively, virtual machine deployment parameters can be obtained through user input. Users can input virtual machine deployment parameters using the command ". / manager.sh --user 1.1.1.1 --os_variant centos8 --disk_path / home / kvm / centos.qcow2 --cdrom / home / kvm / centos8.iso".
[0073] Virtual machine deployment parameters refer to the parameters that need to be set and configured when deploying a virtual machine. These parameters can be adjusted according to actual needs to meet specific application scenarios and performance requirements.
[0074] Optionally, virtual machine deployment parameters may include the following aspects:
[0075] 1) Virtual machine specifications: Selecting the appropriate virtual machine specifications, including the number of CPU cores, memory size, storage capacity, etc., can provide better performance and user experience;
[0076] 2) Network settings: Configure the virtual machine's network connection method, including internal network, external network, or hybrid network. Selecting different network settings according to actual needs can ensure that the virtual machine can access the required network resources normally.
[0077] 3) Security settings: Configure the security policies for the virtual machine, including access control, firewall rules, security patches, etc., to ensure the security and stability of the virtual machine and prevent potential security risks and vulnerabilities;
[0078] 4) Virtual machine image: Select a suitable virtual machine image or template, including the operating system type and version, pre-installed applications, etc. Selecting a suitable image can simplify the deployment process of virtual machines and provide a consistent running environment.
[0079] 5) Disk and storage settings: Configure the virtual machine's disk and storage resources, including disk size, disk type, storage pool, etc. Select the appropriate storage configuration according to application needs and performance requirements to ensure that the virtual machine has sufficient storage space and high-speed access performance.
[0080] In some embodiments, virtual machine deployment parameters include at least one of the following: IP address of each server under test, virtualization type, number of CPU cores of the created virtual machine, memory size of the created virtual machine, name of the local ISO installation image, network name used, system version installed on the created virtual machine, and disk path format.
[0081] The virtualization type can be kvm, xen, or qemu.
[0082] For example, the virtual machine created has "4" CPU cores, "8" memory, uses "default" network name (Network Address Translation, NAT), has "rhel8" installed operating system, and uses "qcow2" file format on the disk.
[0083] Understandably, by obtaining virtual machine deployment parameters, information such as the virtual machine's specifications, operating system, and network configuration can be determined. This allows for the correct configuration and deployment of the virtual machine according to requirements, enabling it to meet application needs and provide good performance and availability.
[0084] Step 212: Based on the virtual machine deployment parameters, automatically create virtual machines on each server under test, and assign Internet Protocol (IP) addresses to the virtual machines on each server under test. The IP addresses are used to enable communication between each server under test and the virtual machines on it.
[0085] Optionally, one or more virtual machines can be created on each server under test.
[0086] Optionally, the control machine can use management scripts to call commands such as virt-install and expect to achieve automated virtual machine creation, where the management scripts encapsulate commands such as virt-install and expect.
[0087] Among them, virt-install is a command-line tool used to create and manage virtual machines on a virtualization platform. It can create virtual machines by specifying virtual machine configuration parameters, such as memory size, disk size, network settings, etc.
[0088] Expect is an automation tool used to write interactive scripts that can simulate user input at the command line, such as entering passwords and responding to prompts. Expect enables automated interactive tasks, such as automating the deployment and configuration of virtual machines.
[0089] Optionally, users can modify and execute the command ". / manager.sh --user 1.1.1.1 --os_variant centos8 --disk_path / home / kvm / centos.qcow2 --cdrom / home / kvm / centos8.iso" on the control machine according to their needs. This command performs operations based on virtual machine deployment parameters, including specifying the user, operating system variant, disk path, and CD-ROM path.
[0090] The main parameters involved in the above command are as follows:
[0091] --user refers to the IP address of the server under test. Multiple IP values can be specified at the same time to perform energy consumption tests on multiple servers under test.
[0092] --virt-type specifies the type of virtualization, such as kvm, xen, qemu, etc., with kvm being the default.
[0093] --vcpus specifies the number of CPU cores in the virtual machine being created; the default is 4.
[0094] --memory refers to the size of the virtual machine memory to be created, which is 8192M = 8G by default;
[0095] --cdrom specifies the name of the local ISO installation image;
[0096] --network network=default specifies the network name to use, which defaults to the default NAT network created by the system.
[0097] --os_variant specifies the version of the operating system installed on the virtual machine, which defaults to rhel8;
[0098] --disk_path specifies the disk path format, which defaults to qcow2 file format.
[0099] It should be noted that IP addresses can be used for addressing and routing in network communication. Through IP addresses, the server under test and the virtual machines created on it can send and receive data to each other on the Internet.
[0100] Step 213: Based on the IP address of the virtual machine on each server under test, send a software installation command to the virtual machine on each server under test to install energy consumption testing related software on the virtual machine on each server under test.
[0101] Optionally, the management script controls the server under test to execute the installation command for the energy consumption test-related software for each virtual machine on it, such as ". / manager.sh -H 192.168.122.125 -r'bash install.sh'".
[0102] In this embodiment of the invention, by obtaining virtual machine deployment parameters, virtual machines are automatically created on each server under test based on the virtual machine deployment parameters, and IP addresses are assigned to the virtual machines on each server under test. This enables the virtual machines to be correctly configured and deployed according to requirements, so that the virtual machines can meet the application requirements and provide good performance and availability. It also enables communication between each server under test and the virtual machines on it. Based on the IP address of the virtual machines on each server under test, software installation commands are sent to the virtual machines on each server under test, thereby facilitating the rapid installation of energy consumption testing related software on the virtual machines on each server under test.
[0103] In some embodiments, the IPMI tool is used to configure different levels of power consumption for each server under test, including:
[0104] With the virtual machines on each server under test in an idle state, the total power consumption of each server under test is obtained as the lower limit of power consumption for testing.
[0105] By dividing the power consumption between the lower limit and the preset upper limit by a preset number of equal parts, different levels of power consumption can be obtained.
[0106] Based on different power consumption levels, the power consumption settings for each server under test are configured using the IPMI tool.
[0107] Optionally, based on the IP address of the virtual machine on each server under test, the running status of the virtual machine on each server under test is obtained, and it is determined whether the virtual machine on each server under test is in an idle state. If so, the total power consumption of each server under test is obtained in that state as the lower limit of the power consumption for testing.
[0108] The preset power consumption limit is the maximum power consumption that each server under test can support by default, but it can also be customized by the user.
[0109] For example, the lower limit of power consumption Power_min is 300w, and the preset upper limit of power consumption Power_max is 800w. The power consumption levels between Power_min and Power_max are divided into ten equal parts, and the power consumption levels are set to 300w, 350w, 400w, 450w, 500w, 550w, 600w, 650w, 700w, 750w, and 800w respectively.
[0110] Optionally, the ipmitool raw 0x79 command can be used to view power consumption settings. "0x3a0x7a 0x01 0x580x02" indicates that the current power consumption is limited to 600W.
[0111] In this embodiment of the invention, by obtaining the total power consumption of each server under test when the virtual machines on each server under test are in an idle state, the lower limit of power consumption for testing can be obtained more accurately. By performing a preset number of equal division operations between the lower limit of power consumption and the preset upper limit of power consumption, different levels of power consumption can be obtained, enabling precise control of the power consumption of the server under test and ensuring that it operates within the preset power consumption range. Based on different levels of power consumption, the power consumption of each server under test can be set using the IPMI tool, thereby allowing testing of the server at different power consumption levels. This allows for evaluation of the server's performance and stability under different load conditions, improving the accuracy of server energy consumption testing.
[0112] In some embodiments, at each power consumption level, the virtual machines on each server under test are controlled to perform automated power consumption tests based on power consumption testing software and automatic response software to obtain power consumption test data for each server under test, including:
[0113] At each power consumption level, each server under test sends power consumption test commands to the virtual machines on each server under test, so that the virtual machines on each server under test execute the power consumption test commands based on the power consumption test software and the automatic response software, and obtain the power consumption test data of each server under test.
[0114] Optionally, a management script can be used to control each server under test to issue energy consumption test commands to the virtual machines on each server under test, such as ". / manager.sh -H192.168.122.125 -r'bash stress.sh'".
[0115] It should be noted that the management script can automatically obtain the IP addresses of all virtual machines. "192.168.122.125" in the above command is the IP address of one of the virtual machines. Through this IP address, the virtual machine can communicate with the corresponding server under test, thereby controlling the server under test to execute energy consumption test commands on each virtual machine on it.
[0116] Alternatively, the energy consumption testing software can be Unixbench, Superbench, or similar software.
[0117] Alternatively, the automated response software can be Expect, which allows scripts to simulate user interactions with the system and validate system responses. By using Expect, various tasks can be automated, such as logging into remote servers, automating software installation processes, and automating command-line operations. Expect can help simplify automated testing and system administration tasks, improving task processing efficiency.
[0118] Optionally, the management script file manager.sh can encapsulate the expect software, thereby enabling automated energy consumption testing and improving testing efficiency.
[0119] Understandably, by controlling each server under test to send energy consumption test commands to the virtual machines on each server under test at each power consumption level, the virtual machines on each server under test can execute the energy consumption test commands based on the energy consumption test software and automatic response software, thereby obtaining the energy consumption test data of each server under test, thus achieving automated testing and improving the efficiency of energy consumption testing.
[0120] In some embodiments, the above method further includes:
[0121] Obtain the energy consumption test data uploaded by each server under test;
[0122] The system processes energy consumption test data, automatically generates charts, and outputs test results.
[0123] Figure 4 Examples of energy consumption test results provided for embodiments of the present invention. Figure 4As shown, the power consumption levels are 500W, 600W, 700W, 800W, 900W, 1000W, 1100W, 1200W, 1300W, and 1400W. The test score for power consumption level 500W is 20 points, and the test score for power consumption level 1000W is 100 points. In the power consumption range of 500-1000W, the test score increases with the increase of power consumption level. In the power consumption range of 1000-1400W, the test score remains the same, at 100 points.
[0124] Understandably, by acquiring the energy consumption test data uploaded by each server under test, processing the energy consumption test data, and automatically generating charts to output test results, it is possible to better understand energy consumption patterns and trends and quickly obtain key information about energy consumption.
[0125] In some embodiments, energy consumption test data includes multiple individual test data.
[0126] The energy consumption test data is processed and automated charts are generated to output the test results, including:
[0127] For each power consumption level, each individual test data is compared with the baseline system test data corresponding to each individual test data to obtain the index value corresponding to each individual test data.
[0128] The test score is obtained based on the index value corresponding to each individual test data item;
[0129] Based on the test scores at each power consumption level, automated charts are generated and the test results are output.
[0130] Among them, the baseline system test data is the test data obtained by evaluating and verifying the initial system performance of each server under test.
[0131] Alternatively, when using the UnixBench tool for energy consumption testing, UnixBench performs multiple individual tests by running a series of standardized benchmark programs to test the performance of the Unix system from different aspects, such as CPU performance, memory performance, file system performance, etc.
[0132] Optionally, weights can be set for each individual test, and the overall test score of the server under test can be obtained based on the index value corresponding to each individual test data and the weight corresponding to each individual test.
[0133] It should be noted that the test score varies at different power consumption levels; the higher the test score, the better the system performance of the server under test.
[0134] Understandably, by comparing each individual test data point with the baseline system's test data to obtain the overall test score, the performance of the server under test at different power consumption levels can be evaluated. By comparing the power consumption test data of the server under test with the baseline system's test data, the accuracy of the test results can be improved, determining whether the server under test has reached or exceeded the performance level of the baseline system. Through automated charting and output of test results, the test data can be intuitively displayed to users or relevant personnel for a better understanding of the server's performance.
[0135] Figure 5 This is a second schematic flowchart illustrating the server energy consumption testing method provided in an embodiment of the present invention. Figure 5 As shown, the server energy consumption testing method, applied to the control unit, includes the following steps:
[0136] Step 501: Install Python software on the control unit;
[0137] Step 502: Obtain the test parameters input by the user;
[0138] Step 503: Control the server under test to install tools and deploy scripts;
[0139] Step 504: Divide and set power consumption levels;
[0140] Step 505: Start the test;
[0141] Step 506: Start running the energy consumption testing software;
[0142] Step 507: Current power consumption level test complete;
[0143] Step 508: Determine whether all power consumption level tests have been completed. If yes, proceed to step 509; otherwise, proceed to step 506.
[0144] Step 509: Obtain the test data uploaded by the server under test and process the test data;
[0145] Step 510, Test ends.
[0146] Understandably, installing Python software on the control machine facilitates the writing of management scripts, which in turn manage the server under test. By acquiring user-inputted test parameters, the system can control the installation of tools and the deployment of scripts on the server under test. Furthermore, by dividing and setting power consumption levels, energy consumption tests can be performed on the server under test at different power levels. After the test begins, the relevant energy consumption testing software is run to complete the test at the current power consumption level. After the current power consumption level test is completed, it is determined whether all power consumption level tests have been completed. If not, the energy consumption testing software continues to run; if so, the test data uploaded by the server under test is acquired and processed until the test ends. This allows for the gradual completion of tests at all power consumption levels, obtaining test data for different power consumption levels. The high degree of automation improves testing efficiency.
[0147] The server energy consumption testing device provided in the embodiments of the present invention is described below. The server energy consumption testing device described below can be referred to in correspondence with the server energy consumption testing method described above.
[0148] Figure 6 This is a schematic diagram of the server energy consumption testing device provided by the present invention, as shown below. Figure 6 As shown, the server energy consumption testing device 600 includes:
[0149] Configuration unit 610 is used to automatically create virtual machines on each server under test and install energy consumption testing related software on the virtual machines. The energy consumption testing related software includes: Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software.
[0150] The configuration unit 620 is used to configure different levels of power consumption for each server under test using the IPMI tool;
[0151] Test unit 630 is used to control the virtual machines on each server under test to perform automated energy consumption tests based on energy consumption testing software and automatic response software at each power consumption level, so as to obtain energy consumption test data for each server under test.
[0152] Optionally, a virtual machine is automatically created on each server under test, and energy consumption testing software is installed on the virtual machine, including:
[0153] Obtain virtual machine deployment parameters;
[0154] Based on the virtual machine deployment parameters, virtual machines are automatically created on each server under test, and Internet Protocol IP addresses are assigned to the virtual machines on each server under test. The IP addresses are used to enable communication between each server under test and the virtual machines on it.
[0155] Based on the IP address of the virtual machine on each server under test, a software installation command is sent to the virtual machine on each server under test to install energy consumption testing related software on the virtual machine on each server under test.
[0156] Optionally, the virtual machine deployment parameters include at least one of the following: the IP address of each server under test, the virtualization type, the number of CPU cores of the created virtual machine, the memory size of the created virtual machine, the name of the local ISO installation image, the network name used, the version of the operating system installed on the created virtual machine, and the disk path format.
[0157] Optionally, the IPMI tool can be used to configure different levels of power consumption for each server under test, including:
[0158] With the virtual machines on each server under test in an idle state, the total power consumption of each server under test is obtained as the lower limit of power consumption for testing.
[0159] By dividing the power consumption between the lower limit and the preset upper limit by a preset number of equal parts, different levels of power consumption can be obtained.
[0160] Based on different power consumption levels, the power consumption settings for each server under test are configured using the IPMI tool.
[0161] Optionally, at each power consumption level, the virtual machines on each server under test are controlled to perform automated power consumption tests based on power consumption testing software and automatic response software to obtain power consumption test data for each server under test, including:
[0162] At each power consumption level, each server under test sends power consumption test commands to the virtual machines on each server under test, so that the virtual machines on each server under test execute the power consumption test commands based on the power consumption test software and the automatic response software, and obtain the power consumption test data of each server under test.
[0163] Optionally, the above-mentioned device further includes:
[0164] The acquisition unit is used to acquire the energy consumption test data uploaded by each server under test;
[0165] The output unit is used to process energy consumption test data, automatically generate charts, and output test results.
[0166] Optionally, the energy consumption test data includes multiple individual test data points.
[0167] The energy consumption test data is processed and automated charts are generated to output the test results, including:
[0168] For each power consumption level, each individual test data is compared with the baseline system test data corresponding to each individual test data to obtain the index value corresponding to each individual test data.
[0169] The test score is obtained based on the index value corresponding to each individual test data item;
[0170] Based on the test scores at each power consumption level, automated charts are generated and the test results are output.
[0171] Among them, the baseline system test data is the test data obtained by evaluating and verifying the initial system performance of each server under test.
[0172] It should be noted that the server energy consumption testing device provided in this embodiment of the invention can implement all the method steps implemented in the above-described server energy consumption testing method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0173] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a server energy consumption testing method. This method is applied to a control unit, which is connected to at least one server under test via a switch. The method includes: automatically creating a virtual machine on each server under test and installing energy consumption testing related software on the virtual machine. The energy consumption testing related software includes: an Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software; using the IPMI tool, setting different power consumption levels for each server under test; and controlling the virtual machine on each server under test to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software at each power consumption level to obtain energy consumption test data for each server under test.
[0174] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0175] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the server energy consumption testing method provided by the above methods. This method is applied to a control machine, which is connected to at least one server under test via a switch. The method includes: automatically creating a virtual machine on each server under test and installing energy consumption testing related software on the virtual machine. The energy consumption testing related software includes: an Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software; setting different power consumption levels for each server under test using the IPMI tool; and controlling the virtual machine on each server under test to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software at each power consumption level to obtain energy consumption test data for each server under test.
[0176] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the server energy consumption testing method provided by the above methods. This method is applied to a control machine, which is connected to at least one server under test via a switch. The method includes: automatically creating a virtual machine on each server under test and installing energy consumption testing related software on the virtual machine. The energy consumption testing related software includes: an Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software; setting different power consumption levels for each server under test using the IPMI tool; and controlling the virtual machine on each server under test to perform automated energy consumption testing based on the energy consumption testing software and the automatic response software at each power consumption level to obtain energy consumption test data for each server under test.
[0177] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0178] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for testing server energy consumption, characterized in that, Applied to a control unit, wherein the control unit is connected to at least one server under test via a switch, the method includes: A virtual machine is automatically created on each server under test, and energy consumption testing software is installed on the virtual machine. The energy consumption testing software includes: the Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software. The energy consumption testing software is Unixbench or Superbench software, and the automatic response software is expect software. With the virtual machines on each server under test in an idle state, the total power consumption of each server under test is obtained as the lower limit of power consumption for testing; a preset number of equal division operations are performed between the lower limit of power consumption and the preset upper limit of power consumption to obtain different levels of power consumption; based on the different levels of power consumption, the power consumption of each server under test is set using the IPMI tool. At each power consumption level, each server under test is controlled to send an energy consumption test command to the virtual machine on each server under test, so that the virtual machine on each server under test executes the energy consumption test command based on the energy consumption test software and the automatic response software, and obtains the energy consumption test data of each server under test. Acquire the energy consumption test data uploaded by each server under test, the energy consumption test data including multiple individual test data; For each power consumption level, each individual test data is compared with the baseline system test data corresponding to that individual test data to obtain the index value corresponding to each individual test data; based on the index value corresponding to each individual test data, the test score is obtained; based on the test score at each power consumption level, automated charts are generated and the test results are output. The baseline system test data is the test data obtained by evaluating and verifying the initial system performance of each server under test.
2. The server energy consumption testing method according to claim 1, characterized in that, The step of automatically creating a virtual machine on each server under test and installing energy consumption testing software on the virtual machine includes: Obtain virtual machine deployment parameters; Based on the virtual machine deployment parameters, a virtual machine is automatically created on each server under test, and an Internet Protocol (IP) address is assigned to the virtual machine on each server under test. The IP address is used to enable communication between each server under test and the virtual machine on it. Based on the IP address of the virtual machine on each server under test, a software installation command is sent to the virtual machine on each server under test to install the energy consumption testing related software on the virtual machine on each server under test.
3. The server energy consumption testing method according to claim 2, characterized in that, The virtual machine deployment parameters include at least one of the following: the IP address of each server under test, the virtualization type, the number of CPU cores of the created virtual machine, the memory size of the created virtual machine, the name of the local ISO installation image, the network name used, the version of the operating system installed on the created virtual machine, and the disk path format.
4. A server energy consumption testing device, characterized in that, include: The configuration unit is used to automatically create virtual machines on each server under test and install energy consumption testing related software on the virtual machines. The energy consumption testing related software includes: the Intelligent Platform Management Interface (IPMI) tool, energy consumption testing software, and automatic response software. The energy consumption testing software is Unixbench or Superbench software, and the automatic response software is expect software. The setting unit, when the virtual machines on each server under test are in an idle state, obtains the total power consumption of each server under test as the lower limit of power consumption for testing; performs a preset number of equal division operations between the lower limit of power consumption and the preset upper limit of power consumption to obtain different levels of power consumption; based on the different levels of power consumption, sets the power consumption of each server under test through the IPMI tool. The test unit is used to control each server under test to send energy consumption test commands to the virtual machines on each server under test at each power consumption level, so that the virtual machines on each server under test execute the energy consumption test commands based on the energy consumption test software and the automatic response software, and obtain the energy consumption test data of each server under test. The acquisition unit is used to acquire the energy consumption test data uploaded by each server under test, and the energy consumption test data includes multiple individual test data. The output unit is used to compare each individual test data with the baseline system test data corresponding to each individual test data for each power consumption level, and obtain the index value corresponding to each individual test data; based on the index value corresponding to each individual test data, obtain the test score; based on the test score value under each power consumption level, perform automated chart drawing, and output the test results; The baseline system test data is the test data obtained by evaluating and verifying the initial system performance of each server under test.
5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the server energy consumption testing method as described in any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the server energy consumption testing method as described in any one of claims 1 to 3.