Virtual machine service continuity monitoring method suitable for hyper-converged platform
Through batch scanning of automated scripts and KVM technology, timestamp logs are generated, which solves the problems of low efficiency and high error rate of manual inspection in the existing hyper-converged virtual machine business continuity testing methods, and realizes efficient virtual machine business monitoring and Problem location.
Patent Information
- Application Number
- CN202410817119.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-22
AI Technical Summary
The existing hyper-converged virtual machine business continuity testing method relies on manual inspection one by one, resulting in high labor costs, low efficiency, high error rate and delayed problem discovery.
Automated scripts are used through the VM management tool virsh of KVM technology to regularly check the business status of virtual machines on the hyper-converged platform, generate timestamp logs to quickly locate problems, and implement batch scanning and problem discovery.
It saves a lot of testing manpower, reduces testing costs, improves testing efficiency, reduces human impact, and detects and locates problems in a timely manner.
Smart Images

Figure CN118820007A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of virtual machine business continuity monitoring methods, and in particular relates to a virtual machine business continuity monitoring method applicable to a hyper-converged platform. Background Art
[0002] As we all know, hyper-converged products need to use virtualization technology to provide customers with virtual machines for upper-level PAAS services. Taking into account the different business types of customers, when testing hyper-converged products, a large number of virtual machines (at least 50 or more) are usually created to run different types of IO read and write services to simulate and test various business types. Therefore, monitoring the business continuity of these virtual machines has become a top priority in hyper-converged product testing.
[0003] In the existing hyper-converged virtual machine business continuity testing solutions, most of them rely on manual inspection of virtual machines one by one. This testing method has obvious disadvantages. On the one hand, due to the large number of virtual machines, checking them one by one will consume a lot of manpower, which increases labor costs and reduces testing efficiency. On the other hand, manual inspection is greatly affected by the personal factors of the testers, there is no unified standard, the error rate is high, and problems are not discovered in a timely manner. Summary of the invention
[0004] In order to overcome the above defects of the existing hyper-converged virtual machine business continuity testing method, the present invention proposes a new virtual machine business continuity automatic monitoring method suitable for a hyper-converged platform. In this method, the business status of all virtual machines is checked regularly through a script, and the virtual machines with business interruptions are counted and summarized into the corresponding timestamp logs. In this way, we only need to check the virtual machines with business problems according to the logs, and through the timestamp, the operator can quickly locate the time when the business problem occurs, which is more conducive to timely and efficient problem troubleshooting.
[0005] This method uses the VM management tool virsh that comes with KVM technology to perform batch scanning of virtual machine services through automated scripts, saving a lot of testing manpower and being more conducive to the discovery and location of problems (bugs).
[0006] Specifically, the present invention provides a virtual machine business continuity monitoring method applicable to a hyper-converged platform, such as Figure 6 As shown, the method includes:
[0007] S1. Create a timestamp log file;
[0008] S2. Use the k8s command to list all virtual machine names on the hyper-converged platform;
[0009] S3. For each virtual machine, use the virsh command of the KVM management tool to analyze the disk IO status of the virtual machine, obtain the current number of disk IO requests, wait for 10 seconds, and then use the virsh command again to obtain the number of disk IO requests of the virtual machine;
[0010] S4. For each virtual machine, the automated script compares the number of disk IO requests of the virtual machine obtained twice before and after. If the number of disk IO requests changes, it returns to step S3; if the number of disk IO requests does not change, the name of the virtual machine is output to the timestamp log file;
[0011] S5. The automated script performs steps S3-S4 on each virtual machine in turn until all virtual machines have been checked.
[0012] Furthermore, the virtual machine service continuity monitoring method applicable to the hyper-converged platform of the present invention also includes: creating a virtual machine on the hyper-converged platform in advance, and pre-embedding different types of services in the created virtual machine.
[0013] Furthermore, in the above-mentioned virtual machine service continuity monitoring method, pre-embedding different types of services in the created virtual machine includes pre-embedding IO-intensive services and computing-intensive services in the created virtual machine.
[0014] Furthermore, the present invention is applicable to the virtual machine business continuity monitoring method of the hyper-converged platform, and step S2 also includes: obtaining the pod corresponding to each virtual machine through the kubectl get pod-A|grep vm_name|awk'{print$2}' command.
[0015] On the other hand, the present invention also provides a virtual machine business continuity monitoring device applicable to a hyper-converged platform, and when the device is running, the steps of the above-mentioned virtual machine business continuity monitoring method applicable to a hyper-converged platform are implemented.
[0016] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned virtual machine business continuity monitoring method applicable to a hyper-converged platform are implemented.
[0017] In summary, the virtual machine service continuity monitoring method applicable to a hyper-converged platform of the present invention has the following advantages:
[0018] (1) The method of the present invention utilizes the VM management tool virsh provided by KVM technology, and can perform batch scanning of the services of all virtual machines on the hyper-converged platform at regular intervals through automated scripts. It has a high degree of automation, saves a lot of testing manpower, and reduces testing costs.
[0019] (2) The method of the present invention has a strong testing pertinence. It is not necessary to check each virtual machine. It is only necessary to check the virtual machine with service problems according to the log, thereby improving the testing efficiency.
[0020] (3) The method of the present invention is less affected by human factors and problems are discovered in a timely manner. Operators can analyze logs to locate problems in a timely manner and can also quickly find the time point of the problem through log timestamps. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the following drawings are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 Schematic diagram of the test process of the method of the present invention.
[0023] Figure 2 This is an example diagram of the operation of creating a timestamp log file in the method of the present invention.
[0024] Figure 3 This is an example diagram of the operation of listing all virtual machines vm through the k8s command in the method of the present invention.
[0025] Figure 4 This is an example diagram of the operation of checking the number of disk IO requests of a virtual machine through the virsh command in the method of the present invention.
[0026] Figure 5 This is an operation example diagram of the script in the method of the present invention comparing the number of disk IO requests twice before and after 10 seconds, and outputting the virtual machine name (vm_name) with the same number of disk IO requests to the timestamp log file.
[0027] Figure 6 The figure is a flow chart of the overall implementation of the method of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. The present invention can also be implemented or applied through other different specific implementation methods. The details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0029] At the same time, it should be understood that the protection scope of the present invention is not limited to the specific embodiments described below; it should also be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the protection scope of the present invention.
[0030] Embodiment: A virtual machine business continuity monitoring method applicable to a hyper-converged platform
[0031] like Figure 1 As shown, the method comprises the following steps:
[0032] 1) Create a virtual machine on the hyper-converged platform and embed different types of services such as IO-intensive (such as some database services) and computing-intensive (such as some signal processing services) in the virtual machine.
[0033] 2) Create a timestamp log file. The creation process is as follows: Figure 2 shown.
[0034] 3) If Figure 3 As shown in the figure, the k8s command (kubectl get vm-A) is used to list the names of all virtual machines vm_name on the hyper-converged platform, and then the command (kubectl get pod-A|grep vm_name|awk'{print$2}') is used to get the pod corresponding to each virtual machine.
[0035] 4) If Figure 4 As shown in the figure, for each virtual machine, the disk IO status is analyzed through the virsh command of the KVM management tool, and the number of disk IO requests of the virtual machine at time T1 is checked and recorded (kubectl exec-it pod--virsh domblkstat 1).
[0036] 5) After waiting for 10 seconds, use the virsh command again to check the number of disk IO requests (R / W requests) of the virtual machine.
[0037] 6) If Figure 5 As shown in the figure, for each virtual machine, the script compares the number of disk IO requests of the virtual machine twice before and after 10 seconds. If the number of IO requests changes, it means that the VM's disk has a read or write request, which means that the virtual machine has no business interruption. On the contrary, if the number of IO requests does not change, it means that the virtual machine has a business interruption, and the vm_name needs to be printed out to the timestamp log file.
[0038] 7) The automated script performs steps 4)-6) on each VM in turn until all VMs are checked. In this way, we can directly know whether any VM has a business interruption problem by checking the timestamp log.
[0039] The automation code snippet is as follows:
[0040]
[0041]
[0042]
[0043] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the profession can make some changes or modifications to the technical contents disclosed above without departing from the scope of the technical solution of the present invention to obtain equivalent embodiments of equivalent changes. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A virtual machine business continuity monitoring method applicable to a hyper-converged platform, characterized in that: The method comprises: S1. Create a timestamp log file; S2. Use the k8s command to list all virtual machine names on the hyper-converged platform; S3. For each virtual machine, use the virsh command of the KVM management tool to analyze the disk IO status of the virtual machine, obtain the current number of disk IO requests, wait for 10 seconds, and then use the virsh command again to obtain the number of disk IO requests of the virtual machine; S4. For each virtual machine, the automated script compares the number of disk IO requests of the virtual machine obtained twice before and after. If the number of disk IO requests changes, it returns to step S3; if the number of disk IO requests does not change, the name of the virtual machine is output to the timestamp log file; S5. The automated script performs steps S3-S4 on each virtual machine in turn until all virtual machines have been checked.
2. The method for monitoring virtual machine business continuity applicable to a hyper-converged platform according to claim 1, characterized in that: The virtual machine service continuity monitoring method also includes: creating a virtual machine on the hyper-converged platform in advance, and pre-embedding different types of services in the created virtual machine.
3. The method for monitoring virtual machine business continuity applicable to a hyper-converged platform according to claim 2, characterized in that: The pre-embedding of different types of services in the created virtual machine includes pre-embedding IO-intensive services and computing-intensive services in the created virtual machine.
4. The method for monitoring virtual machine business continuity applicable to a hyper-converged platform according to claim 1, characterized in that: Step S2 also includes: obtaining the pod corresponding to each virtual machine through the kubectl get pod-A|grep vm_name|awk'{print$2}' command.
5. A virtual machine business continuity monitoring device suitable for a hyper-converged platform, characterized in that: When the device is running, the steps of the virtual machine business continuity monitoring method applicable to a hyper-converged platform described in any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method for monitoring virtual machine business continuity applicable to a hyper-converged platform as described in any one of claims 1 to 4.
