CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No. 201811497981.X, filed with the China National Intellectual Property Administration (CNIPA) on Dec. 7, 2018, the contents of which are incorporated herein by reference in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computer technology, and specifically to a method and apparatus for processing information.

BACKGROUND

With the development of computer technology, services provided using the computer technology and the Internet technology are becoming more and more abundant. A logical computer (i.e., a virtual machine) may be virtualized on a physical machine (an electronic device) using the virtualization technology, for providing a service to external. There are many factors affecting the stability of the virtual machine. Here, the crash of the host machine where the virtual machine is located is undoubtedly the most uncontrollable and most harmful factor. The crash of the host machine will cause the virtual machine running on the host machine to be down, which affects the virtual machine providing a service, and even may cause serious accidents such as damaging a storage medium of the virtual machine or a data loss.

SUMMARY

Embodiments of the present disclosure propose a method and apparatus for processing information.

In a first aspect, some embodiments of the present disclosure provide a method for processing information. The method includes: acquiring virtual machine device status information and physical address information from a target memory in response to determining a crash of a production kernel, the target memory being a memory pre-allocated to a running virtual machine by the production kernel, and the virtual machine device status information of the virtual machine and the physical address information corresponding to a virtual address of the memory of the virtual machine being stored into the target memory by the production kernel; acquiring data as target data based on the physical address information; and storing a file into a shared storage area according to the target data and the virtual machine device status information.

In some embodiments, the method further includes: sending a virtual machine recovery request to a backup electronic device, the virtual machine recovery request including a file identifier of the file, for the backup electronic device to acquire the file from the shared storage area according to the file identifier and recover the virtual machine according to the file.

In some embodiments, the storing a file into a shared storage area according to the target data and the virtual machine device status information includes: generating a snapshot file according to the target data and the virtual machine device status information; and storing the snapshot file into the shared storage area.

In some embodiments, the physical address information is generated by the production kernel by: sending a stopping running instruction to the virtual machine, the stopping running instruction being used to control the virtual machine to stop running; and generating the physical address information according to a pre-stored page table and the virtual address of the memory of the virtual machine, the page table being used to describe a corresponding relationship between the virtual address and a physical address.

In some embodiments, the acquiring virtual machine device status information and physical address information from a target memory includes: acquiring the virtual machine device status information and the physical address information from the target memory through a virtual file system.

In a second aspect, some embodiments of the present disclosure provide an apparatus for processing information. The apparatus includes: a first acquiring unit, configured to acquire virtual machine device status information and physical address information from a target memory in response to determining a crash of a production kernel, the target memory being a memory pre-allocated to a running virtual machine by the production kernel, and the virtual machine device status information of the virtual machine and the physical address information corresponding to a virtual address of the memory of the virtual machine being stored into the target memory by the production kernel; a second acquiring unit, configured to acquire data as target data based on the physical address information; and a storing unit, configured to store a file into a shared storage area according to the target data and the virtual machine device status information.

In some embodiments, the apparatus further includes: a sending unit, configured to send a virtual machine recovery request to a backup electronic device, the virtual machine recovery request including a file identifier of the file, for the backup electronic device to acquire the file from the shared storage area according to the file identifier and recover the virtual machine according to the file.

In some embodiments, the storing unit is further configured to: generate a snapshot file according to the target data and the virtual machine device status information; and store the snapshot file into the shared storage area.

In some embodiments, the physical address information is generated by the production kernel by: sending a stopping running instruction to the virtual machine, the stopping running instruction being used to control the virtual machine to stop running; and generating the physical address information according to a pre-stored page table and the virtual address of the memory of the virtual machine, the page table being used to describe a corresponding relationship between the virtual address and a physical address.

In some embodiments, the first acquiring unit is further configured to: acquire the virtual machine device status information and the physical address information from the target memory through a virtual file system.

In a third aspect, some embodiments of the present disclosure provide a server. The server includes: one or more processors; and a storage device, configured to store one or more programs. The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method described in any implementation in the first aspect.

In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium storing a computer program. The computer program, when executed by a processor, implements the method described in any implementation in the first aspect.

According to the method and apparatus for processing information provided by some embodiments of the present disclosure, the virtual machine device status information and the physical address information are acquired from the target memory in response to determining the crash of the production kernel. Then, the data is acquired as the target data according to the physical address information. Finally, the file is stored into the shared storage area according to the target data and the virtual machine device status information. Thus, it is implemented that the related file of the virtual machine run by the production kernel is saved into the shared storage area at the time of the crash of the production kernel, which avoids the data loss of the virtual machine caused by the crash of the production kernel.

