A method and device for high availability of virtual machines based on MCE panic in cloud computing scenarios

By modifying the kernel function mce_panic, it sends an identifiable signal to the container management process and notifies the cloud center to migrate the virtual machine. This solves the problem of virtual machine downtime caused by undetectable and unrecoverable errors in cloud computing, and improves the high availability and high availability of virtual machines. System resilience.

CN117539591BActive Publication Date: 2024-09-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311538521.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2024-09-27
Estimated Expiration
2043-11-17

AI Technical Summary

Technical Problem

In cloud computing scenarios, undetectable and unrecoverable hardware failures cannot be effectively handled, causing the system to fail to recover quickly, causing virtual machine downtime and affecting high availability.

Method used

When an undetectable and unrecoverable error occurs, the kernel function mce_panic is modified so that it does not directly cause panic, but sends an identifiable signal to the container management process, thereby notifying the cloud center to migrate the virtual machine to ensure that the virtual machine on the host machine The machine quickly migrates to a healthy state.

Benefits of technology

By not directly panicking when unrecoverable errors occur, the cloud platform can quickly sense and migrate virtual machines, reduce stuck time caused by hardware errors, improve the high availability of virtual machines, and meet the high availability requirements of enterprises for cloud services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117539591B
    Figure CN117539591B
Patent Text Reader

Abstract

The present application provides a method and device for high availability of virtual machines based on MCE panic in a cloud computing scenario. When an undetectable and unrecoverable error occurs on a host machine, panic processing is not performed immediately. A SIGBUG signal with identifiable attributes is first sent to the ctyun_agent process. The ctyun_agent notifies the cloud center to migrate all virtual machines of the host machine to machines in a healthy state, thereby achieving high availability of virtual machines and meeting the requirements of enterprise customers for the 59 standard of cloud services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to, but are not limited to, the technical fields of cloud computing and operating systems, and in particular, to a method and device for high availability of an MCE panic virtual machine in a cloud computing scenario. Background Art

[0002] The high availability of virtual machines in cloud computing scenarios is highly dependent on key indicators such as the reliability and uptime of the data center host or cloud base infrastructure. It is an inevitable trend for enterprises to migrate their businesses to the cloud, so reducing the downtime of cloud services and improving the high availability of virtual machines in cloud computing scenarios is a very important and critical issue. In the existing technology, Intel XEON series servers in data centers all support the RAS (Reliability Availability and Serviceability) feature, which can detect hardware failures, such as memory failures. Figure 3 As shown, Intel classifies fault errors into detectable and undetectable errors. Detectable errors are further divided into correctable (CE) and uncorrectable errors (UCE). Uncorrectable errors can be further divided into recoverable and unrecoverable errors. Undetectable, uncorrectable, and unrecoverable errors are processed by panic by default.

[0003] The Linux kernel processes mce, such as Figure 4 , the cpu notifies the linux kernel through the mce exception, and the linux kernel analyzes the global status msr register to determine the type of error. The linux kernel will take different types of predefined repair methods for the read MCE error code. For UCNA and CE errors, they are just logged. For SRAR and SRAO errors, the kernel will isolate the error page through the memory_failure function and kill the application affected by the error of the page. Other UC errors are usually handled by directly calling panic.

[0004] However, according to our tests and practical experience, when an undetectable and unrecoverable error occurs and the system cannot handle it, if panic is not called to perform a downtime operation, it can still run for several minutes or even hours. This has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of the above problems existing in the prior art, the present invention proposes a method and device for high availability of virtual machines based on MCEpanic in a cloud computing scenario. In the cloud computing scenario, when an undetectable and unrecoverable error occurs, the virtual machine on the faulty host machine can be migrated as much as possible, so that the cloud center can quickly perceive the fault of the host machine and start the backup virtual machine on another host, so as to improve the high availability of the virtual machine and save the loss caused by the fault. The technical solution adopted by this application is as follows:

[0006] A high availability method for a virtual machine based on MCE panic in a cloud computing scenario, the method comprising:

[0007] Step 1: Transform kernel functions and container management processes;

[0008] Step 2: Detect errors occurring on the host machine. When an undetectable and unrecoverable error occurs, the modified kernel function sends a first indication signal with identifiable attributes to the container management process;

[0009] Step 3: The container management process identifies the first indication signal and sends a second indication signal to the cloud station according to the identification result;

[0010] Step 4: The cloud center starts the virtual machine migration instruction according to the second indication signal to migrate the virtual machine on the host machine where the undetectable and unrecoverable error occurs.

[0011] Furthermore, before step 1, the method further includes: confirming that the platform kernel supports the RAS function, and configuring and enabling the memory RAS function in the BIOS.

[0012] Further, in step 1, the kernel function is modified, including: modifying the kernel function mce_panic so that when an undetectable and unrecoverable error occurs, the kernel function mce_panic does not perform a kernel panic, but sends a first indication signal with an identifiable attribute to the container management process; wherein the first indication signal is a SIGBUS signal, and the container management process is the ctyun_agent process;

[0013] Add the function of capturing SIGBUS signal in the container management process ctyun_agent.

[0014] Furthermore, the modification of the kernel function mce_panic includes:

[0015] Step 101, sort out the processing process of the MCE exception, determine whether there is an MCE error that is a serious problem error that the system state cannot handle, if so, mark the MCE as no_way_out, scan all banks and call mce_panic to cause the system kernel panic;

[0016] Step 102: re-encode the mce_panic function to send a first indication signal to the container management process;

[0017] Step 103, making the patch of the modified kernel function mce_panic into kpatch;

[0018] Step 104: Install kpatch to hot-upgrade the new function of the mce_panic function.

[0019] Further, in step 101, mce_panic reads the content of the MSR_IA32_MCG_STATUS status register on each bank on the CPU through mce_rdmsrl in the do_machine_check function;

[0020] In step 102, the corresponding task is found through the pid of the container management process ctyun_agent, and a signal with a SEND_SIG_FOR_AGENT identifier is sent to the ctyun_agent process.

[0021] Further, in step 3, the container management process identifies the first indication signal, including: when the container management process ctyun_agent receives the SIGBUS signal, determining whether the SIGBUS signal is a signal sent from the modified kernel function mce_panic by identifying the attribute si_code;

[0022] In step 3, if si_code is equal to SEND_SIG_FOR_AGENT, it means that the SIGBUS signal is sent by the modified kernel function mce_panic, and a second indication signal is sent to the cloud center. The second indication signal is used to notify the local machine that a kernel panic error has occurred and notify the cloud center to migrate the virtual machine on the local machine; if si_code is not equal to SEND_SIG_FOR_AGENT, it means that a normal SIGBUS signal is received, and the current application is exited according to the default policy.

[0023] Furthermore, in step 4, the cloud center server uses multiplexing technology to detect all host machines in the cluster. When receiving the message of the host machine kernel panic error, it will start the virtual machine migration instruction to migrate the virtual machine on the host machine where the kernel panic error occurs.

[0024] Furthermore, after step 4, the method further includes:

[0025] Step 5: After the virtual machine on the host machine completes the migration, restart the current host machine.

[0026] Further, in step 5, it includes: calling check_vm_migaration_finished and migration_time_expired for cyclic detection, if it is detected that the migration is completed or the migration time has timed out, calling ctyun_agent_reboot_machine to restart the current host machine;

[0027] Restart the current host machine, including calling shell commands through the system function to trigger saving the host machine's memory status when the kernel panic error occurs. Fault location and cause analysis have been performed.

[0028] A high-availability device based on an MCE panic virtual machine in a cloud computing scenario includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0029] Through the embodiments of the present application, the following technical effects can be obtained: compared with the processing methods in the prior art, when an unrecoverable or unknown type of mce error occurs, the present application does not directly panic the kernel so that the cloud platform can quickly perceive the unavailable host machines in the cluster; the cloud platform can quickly migrate or recover the virtual machines on the host machine where the unrecoverable error occurs, ensuring the high availability of the virtual machines; the machine is restarted through ctyun_agent, thereby reducing the time that the host machine is in a stuck state when a hardware error mce occurs.

[0030] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0032] Figure 1 This is a schematic diagram of the overall virtual machine high availability operation process;

[0033] Figure 2 This is a schematic diagram of the operation of configuring the enable in the BIOS;

[0034] Figure 3 A schematic diagram for configuring parameters for correcting errors;

[0035] Figure 4 This is a schematic diagram of the processing process of MCE exception;

[0036] Figure 5 A schematic diagram of sending a signal with an identifier to the ctyun_agent process;

[0037] Figure 6 This is the operation diagram of the capture function for initializing SIGBUS;

[0038] Figure 7 Schematic diagram of the operation of identifying attribute judgment;

[0039] Figure 8 This is a schematic diagram of the operation of migrating a virtual machine. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] It should be understood that in the description of the embodiments of the present application, the meaning of multiple (or multiple) is more than two, greater than, less than, and exceeding are understood to exclude the number itself, and above, below, and within are understood to include the number itself. If there is a description of "first", "second", etc., it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0042] In view of the existing problems, the present application embodiment provides a high availability method based on MCE panic virtual machine in a cloud computing scenario, such as Figure 1 As shown, the method comprises the following steps:

[0043] Step 1: Transform kernel functions and container management processes;

[0044] Step 2: Detect errors occurring on the host machine. When an undetectable and unrecoverable error occurs, the modified kernel function sends a first indication signal with identifiable attributes to the container management process;

[0045] Step 3: The container management process identifies the first indication signal and sends a second indication signal to the cloud station according to the identification result;

[0046] Step 4: The cloud center starts the virtual machine migration instruction according to the second indication signal to migrate the virtual machine on the host machine where the undetectable and unrecoverable error occurs.

[0047] Before step 1, the method further includes: confirming that the platform kernel supports the RAS function, and configuring the memory RAS function to be enabled in the BIOS.

[0048] In actual configuration, Figure 2 Check that the CPU has the Poison function enabled, set the ActiveScrub Interval to 0 for automatic inspection, and enable Passive Scrub passive inspection. Configure the correctable error parameters, enable the correctable error detection cycle, and set the correctable error threshold to 6000, as shown in the following example: Figure 3 shown.

[0049] Since the online machines are already carrying important tasks for customers, conventional kernel upgrades require restarting the machine, which will affect the effectiveness of existing services. Therefore, the only option is to create kernel patches to support new kernel features.

[0050] In step 1, the kernel function is modified, including: modifying the kernel function mce_panic so that when an undetectable and unrecoverable error occurs, the kernel function mce_panic does not perform a kernel panic, but sends a first indication signal with an identifiable attribute to the container management process; wherein the first indication signal is a SIGBUS signal, and the container management process is the ctyun_agent process.

[0051] The modification of the kernel function mce_panic includes:

[0052] Step 101, sort out the processing process of the MCE exception, determine whether there is an MCE error that is a serious problem error that the system state cannot handle, if so, mark the MCE as no_way_out, scan all banks and call mce_panic to cause the system kernel panic;

[0053] Step 102: re-encode the mce_panic function to send a first indication signal to the container management process;

[0054] Step 103, making the patch of the modified kernel function mce_panic into kpatch;

[0055] Step 104: Install kpatch to hot-upgrade the new function of the mce_panic function.

[0056] In step 101, if Figure 4 As shown, mce_panic mainly reads the contents of the MSR_IA32_MCG_STATUS status register on each bank on the CPU through mce_rdmsrl in the do_machine_check function.

[0057] In step 102, the corresponding task is found through the pid of the container management process ctyun_agent, and a signal with the SEND_SIG_FOR_AGENT identifier is sent to the ctyun_agent process; Figure 5 As shown, a new function of sending a signal to notify ctyun_agent is realized through the mce_panic function.

[0058] Step 103 specifically includes:

[0059] Step 1031, making a difference patch between the file where the modified kernel function mce_panic is located and the original file;

[0060] #diff-u linux.orgin / arch / x86 / kernel / cpu / mce / core.c linux / arch / x86 / kernel / cpu / mce / core.c>mce_panic.patch

[0061] Step 1032, install the debuginfo package of the corresponding version of the online kernel;

[0062] #yuminstall-y kernel-debuginfo-common-x86_64-3.10.0-957.5.1kernel-debuginfo-x86_64-3.10.0-957.5.1

[0063] Step 1033, copy vmlinux under / lib / debug / lib / module / to the same directory as patch;

[0064] #kpatch-build-t vmlinux mce_panic.patch

[0065] --skip-compiler-check-r / home / mywokr / linuxsource / linux-3.10.957.5.1.src.rpm

[0066] WARNING: Skipping gcc version matching check(not recommended)

[0067] Building patch module:livepatch-mce_panic.ko

[0068] SUCCESS

[0069] Step 1034: Generate the livepatch-mce_panic.ko file in the current directory.

[0070] Step 104 specifically includes:

[0071] Step 1041, install the kpatch toolkit;

[0072] #yuminstall kpatch

[0073] Step 1042: Start the kpatch service;

[0074] #systemctl start kpatch

[0075] Step 1043: Install the kpatch module;

[0076] #kpatch install livepatch-mce_panic.ko

[0077] Step 1044, check whether kpatch is installed successfully;

[0078] #kpatch list

[0079] Loaded patch modules:

[0080] Installed patch modules:

[0081] livepatch-mce_panic(3.10.0-957.5.1.el7.x86_64)

[0082] In step 1, the container management process is modified, including: adding SIGBUS signal capture in the container management process ctyun_agent; Figure 6 As shown, the function init_signal initializes the capture function of SIGBUS to sigbus_hander.

[0083] In step 3, the container management process identifies the first indication signal, including:

[0084] When the container management process ctyun_agent receives the SIGBUS signal, it determines whether the SIGBUS signal is sent from the modified kernel function mce_panic by identifying the attribute si_code; Figure 7 shown.

[0085] If si_code is equal to SEND_SIG_FOR_AGENT, it means that the SIGBUS signal is sent from the modified kernel function mce_panic, and a second indication signal is sent to the cloud center. The second indication signal is used to notify the local machine that a kernel panic error has occurred and notify the cloud center to migrate the virtual machine on the local machine; if si_code is not equal to SEND_SIG_FOR_AGENT, it means that a normal SIGBUS signal is received, and the current application is exited according to the default policy.

[0086] In step 4, the cloud center server uses multiplexing technology to detect all host machines in the cluster. When receiving the message of the host kernel panic error, it will start the virtual machine migration instruction to migrate the virtual machine on the host machine where the kernel panic error occurs, such as Figure 8 shown.

[0087] After step 4, the method further comprises:

[0088] Step 5: After the virtual machine on the host machine completes the migration, restart the current host machine.

[0089] In step 5, it includes: calling check_vm_migaration_finished and migration_time_expired for cyclic detection, if it is detected that the migration is completed or the migration time has timed out, calling ctyun_agent_reboot_machine to restart the current host machine.

[0090] In step 5, the current host is restarted, including:

[0091] The system function is used to call a shell command to trigger the saving of the host machine's memory status when a kernel panic error occurs. The fault has been located and the cause has been analyzed.

[0092] The trigger method can call the following shell command through the system function: echo c> / proc / sysrq-trigger.

[0093] In summary, this application implements a high-availability solution for virtual machines in cloud computing scenarios. When an undetectable and unrecoverable error occurs on the host machine, panic processing is not performed immediately. A SIGBUG signal with identifiable attributes is first sent to the ctyun_agent process. The ctyun_agent notifies the cloud center to migrate all virtual machines of the host machine to machines in a healthy state, thereby achieving high availability of virtual machines and meeting the 59 standard requirements of enterprise customers for cloud services.

[0094] The embodiment of the present application also provides a high-availability device based on the MCE panic virtual machine in a cloud computing scenario. In an exemplary embodiment, the device includes: one or more processors and a memory. Taking a processor and a memory as an example, the processor and the memory can be connected via a bus or other means. The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs, such as the data processing method in the above-mentioned embodiment of the present application. The processor implements the above-mentioned data processing method in the embodiment of the present application by running the non-transient software programs and programs stored in the memory.

[0095] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data required for executing the network data processing method in the above-mentioned embodiment of the present application, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may include a memory remotely arranged relative to the processor, and these remote memories may be connected to the data processing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0096] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer executable program. The computer executable program is executed by one or more control processors, for example, by a processor, so that the one or more processors can execute the data processing method in the above-mentioned embodiment of the present application.

[0097] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as a computer-readable program, a data structure, a program module or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally contain computer-readable programs, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0098] The above is a specific description of several implementations of the present application, but the present application is not limited to the above-mentioned implementation modes. Technical personnel familiar with the art can also make various equivalent modifications or substitutions under the sharing conditions that do not violate the essence of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A high availability method for MCE panic virtual machines in a cloud computing scenario, characterized in that: The method includes: Step 1: Transform kernel functions and container management processes; Step 2: Detect errors occurring on the host machine. When an undetectable and unrecoverable error occurs, the modified kernel function sends a first indication signal with identifiable attributes to the container management process; Step 3: The container management process identifies the first indication signal and sends a second indication signal to the cloud station according to the identification result; Step 4: The cloud platform starts the virtual machine migration instruction according to the second indication signal to migrate the virtual machine on the host machine where the undetectable and unrecoverable error occurs; In step 1, the kernel function is modified, including: modifying the kernel function mce_panic so that when an undetectable and unrecoverable error occurs, the kernel function mce_panic does not perform a kernel panic, but sends a first indication signal with an identifiable attribute to the container management process; wherein the first indication signal is a SIGBUS signal, and the container management process is the ctyun_agent process; Added SIGBUS signal capture function in the container management process ctyun_agent; The modification of the kernel function mce_panic includes: Step 101, sort out the processing process of the MCE exception, determine whether there is an MCE error that is a serious problem error that the system state cannot handle, if so, mark the MCE as no_way_out, scan all banks and call mce_panic to cause the system kernel panic; Step 102: re-encode the mce_panic function to send a first indication signal to the container management process; Step 103, making the patch of the modified kernel function mce_panic into kpatch; Step 104, install kpatch to hot-upgrade the new function of mce_panic function; In step 101, mce_panic reads the contents of the MSR_IA32_MCG_STATUS status register on each bank on the CPU through mce_rdmsrl in the do_machine_check function; In step 102, the corresponding task is found through the pid of the container management process ctyun_agent, and a signal with a SEND_SIG_FOR_AGENT identifier is sent to the ctyun_agent process.

2. The method according to claim 1, characterized in that Before step 1, the method further includes: confirming that the platform kernel supports the RAS function, and configuring the memory RAS function to be enabled in the BIOS.

3. The method according to claim 1, characterized in that In step 3, the container management process identifies the first indication signal, including: when the container management process ctyun_agent receives the SIGBUS signal, determining whether the SIGBUS signal is a signal sent from the modified kernel function mce_panic by identifying the attribute si_code; In step 3, if si_code is equal to SEND_SIG_FOR_AGENT, it means that the SIGBUS signal is sent by the modified kernel function mce_panic, and a second indication signal is sent to the cloud center. The second indication signal is used to notify the local machine that a kernel panic error has occurred and notify the cloud center to migrate the virtual machine on the local machine; if si_code is not equal to SEND_SIG_FOR_AGENT, it means that a normal SIGBUS signal is received, and the current application is exited according to the default policy.

4. The method according to claim 1, characterized in that In step 4, the cloud center server uses multiplexing technology to detect all host machines in the cluster. When receiving the message of the host machine kernel panic error, it will start the virtual machine migration instruction to migrate the virtual machine on the host machine where the kernel panic error occurs.

5. The method according to claim 1, characterized in that After step 4, the method further comprises: Step 5: After the virtual machine on the host machine completes the migration, restart the current host machine.

6. The method according to claim 5, characterized in that In step 5, it includes: calling check_vm_migaration_finished and migration_time_expired for cyclic detection, if it is detected that the migration is completed or the migration time has timed out, calling ctyun_agent_reboot_machine to restart the current host machine; Restart the current host machine, including calling the shell command through the system function to trigger the saving of the host machine's memory state when the kernel panic error occurs. The fault has been located and the cause has been analyzed.

7. A high availability device based on MCE panic virtual machine in a cloud computing scenario, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Downtime processing method and device

    CN110399253A

  • Virtual machine recoverable from uncorrectable memory errors

    CN115461720A

  • Abnormality repair method and device and storage medium

    CN115495278A

  • Container processing method and device for cloud computing environment, electronic equipment and readable medium

    CN116225755A

  • On-die mechanism for high-reliability processor

    CN1729456A