A method, system, device and medium for testing virtual network card binding redundancy function

By simulating the abnormal situation of the virtual network card in the virtual machine environment and testing the redundant function of the virtual network card, the gap in the testing of the virtual network card binding redundancy function in the existing technology is solved, and the stability and long-term operation of the virtualized business are ensured.

CN116112412BActive Publication Date: 2024-10-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310174209.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-10-15
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

Existing testing technology mainly tests the binding redundancy function of physical network cards, but fails to effectively cover the application scenarios of the binding redundancy function of virtual network cards, resulting in insufficient verification of the stability of virtual network cards under abnormal circumstances and affecting the performance of virtualization services. Long lasting operation.

Method used

By building a hardware test environment, installing the virtual machine and enabling the SR-IOV function, creating a virtual network card and connecting it directly to the virtual machine, performing network card binding and connection settings, using the auxiliary server to simulate virtual network card abnormalities, conducting redundancy testing, and verifying virtualization The stability of the network card under abnormal conditions.

Benefits of technology

It achieves comprehensive redundancy function testing for abnormal situations during the virtual network card binding process, ensures the stability of the virtual network card under abnormal situations, and supports the continuous and effective application of virtualization services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112412B_ABST
    Figure CN116112412B_ABST
Patent Text Reader

Abstract

The present invention proposes a method, system, device and medium for testing the redundant function of virtual network card binding, the method comprising: building a hardware test environment; installing the required software environment, and installing a virtual machine on a test server; enabling the SR‑IOV function of the test server; creating a virtual network card on the test server and connecting it directly to the virtual machine; performing network card binding and connection settings; using an auxiliary server to simulate abnormal conditions of the virtual network card and perform redundant capability testing. The present invention can comprehensively cover the redundant function testing of abnormal conditions during the virtual network card binding process, and can verify the stability of network card virtualization under abnormal conditions, ensuring continuous and effective application in business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more particularly to a method, system, device and medium for testing a virtual network card binding redundancy function. Background Art

[0002] NIC bonding is a technology that achieves NIC redundancy, bandwidth expansion, and load balancing by bonding multiple physical NICs into one logical NIC, or bonding multiple physical network ports into one logical network port. The redundancy function can quickly switch the business data flow to another bound NIC when a bound NIC fails, which effectively reduces the impact of NIC abnormalities on the business, and is widely used in actual production and operation environments.

[0003] A virtual network card refers to a network card simulated by software functions. There are currently a variety of network card virtualization technologies. Among them, SR-IOV technology is increasingly used in service deployment of virtualized services such as virtual machines and containers due to its high performance and high scalability, and support for virtual network card pass-through, which has lower latency.

[0004] Existing testing technologies generally only test the binding redundancy function of physical network cards. The invention patent with application number CN113630265A discloses a virtual network redundancy backup method and device based on smart network cards, and proposes a redundant backup network based on OVS bridges that binds virtual network ports and physical network ports through SR-IOV technology. This technical solution only focuses on building multiple redundant structures of virtual and actual network ports through OVS bridges, and the test of SR-IOV virtual network card binding redundancy function is still blank.

[0005] It can be seen that how to achieve comprehensive coverage of application scenarios of virtual network card binding redundant functions and conduct tests to ensure the long-term operation of network cards and servers is an urgent problem to be solved. Summary of the invention

[0006] In view of the above problems, the purpose of the present invention is to provide a virtual network card binding redundant function testing method, system, device and medium, which can effectively and comprehensively cover the redundant function testing of abnormal situations in the virtual network card binding process, and can verify the stability of network card virtualization under abnormal situations, thereby ensuring the continuous and effective application of the business.

[0007] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0008] In a first aspect, the present invention discloses a method for testing a virtual network card binding redundancy function, comprising:

[0009] Select test servers and auxiliary servers, and build a hardware test environment;

[0010] Install the required software environment and install a virtual machine on the test server;

[0011] Enable the SR-IOV function of the test server;

[0012] Create a virtual network card on the test server and connect it directly to the virtual machine;

[0013] Perform network card binding and connectivity settings;

[0014] Use auxiliary servers to simulate abnormal situations of virtual network cards and perform redundancy capacity tests.

[0015] Further, select the test server and auxiliary server, and build the hardware test environment, including:

[0016] Select a server that supports hardware virtualization and motherboard SR-IOV as the test server;

[0017] By modifying the BIOS parameters of the test server, the hardware virtualization function and the motherboard SR-IOV function are enabled;

[0018] Build the test server and auxiliary server data links according to the type of network card to be tested.

[0019] Further, install the required software environment and install the virtual machine on the test server including:

[0020] Install the Linux operating system, network card driver software, and management software on the test server and auxiliary server respectively;

[0021] Install the virtual machine on the test server using the yum tool;

[0022] Install the same network card driver software as the test server on the virtual machine. After the installation is complete, shut down the virtual machine.

[0023] Furthermore, the SR-IOV function of the test server is enabled, including:

[0024] The SR-IOV function of the test server is enabled by adding the commands intel_iommu=on and iommu=pt in the kernel startup parameters.

[0025] Furthermore, create a virtual network card on the test server and connect it directly to the virtual machine, including:

[0026] Create a virtual network card in the operating system of the test server and write the configuration file of the virtual network card;

[0027] Use preset commands and configuration files to detach the virtual network card from the test server and mount it to the virtual machine;

[0028] Start the virtual machine and obtain the network port information of the virtual network card.

[0029] Further, perform network card binding and connectivity settings, including:

[0030] Use the network card binding script to bind the network port of the virtual network card in the virtual machine and configure the IP. Bind the physical network card on the auxiliary server and configure the binding port IP so that the binding port of the virtual machine is connected to the binding port of the auxiliary server.

[0031] Furthermore, the auxiliary server is used to simulate the abnormal situation of the virtual network card and perform redundancy capacity testing, including:

[0032] Send a PING packet to the virtual machine in the test server through the auxiliary server;

[0033] The binding redundancy function of the virtual network port is verified by turning on and off the data link and turning on and off the virtual network port and physical network port of the test server.

[0034] In a second aspect, the present invention further discloses a virtual network card binding redundancy function testing system, comprising:

[0035] Preparation module, used to select test servers and auxiliary servers, and build the hardware test environment;

[0036] Function configuration module, used to install the required software environment and install the virtual machine on the test server;

[0037] Function startup module, used to enable the SR-IOV function of the test server;

[0038] Virtual network card configuration module, used to create a virtual network card on the test server and connect it directly to the virtual machine;

[0039] Network port connectivity module, used for network card binding and connectivity settings;

[0040] The test module is used to use the auxiliary server to simulate the abnormal situation of the virtual network card and perform redundancy capacity testing.

[0041] In a third aspect, the present invention further discloses a virtual network card binding redundancy function testing device, comprising:

[0042] A memory, used for storing a virtual network card binding redundancy function test program;

[0043] A processor is used to implement the steps of the virtual network card binding redundancy function testing method as described in any one of the above items when executing the virtual network card binding redundancy function testing program.

[0044] Correspondingly, the present invention discloses a readable storage medium, on which a virtual network card binding redundant function test program is stored. When the virtual network card binding redundant function test program is executed by a processor, the steps of the virtual network card binding redundant function test method as described in any of the above items are implemented.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention provides a method, system, device and medium for testing the redundant function of virtual network card binding. By constructing a redundant structure of the virtual network card, the stability of redundant switching and virtualization functions in various situations is simulated and tested, and the redundant capability of virtual network card binding under various abnormal situations is effectively verified, thereby supporting the long-term stable application and operation of servers and network cards in virtualization services, filling the gap in the field of virtual network card binding redundant function testing.

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

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 It is a method flow chart of a specific implementation mode of the present invention.

[0049] Figure 2 It is a system structure diagram of a specific implementation mode of the present invention.

[0050] In the figure, 1. Preparation module; 2. Function configuration module; 3. Function startup module; 4. Virtual network card configuration module; 5. Network port connectivity module; 6. Test module. DETAILED DESCRIPTION

[0051] The core of the present invention is to provide a method for testing the redundant function of virtual network card binding. In the prior art, the existing testing technology generally only performs redundant function testing on physical network cards, or only focuses on building a variety of redundant structures of virtual and actual network ports through OVS bridges, and there is still a blank in the testing of redundant function of SR-IOV virtual network card binding.

[0052] The virtual network card binding redundant function testing method provided by the present invention first sets up a hardware testing environment, installs the network card to be tested on the test server and connects it to the auxiliary server. Then install the required software environment and install the virtual machine on the test server. At this time, turn on the SR-IOV function of the test server, create a virtual network card and connect it directly to the virtual machine, and perform network card binding and connectivity settings. Finally, simulate abnormal conditions of the virtual network card and perform redundant capability testing. It can be seen that the present invention can effectively and comprehensively cover the redundant function testing of abnormal conditions in the virtual network card binding process, and can verify the stability of network card virtualization under abnormal conditions, ensuring continuous and effective application in business.

[0053] In order to enable those skilled in the art to better understand the present invention, the English abbreviations of the key terms involved in the present invention are explained as follows:

[0054] OS (Operating System): operating system.

[0055] BIOS (Basic Input Output System): Basic input output system.

[0056] KVM (Kernel-based Virtual Machine): A virtual machine based on the Linux kernel.

[0057] SR-IOV (Single-Root I / O Virtualization): Single-root I / O virtualization is a standard launched by PCI-SIG. It defines a standard mechanism for PCIe device virtualization technology, which is used to virtualize a PCIe device into multiple PCIe devices. Each virtual PCIe device has its own PCIe configuration space.

[0058] PF (Physical Function): Physical function, which manages the channel function of PCIe devices at the physical level. It can be regarded as a complete PCIe device with the function of managing and configuring VF.

[0059] VF (Virtual Function): Virtual function is the channel function of PCIe device at the virtual level, that is, it only includes I / O function. VFs share physical resources. All VFs are derived from PF.

[0060] Firmware: Firmware is a program written into EPROM (erasable programmable read-only memory) or EEPROM (electrically erasable programmable read-only memory).

[0061] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] See also Figure 1 As shown, the present invention discloses a method for testing a virtual network card binding redundancy function, comprising the following steps:

[0063] S1: Select a test server and auxiliary servers, and build a hardware test environment.

[0064] Specifically: First, select a server that supports hardware virtualization and motherboard SR-IOV as the test server, and enable the hardware virtualization and motherboard SR-IOV functions by modifying the BIOS parameters of the test server. Then, build a data link between the test server and the auxiliary server according to the type of the network card to be tested.

[0065] First, you need to ensure that the test server supports hardware virtualization and motherboard SR-IOV. Regarding virtualization support, especially CPU virtualization support, mainstream manufacturers currently have related technologies, such as Intel VT technology or AMD SVM technology. However, you need to modify the options in the BIOS to ensure that this function is turned on.

[0066] When building the hardware environment, the type of network card to be tested on the server is affected. Currently, there are two main types of network cards based on the number of network ports: single-port network cards and dual-port network cards. Their construction strategies are as follows:

[0067] When using a single-port network card, the test server and the auxiliary server are each equipped with two network cards, and the two network cards are directly connected via network cables. When using a dual-port network card, the test server and the auxiliary server are each equipped with one network card, and the two network ports are directly connected via network cables.

[0068] In addition, after booting up, you need to ensure that the network cards of the test server and the auxiliary server can be recognized normally on the link. Since the default register parameters in the network card firmware will affect its virtualization settings, you also need to refresh the network card firmware to the version to be tested.

[0069] In a specific implementation manner, this step is specifically as follows:

[0070] First, select the test server and auxiliary server. Among them, select the server with Intel CPU, hardware virtualization function and motherboard SR-IOV function as the test server. Refresh the BIOS of the test server to the specified version, and modify the BIOS parameters to enable VT-D Enabled and SR-IOV support Enabled.

[0071] Then, install the network card MCX512A-ACAT for the test server and auxiliary server. It is a 25G dual-port optical fiber intelligent network card. The two network ports of the network card are connected to each other through the adapted optical fiber network cable. The test network ports of the test server are recorded as test_eth0 and test_eth1, and the network ports of the auxiliary server are recorded as server_eth0 and server_eth1.

[0072] S2: Install the required software environment and install a virtual machine on the test server.

[0073] The software environment mainly refers to the software packages required for installing Linux OS and KVM, the driver software and management software corresponding to the network card. KVM refers to the Linux kernel-based virtual machine, which is an open source system virtualization module. When installing, first install the necessary software packages in the Linux system through the yum tool. The specific command is yum install kvm libvirt python-virtinst qemu-vm virt-viewer bridge-utils. Then use the command

[0074] / etc / init.d / libvirtd start starts related services. Finally, adjust the system configuration files and check the software environment until the virtual machine can be successfully installed.

[0075] The purpose of installing the driver software and management software corresponding to the network card is to enable the functions of the network card to be driven normally and to be able to modify the function options related to the network card register. After the virtual machine is installed, install the OS in the virtual machine and install the network card driver software consistent with the test server. After the installation is complete, you need to shut down the virtual machine for subsequent operations.

[0076] In a specific implementation manner, this step is specifically as follows:

[0077] Install the CentOS8.2 Linux operating system on the test server and auxiliary server, install the software environment required by KVM, and download and install the required software through the system's built-in command yum. The specific commands are as follows:

[0078] yum install kvm libvirt python-virtinst qemu-kvm virt-viewer bridge-utils.

[0079] After the download is complete, start the related services through the command / etc / init.d / libvirtd start.

[0080] At this time, copy the complete CentOS8.2 system ISO file to the / root path. Use the virt-manager command to open the virtual machine's graphical management interface, try to install the virtual machine, select CentOS8.2.iso under / root as the system image to install, and keep all other settings as default. If the virtual machine starts normally, continue. Otherwise, check the system configuration files and software packages according to the error until the virtual machine can be installed normally. Among them, the installed virtual machine is named virtual machine A (vm_A).

[0081] Finally, install the latest network card driver from the Mellanox official website on both the test server and virtual machine A. After installing the driver, shut down virtual machine A. After installing the driver on the test server, install the Mellanox network card management software and start related services through mst ​​start.

[0082] S3: Enable the SR-IOV function of the test server.

[0083] Specifically, modify the kernel startup parameters of the operating system to enable the test server to support the SR-IOV function. For example, to enable the IOMMU function, you need to add the intel_iommu=on, iommu=pt commands to the kernel startup parameters. After enabling, you need to confirm whether the SR-IOV function of the network card is enabled. If not, you need to enable the SR-IOV function of the network card through the network card manufacturer's tool.

[0084] In a specific implementation manner, this step is specifically as follows:

[0085] Query the name of the network card in the management software by executing the mst status command. In this embodiment, it is / dev / mst / mt4119_pciconf0. Query the default parameters of the network card mlxconfig-d / dev / mst / mt4119_pciconf0 q. Pay special attention to the setting parameters of SRIOV_EN and NUM_OF_VFS. If SRIOV_EN is set to 1, the SRIOV function of the network card is enabled. NUM_OF_VFS is the maximum number of VFs that the network card can support. In this embodiment, only one VF needs to be created. This number can be set to non-0. The firmware default number of 8 can be used.

[0086] Then, modify the kernel startup parameters of the test server OS. This includes: execute the following command vim / etc / default / grub in the test server OS, add the kernel startup parameters intel_iommu=on iommu=pt in the GRUB_CMDLINE_LINUX line, save the file changes and exit the editor, and execute grub2-mkconfig-o / boot / efi / EFI / centos / grub.cfg to regenerate a new grub configuration file. After all settings are completed, execute the reboot command to restart the test server to make the settings take effect.

[0087] S4: Create a virtual network card on the test server and connect it directly to the virtual machine.

[0088] Specifically, create a virtual network card under the test server OS, write a virtual network card configuration file, separate the virtual network card from the test server and mount it to the virtual machine through commands and configuration files, and enable the virtual network card that is visible to the virtual machine. When creating a virtual network card, one virtual network port is created for each physical network port. According to the above server network card configuration, two virtual network ports should be created. After connecting them directly to the virtual machine, the virtual machine should also see two virtual network cards.

[0089] In a specific implementation manner, this step is specifically as follows:

[0090] First, by executing the lspci|grep-i eth command, you can see that the links of the network card are 18:00.0 and 18:00.1.

[0091] At this time, run echo 1> / sys / class / net / eth0 / device / sriov_numvfs and echo1> / sys / class / net / eth1 / device / sriov_numvfs to create two virtual network cards (VFs) for the two physical network ports (PFs). Run the command lspci|grep–i eth to find that the network card link has been added, and the two VF links are 18:01.0 and 18:01.1 respectively.

[0092] Then, execute the virsh nodedev-detach pci_0000_18_01_0 and virsh nodedev-detach pci_0000_18_01_1 commands on the test server OS to detach all virtual network cards from the test server, write the configuration file new_interface.xml, and execute the virsh attach-device vm_A / tmp / new_interface.xml–config command to mount the virtual network card to the virtual machine.

[0093] Finally, start virtual machine A. If you can see two virtual network cards normally, the setting is successful. The network port names are recorded as veth0 and veth1.

[0094] S5: Perform network card binding and connectivity settings.

[0095] Specifically: Use the network card binding script to bind the network port of the virtual network card in the virtual machine and configure the IP, bind the physical network card on the auxiliary server and configure the binding port IP, so that the binding port of the virtual machine and the binding port of the auxiliary server are connected.

[0096] In a specific implementation manner, this step is specifically as follows:

[0097] Use the network card binding script to bind the virtual machine network ports veth0 and veth1, and bind the auxiliary server network ports server_eth0 and server_eth1. Set the binding mode to active-standby mode. After successful binding, generate a binding logical port bond0 on the auxiliary server and configure bond0 ip to 9.9.9.1. Generate a binding logical port vbond0 on the virtual machine and configure vbond0ip to 9.9.9.2. Use the ping command to test the connectivity of the two binding ports. If there is no abnormality, the connection is successful.

[0098] S6: Use the auxiliary server to simulate the abnormal situation of the virtual network card and perform redundancy capacity test.

[0099] Specifically, a PING packet is sent to the virtual machine in the test server through the auxiliary server; the binding redundancy function of the virtual network port is verified by respectively switching on and off the data link and switching on and off the virtual network port and the physical network port of the test server.

[0100] In a specific implementation manner, this step is specifically as follows:

[0101] Run the command ping 9.9.9.2|tee–a ping.log& on the auxiliary machine to redirect the ping result to the specified file and run it in the background. Then simulate an abnormal situation and observe the ping packet results.

[0102] Abnormal simulation operations include the following three methods:

[0103] 1. Unplug and plug the fiber optic cable of the server network port. First unplug the fiber optic cable corresponding to eth0, observe the ping packet situation, plug the fiber optic cable back, wait for 10 seconds, unplug the fiber optic cable corresponding to eth1, observe the ping packet situation, and wait for 10 seconds. Repeat the above plug-in and unplug test 10 times;

[0104] 2. Down / up the physical network port of the test server. On the test server OS, execute ifconfig eth0down, wait for 10 seconds, execute ifconfig eth0 up; ifconfig eth1 down, wait for 10 seconds, execute ifconfig eth1 up, repeat the above operation 10 times, then execute ifdown eth0, wait for 10 seconds, execute ifup eth0, ifdown eth1, wait for 10 seconds, execute ifup eth1, and repeat the above operation 10 times.

[0105] 3. Down / up the virtual network port of the virtual machine. In the virtual machine OS, execute ifconfig veth0 down, wait for 10 seconds, execute ifconfig veth0 up; ifconfig veth1 down, wait for 10 seconds, execute ifconfig veth1 up, repeat the above operation 10 times, then execute ifdown veth0, wait for 10 seconds, execute ifup veth0, ifdown veth1, wait for 10 seconds, execute ifup veth1, and repeat the above operation 10 times.

[0106] After performing the above operations, if there is no long-term interruption in the ping packets, it can be verified that the binding redundancy function of the virtual network card and the virtualization stability are normal.

[0107] It can be seen that the present invention provides a method for testing the redundant functions of virtual network card binding, which can effectively and comprehensively cover the redundant function testing of abnormal situations in the virtual network card binding process, and can verify the stability of network card virtualization under abnormal situations, thereby ensuring continuous and effective application of the business.

[0108] See also Figure 2 As shown, the present invention also discloses a virtual network card binding redundancy function testing system, including: a preparation module 1, a function configuration module 2, a function startup module 3, a virtual network card configuration module 4, a network port connection module 5 and a testing module 6.

[0109] Preparation module 1 is used to select the test server and auxiliary server and build the hardware test environment.

[0110] In a specific implementation, the preparation module 1 is specifically used to: select a server that supports hardware virtualization function and motherboard SR-IOV function as a test server; start the hardware virtualization function and motherboard SR-IOV function by modifying the BIOS parameters of the test server; and build a data link between the test server and the auxiliary server according to the type of the network card to be tested.

[0111] Function configuration module 2 is used to install the required software environment and install a virtual machine on the test server.

[0112] In a specific implementation, the function configuration module 2 is specifically used to: install the Linux operating system, network card driver software and management software on the test server and the auxiliary server respectively; install a virtual machine on the test server through the yum tool; install the network card driver software consistent with the test server on the virtual machine, and shut down the virtual machine after the installation is complete.

[0113] Function startup module 3 is used to enable the SR-IOV function of the test server.

[0114] In a specific implementation, the function startup module 3 is specifically used to enable the SR-IOV function of the test server by adding commands intel_iommu=on and iommu=pt to the kernel startup parameters.

[0115] The virtual network card configuration module 4 is used to create a virtual network card on the test server and directly connect it to the virtual machine.

[0116] In a specific implementation, the virtual network card configuration module 4 is specifically used to: create a virtual network card in the operating system of the test server and write a configuration file for the virtual network card; separate the virtual network card from the test server and mount it to the virtual machine through preset commands and configuration files; start the virtual machine and obtain the network port information of the virtual network card.

[0117] The network port connection module 5 is used for network card binding and connection settings.

[0118] In a specific implementation, the network port connectivity module 5 is specifically used to: bind the network port of the virtual network card in the virtual machine and configure the IP through the network card binding script, bind the physical network card in the auxiliary server and configure the binding port IP, so that the binding port of the virtual machine and the binding port of the auxiliary server are connected.

[0119] Test module 6 is used to use the auxiliary server to simulate the abnormal situation of the virtual network card and perform redundancy capacity test.

[0120] In a specific implementation, the test module 6 is specifically used to: send a PING packet to the virtual machine in the test server through the auxiliary server; and verify the binding redundancy function of the virtual network port by respectively turning on and off the data link and turning on and off the virtual network port and physical network port of the test server.

[0121] It can be seen that the virtual network card binding redundancy function testing system disclosed in the present invention, by constructing a redundant structure of the virtual network card, simulates and tests the stability of redundant switching and virtualization functions under various situations, and effectively verifies the virtual network card binding redundancy capability under various abnormal situations, thereby supporting the long-term stable application and operation of servers and network cards in virtualization services.

[0122] The present invention also discloses a virtual network card binding redundancy function testing device, comprising a processor and a memory; wherein the processor implements the following steps when executing a virtual network card binding redundancy function testing program stored in the memory:

[0123] 1. Select the test server and auxiliary server, and build the hardware test environment.

[0124] 2. Install the required software environment and install the virtual machine on the test server.

[0125] 3. Enable the SR-IOV function of the test server.

[0126] 4. Create a virtual network card on the test server and connect it directly to the virtual machine.

[0127] 5. Perform network card binding and connectivity settings.

[0128] 6. Use the auxiliary server to simulate the abnormal situation of the virtual network card and perform redundancy capacity test.

[0129] Furthermore, the virtual network card binding redundancy function testing device in this embodiment may also include:

[0130] The input interface is used to obtain the virtual network card binding redundant function test program imported from the outside, and save the obtained virtual network card binding redundant function test program to the memory, and can also be used to obtain various instructions and parameters transmitted by external terminal devices, and transmit them to the processor, so that the processor can use the above various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.

[0131] The output interface is used to output various data generated by the processor to the terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor. In this embodiment, the output interface may specifically include but is not limited to a USB interface, a serial interface, etc.

[0132] The communication unit is used to establish a remote communication connection between the virtual network card binding redundant function test device and the external server so that the virtual network card binding redundant function test device can mount the image file to the external server. In this embodiment, the communication unit may specifically include but is not limited to a remote communication unit based on wireless communication technology or wired communication technology.

[0133] The keyboard is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.

[0134] The display is used to display the relevant information of the server power supply line short circuit locating process in real time.

[0135] The mouse can be used to assist users in inputting data and simplify user operations.

[0136] The present invention also discloses a readable storage medium, wherein the readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM or any other form of storage medium known in the technical field. The readable storage medium stores a virtual network card binding redundant function test program, and when the virtual network card binding redundant function test program is executed by a processor, the following steps are implemented:

[0137] 1. Select the test server and auxiliary server, and build the hardware test environment.

[0138] 2. Install the required software environment and install the virtual machine on the test server.

[0139] 3. Enable the SR-IOV function of the test server.

[0140] 4. Create a virtual network card on the test server and connect it directly to the virtual machine.

[0141] 5. Perform network card binding and connectivity settings.

[0142] 6. Use the auxiliary server to simulate the abnormal situation of the virtual network card and perform redundancy capacity test.

[0143] In summary, the present invention can effectively and comprehensively cover the redundant function test of abnormal situations in the virtual network card binding process, and can verify the stability of network card virtualization under abnormal situations, thereby ensuring the continuous and effective application of the business.

[0144] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. As for the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0145] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0146] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0147] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0148] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.

[0149] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.

[0150] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0151] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0152] The above is a detailed introduction to the virtual network card binding redundant function testing method, system, device and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for testing a virtual network card binding redundancy function, characterized in that: include: Select test servers and auxiliary servers, and build a hardware test environment; Install the required software environment and install a virtual machine on the test server; Enable the SR-IOV function of the test server; Create a virtual network card on the test server and connect it directly to the virtual machine; Perform network card binding and connectivity settings; Use auxiliary servers to simulate abnormal conditions of virtual network cards and conduct redundancy capacity tests; The selection of the test server and auxiliary server and the establishment of the hardware test environment include: Select a server that supports hardware virtualization and motherboard SR-IOV as the test server; By modifying the BIOS parameters of the test server, the hardware virtualization function and the motherboard SR-IOV function are enabled; Build the test server and auxiliary server data link according to the type of network card to be tested; The installation of the required software environment and the installation of a virtual machine on the test server include: Install the Linux operating system, network card driver software, and management software on the test server and auxiliary server respectively; Install the virtual machine on the test server using the yum tool; Install the same network card driver software as the test server on the virtual machine. After the installation is complete, shut down the virtual machine. The step of enabling the SR-IOV function of the test server includes: Enable the SR-IOV function of the test server by adding the commands intel_iommu=on and iommu=pt in the kernel boot parameters; The step of creating a virtual network card on the test server and connecting it directly to the virtual machine includes: Create a virtual network card in the operating system of the test server and write the configuration file of the virtual network card; Use preset commands and configuration files to detach the virtual network card from the test server and mount it to the virtual machine; Start the virtual machine and obtain the network port information of the virtual network card; The network card binding and connectivity settings include: Use the network card binding script to bind the network port of the virtual network card in the virtual machine and configure the IP address. Bind the physical network card on the auxiliary server and configure the binding port IP address so that the binding port of the virtual machine is connected to the binding port of the auxiliary server. The method of using the auxiliary server to simulate an abnormal situation of the virtual network card and perform a redundancy capability test includes: Send a PING packet to the virtual machine in the test server through the auxiliary server; The binding redundancy function of the virtual network port is verified by turning on and off the data link and turning on and off the virtual network port and physical network port of the test server.

2. A virtual network card binding redundancy function testing system, characterized in that: include: Preparation module, used to select test servers and auxiliary servers, and build the hardware test environment; Function configuration module, used to install the required software environment and install the virtual machine on the test server; Function startup module, used to enable the SR-IOV function of the test server; Virtual network card configuration module, used to create a virtual network card on the test server and connect it directly to the virtual machine; Network port connectivity module, used for network card binding and connectivity settings; A test module is used to simulate abnormal conditions of virtual network cards using auxiliary servers to test redundancy capabilities; The preparation module is specifically used for: Select a server that supports hardware virtualization and motherboard SR-IOV as the test server; By modifying the BIOS parameters of the test server, the hardware virtualization function and the motherboard SR-IOV function are enabled; Build the test server and auxiliary server data link according to the type of network card to be tested; The function configuration module is specifically used for: Install the Linux operating system, network card driver software, and management software on the test server and auxiliary server respectively; Install the virtual machine on the test server using the yum tool; Install the same network card driver software as the test server on the virtual machine. After the installation is complete, shut down the virtual machine. The function startup module is specifically used for: Enable the SR-IOV function of the test server by adding the commands intel_iommu=on and iommu=pt in the kernel boot parameters; The virtual network card configuration module is specifically used for: Create a virtual network card in the operating system of the test server and write the configuration file of the virtual network card; Use preset commands and configuration files to detach the virtual network card from the test server and mount it to the virtual machine; Start the virtual machine and obtain the network port information of the virtual network card; The network port connection module is specifically used for: Use the network card binding script to bind the network port of the virtual network card in the virtual machine and configure the IP address. Bind the physical network card on the auxiliary server and configure the binding port IP address so that the binding port of the virtual machine is connected to the binding port of the auxiliary server. The test module is specifically used for: Send a PING packet to the virtual machine in the test server through the auxiliary server; The binding redundancy function of the virtual network port is verified by turning on and off the data link and turning on and off the virtual network port and physical network port of the test server.

3. A virtual network card binding redundancy function testing device, characterized in that: include: A memory, used for storing a virtual network card binding redundancy function test program; The processor is used to implement the steps of the virtual network card binding redundancy function testing method as claimed in claim 1 when executing the virtual network card binding redundancy function testing program.

4. A readable storage medium, characterized in that: The readable storage medium stores a virtual network card binding redundant function test program, and when the virtual network card binding redundant function test program is executed by the processor, the steps of the virtual network card binding redundant function test method according to claim 1 are implemented.