CN111090491B - Virtual machine task state recovery method and device and electronic equipment - Google Patents

Virtual machine task state recovery method and device and electronic equipment Download PDF

Info

Publication number
CN111090491B
CN111090491B CN201910595536.5A CN201910595536A CN111090491B CN 111090491 B CN111090491 B CN 111090491B CN 201910595536 A CN201910595536 A CN 201910595536A CN 111090491 B CN111090491 B CN 111090491B
Authority
CN
China
Prior art keywords
virtual machine
target virtual
task state
target
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910595536.5A
Other languages
Chinese (zh)
Other versions
CN111090491A (en
Inventor
冯以浩
郭彦娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201910595536.5A priority Critical patent/CN111090491B/en
Publication of CN111090491A publication Critical patent/CN111090491A/en
Application granted granted Critical
Publication of CN111090491B publication Critical patent/CN111090491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a method and a device for recovering a task state of a virtual machine and electronic equipment, wherein when the task state of a target virtual machine is abnormal, whether the task state of the target virtual machine is abnormal due to migration is judged; when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine; determining a host machine where a target virtual machine marked in the management information is located; when the host machine where the target virtual machine marked in the management information is located is a target end host machine, and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information as a source end host machine, cleaning the bottom environment of the target end host machine, and modifying the task state of the target virtual machine. The task state of the virtual machine is automatically restored when the task state of the virtual machine is abnormal, and the workload of management staff is reduced.

Description

Virtual machine task state recovery method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for recovering a task state of a virtual machine, and an electronic device.
Background
With the continuous development of computer technology, online service technology is becoming popular, and a cloud platform can provide diversified online services for users. The cloud platform generates a plurality of virtual machines through a virtualization technology, so that online services are provided for users through the virtual machines. The running environment of each virtual machine can be isolated by software to increase the security of user data.
When the cloud platform performs state operation on the virtual machine, the virtual machine is given a task state, such as "in migration", "in snapshot", and the like. When the virtual machine is in a certain task state, the cloud platform defaults to not perform other state operations on the virtual machine. In the related art, when an abnormality occurs in the task state of a virtual machine, a manager needs to manually restore the state of the virtual machine. However, the state of the virtual machine is restored manually, so that the workload of the manager is increased.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for recovering a task state of a virtual machine and electronic equipment, so that abnormal task state of the virtual machine is generated, and the state of the virtual machine is automatically recovered, thereby reducing the workload of management staff. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for recovering a task state of a virtual machine, where the method includes:
when the task state of the target virtual machine is abnormal, judging whether the task state of the target virtual machine is abnormal due to migration;
when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine;
determining a host machine where the target virtual machine marked in the management information is located;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine, and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information into the source end host machine, cleaning the bottom environment of the target end host machine, and modifying the task state of the target virtual machine;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine, and the target virtual machine is detected in the target end host machine, the bottom layer environment of the source end host machine is cleaned, and the task state of the target virtual machine is modified.
Optionally, after the determining whether the task state of the target virtual machine is abnormal due to migration, the method further includes:
judging whether the target virtual machine is detected in a target host machine or not when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located;
if the target virtual machine is detected in the target host machine, modifying the task state of the target virtual machine;
if the target virtual machine is not detected in the target host machine, reestablishing the target virtual machine and modifying the task state of the target virtual machine.
Optionally, after determining the host machine where the target virtual machine marked in the management information is located, the method further includes:
and when the host machine where the target virtual machine marked in the management information is located is the source end host machine, modifying the task state of the target virtual machine.
Optionally, when the task state of the target virtual machine is abnormal, determining whether the task state of the target virtual machine is abnormal due to migration includes:
judging whether the mirror image of the target virtual machine exists or not when the task state of the target virtual machine is abnormal;
and when the mirror image of the target virtual machine exists, judging whether the task state of the target virtual machine is abnormal due to migration.
Optionally, the method further comprises:
and monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
In a second aspect, an embodiment of the present application provides a device for recovering a task state of a virtual machine, where the device includes:
the abnormality judging module is used for judging whether the task state of the target virtual machine is abnormal due to migration or not when the task state of the target virtual machine is abnormal;
the host determining module is used for determining a source host and a destination host of the target virtual machine when the task state of the target virtual machine is abnormal due to migration;
the record inquiry module is used for determining a host machine where the target virtual machine marked in the management information is located;
the first state modifying module is used for modifying the host machine where the target virtual machine is located in the management information into the source end host when the host machine where the target virtual machine is located marked in the management information is the target end host and the target virtual machine is not detected in the target end host, cleaning the bottom environment of the target end host and modifying the task state of the target virtual machine;
and the second state modification module is used for cleaning the bottom environment of the source end host and modifying the task state of the target virtual machine when the host machine where the target virtual machine marked in the management information is located is the target end host and the target virtual machine is detected in the target end host.
Optionally, the apparatus further includes:
the virtual machine detection module is used for judging whether the target virtual machine is detected in a target host machine or not when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located;
a third state modifying module, configured to modify a task state of the target virtual machine if the target virtual machine is detected in the target host;
and the fourth state modification module is used for reestablishing the target virtual machine and modifying the task state of the target virtual machine if the target virtual machine is not detected in the target host machine.
Optionally, the apparatus further includes:
and a fifth state modifying module, configured to modify a task state of the target virtual machine when the host where the target virtual machine marked in the management information is located is the source host.
Optionally, the abnormality determination module is specifically configured to:
judging whether the mirror image of the target virtual machine exists or not when the task state of the target virtual machine is abnormal;
and when the mirror image of the target virtual machine exists, judging whether the task state of the target virtual machine is abnormal due to migration.
Optionally, the apparatus further includes:
the abnormality monitoring module is used for monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to implement the method for recovering a task state of a virtual machine according to any one of the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the method for recovering a task state of a virtual machine according to any one of the first aspects.
According to the method and device for recovering the task state of the virtual machine and the electronic equipment, when the task state of the target virtual machine is abnormal, whether the task state of the target virtual machine is abnormal due to migration is judged; when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine; determining a host machine where a target virtual machine marked in the management information is located; when the host machine where the target virtual machine marked in the management information is located is a target end host machine, and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information as a source end host machine, cleaning the bottom environment of the target end host machine, and modifying the task state of the target virtual machine; when the host machine where the target virtual machine marked in the management information is located is a target end host machine, and the target virtual machine is detected in the target end host machine, the bottom layer environment of the source end host machine is cleaned, and the task state of the target virtual machine is modified. The task state of the virtual machine is automatically restored when the task state of the virtual machine is abnormal, and the workload of management staff is reduced. Of course, not all of the above advantages need be achieved simultaneously in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a method for recovering task states of a virtual machine according to an embodiment of the present application;
FIG. 2 is another schematic diagram of a method for recovering task states of a virtual machine according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a virtual machine task state recovery device according to an embodiment of the application
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
First, terms of art in the embodiments of the present application will be explained:
host/node: and a physical server running the virtual machine.
Virtual machine task state: the operation on the virtual machine in the cloud platform can give the virtual machine a task state, such as "in migration", "in backup", etc. When the virtual machine is in a certain task state, other operations can not be performed on the virtual machine through the cloud platform.
Thermomigration: and migrating the running virtual machine from one node to another node, wherein user service is not interrupted in migration.
Cold migration: and migrating the virtual machine from one node to another node, wherein the virtual machine is shut down in the migration process.
Source host: the node where the virtual machine was located before migration.
The destination end host computer: the virtual machine is to migrate to the node.
In order to reduce workload of management personnel and realize that abnormality occurs in a task state of a virtual machine, and automatically perform state recovery on the virtual machine, an embodiment of the present application provides a method for recovering the task state of the virtual machine, referring to fig. 1, where the method includes:
s101, judging whether the task state of the target virtual machine is abnormal due to migration when the task state of the target virtual machine is abnormal.
The method for recovering the task state of the virtual machine can be realized through a cloud platform, and particularly can be realized through a server in the cloud platform.
The target virtual machine can be any virtual machine in the cloud platform, the cloud platform can monitor the task state of each virtual machine in the cloud platform, the task state of the virtual machine is abnormal, and the task state of the virtual machine can be an error. In a possible implementation manner, before S101, the method for recovering a task state of a virtual machine according to the embodiment of the present application further includes: and monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
In the process of executing tasks by the virtual machine, if errors occur, the task state of the virtual machine is set as the error. The preset time period threshold may be set according to actual situations, for example, 10 minutes, 20 minutes, or 1 hour. And when the duration time of the virtual machine in the same task state is longer than a preset duration time threshold value, judging that the task state of the virtual machine is abnormal.
Virtual machine state tasks can be divided into two types, one type is abnormality caused by migration, wherein the migration comprises cold migration, hot migration, resizing and the like; one type is non-migration induced anomalies, such as making snapshots, etc. Because migration involves two nodes, cleaning of the environment is required at recovery time. This is because if no environmental cleaning is performed, the use of the virtual machine thereafter still becomes abnormal.
When the task state of the target virtual machine is abnormal, judging whether the task state of the target virtual machine is abnormal due to migration. The management information of the virtual machine in the database management can be obtained, so that the reason for the abnormal state of the virtual machine is determined, wherein the management information of the virtual machine can comprise information such as tasks before the abnormal state of the task of the virtual machine, migration, a source end host, a destination end host and the like. For example, it may be determined whether or not a migration task has been executed or issued for the target virtual machine, and when the migration task has been executed or issued for the target virtual machine, it may be determined that an abnormality has occurred in the task state of the target virtual machine due to the migration.
Optionally, when the task state of the target virtual machine is abnormal, determining whether the task state of the target virtual machine is abnormal due to migration includes:
and step A, judging whether the mirror image of the target virtual machine exists or not when the task state of the target virtual machine is abnormal.
When the task state of the target virtual machine is abnormal, inquiring a mirror image warehouse, judging whether the mirror image of the target virtual machine exists or not, and when the mirror image of the target virtual machine does not exist, recovering the target virtual machine cannot be realized, so that the task state recovering operation for the target virtual machine is abandoned.
And B, judging whether the task state of the target virtual machine is abnormal due to migration when the mirror image of the target virtual machine exists.
S102, when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine.
When the task state abnormality of the target virtual machine is caused by migration, the source end host and the destination end host of the target virtual machine are recorded in the management information for explaining the database management, and the source end host and the destination end host of the target virtual machine can be determined from the management information for the database management.
S103, determining the host machine where the target virtual machine marked in the management information is located.
And judging whether the host machine where the marked target virtual machine in the management information is located is a destination end host or a source end host.
S104, when the host machine where the target virtual machine marked in the management information is the target end host machine and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information into the source end host machine, cleaning the bottom environment of the target end host machine, and modifying the task state of the target virtual machine.
The method mainly comprises the steps of cleaning the network of the destination end host, and cleaning configuration information of a network port of a target virtual machine in the destination end host. Thereby reducing the instances of virtual machine network errors. The task state of the target virtual machine is modified, namely the task state of the target virtual machine is reset, namely the task state of the target virtual machine is modified to be none, so that other operations of the subsequent target virtual machine are facilitated. This is because, in general, if the task state of the target virtual machine is not "none," the user cannot perform other operations on the target virtual machine.
S105, when the host machine where the target virtual machine marked in the management information is located is the target end host machine, and the target virtual machine is detected in the target end host machine, cleaning the bottom layer environment of the source end host machine, and modifying the task state of the target virtual machine.
The method mainly comprises the steps of cleaning the network of the source end host, cleaning the configuration information of the network port of the target virtual machine in the source end host and the like. And resetting the task state of the target virtual machine.
In one possible embodiment, after determining the host machine where the target virtual machine marked in the management information is located, the method further includes:
when the host machine where the target virtual machine marked in the management information is located is the source end host machine, modifying the task state of the target virtual machine.
In the embodiment of the application, the task state of the virtual machine is automatically restored when the task state of the virtual machine is abnormal, and the workload of management staff is reduced.
In one possible embodiment, after the determining whether the task state of the target virtual machine is abnormal due to migration, the method further includes:
step one, judging whether the target virtual machine is detected in a target host machine when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located.
And step two, if the target virtual machine is detected in the target host machine, modifying the task state of the target virtual machine.
The task state of the target virtual machine is modified, namely the task state of the target virtual machine is reset, namely the task state of the target virtual machine is modified to be none, so that other operations of the subsequent target virtual machine are facilitated.
And step three, if the target virtual machine is not detected in the target host machine, reestablishing the target virtual machine, and modifying the task state of the target virtual machine.
When the target virtual machine is not detected in the target host, the target virtual machine is regenerated by using the mirror image or snapshot of the target virtual machine and the task state of the target virtual machine is modified.
Specifically, the method for recovering the task state of the virtual machine according to the embodiment of the present application may be as shown in fig. 2, and includes:
step one, judging whether the mirror image of the target virtual machine exists or not.
When the task state abnormality of the target virtual machine is detected, judging whether the mirror image of the target virtual machine exists, if the mirror image of the target virtual machine exists, executing the second step, and if the mirror image of the target virtual machine does not exist, ending the operation.
Step two, judging whether the task state of the target virtual machine is abnormal due to migration, if so, executing step three, and if not, executing step eight.
And thirdly, determining a source end host and a destination end host of the target virtual machine.
And step four, judging whether the host machine where the target virtual machine marked in the management information is located is a destination end host or a source end host, executing the step five when the target virtual machine is the destination end host, and executing the step ten when the target virtual machine is the source end host.
And step five, judging whether the target virtual machine is detected in the target host machine, and executing step six when the target virtual machine is detected, and executing step seven when the target virtual machine is not detected, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located.
Step six, cleaning the environment of the source end host.
And step ten is executed after the step six is executed.
And step seven, cleaning the environment of the destination end host.
And step ten is executed after the execution of step seven is completed.
And step eight, judging whether the target virtual machine is detected on the target host machine, if so, executing step nine, and if not, executing step ten.
And step nine, regenerating and starting the target virtual machine on the target host machine.
And step ten, modifying the task state of the virtual machine.
In the embodiment of the application, the task state of the virtual machine is automatically restored when the task state of the virtual machine is abnormal, and the workload of management staff is reduced.
The embodiment of the application also provides a device for recovering the abnormal task state of the virtual machine, which comprises the following steps:
the cloud platform monitoring module is used for monitoring task states of all the virtual machines; and when the state error of the virtual machine is found or a certain task is not completed within a preset time threshold, automatically issuing a recovery command to the state recovery module of the virtual machine.
The virtual machine state recovery module is used for formulating different recovery strategies according to the task state mark, the node where the virtual machine is originally located, the node where the virtual machine is currently located and other factors; after receiving the recovery command, determining the cause of the virtual machine state error, the occurrence scene and the task stage of the virtual machine by acquiring the information of the target virtual machine in the database management, and matching with the recovery strategy in the module, thereby realizing the state recovery of the virtual machine and simultaneously completing the cleaning of the failed task environment.
The embodiment of the application solves the problem that the task state of the virtual machine is abnormal and cannot be operated again caused by the instability of the cloud platform, and reduces the maintenance cost by automatically recovering in a monitoring mode.
The embodiment of the application also provides a device for recovering the task state of the virtual machine, referring to fig. 3, the device comprises:
an anomaly determination module 301, configured to determine, when an anomaly occurs in a task state of a target virtual machine, whether the anomaly occurs in the task state of the target virtual machine due to migration;
the host determining module 302 is configured to determine a source host and a destination host of the target virtual machine when an abnormality occurs in a task state of the target virtual machine due to migration;
a record query module 303, configured to determine a host where the target virtual machine marked in the management information is located;
a first state modifying module 304, configured to modify a host machine in which the target virtual machine is located in the management information into the source end host when the host machine in which the target virtual machine is located marked in the management information is the destination end host, and modify a task state of the target virtual machine;
and a second state modifying module 305, configured to clean a bottom environment of the source end host and modify a task state of the target virtual machine when the host where the target virtual machine marked in the management information is the destination end host and the target virtual machine is detected in the destination end host.
Optionally, the device for recovering the task state of the virtual machine according to the embodiment of the present application further includes:
the virtual machine detection module is used for judging whether the target virtual machine is detected in a target host machine or not when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located;
a third state modifying module, configured to modify a task state of the target virtual machine if the target virtual machine is detected in the target host;
and a fourth state modifying module, configured to reestablish the target virtual machine and modify a task state of the target virtual machine if the target virtual machine is not detected in the target host.
Optionally, the device for recovering the task state of the virtual machine according to the embodiment of the present application further includes:
and a fifth state modifying module, configured to modify a task state of the target virtual machine when the host where the target virtual machine marked in the management information is located is the source host.
Optionally, the abnormality determination module 301 is specifically configured to:
when the task state of the target virtual machine is abnormal, judging whether the mirror image of the target virtual machine exists or not;
and when the mirror image of the target virtual machine exists, judging whether the task state of the target virtual machine is abnormal due to migration.
Optionally, the device for recovering the task state of the virtual machine according to the embodiment of the present application further includes:
the abnormality monitoring module is used for monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
The embodiment of the application also provides electronic equipment, which comprises: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory, and implement the following steps:
when the task state of the target virtual machine is abnormal, judging whether the task state of the target virtual machine is abnormal due to migration;
when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine;
determining a host machine where the target virtual machine marked in the management information is located;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information into the source end host machine, cleaning the bottom environment of the target end host machine and modifying the task state of the target virtual machine;
when the host machine where the target virtual machine marked in the management information is located is the destination end host machine and the target virtual machine is detected in the destination end host machine, the bottom layer environment of the source end host machine is cleaned, and the task state of the target virtual machine is modified.
Optionally, referring to fig. 4, the electronic device according to the embodiment of the present application further includes a communication interface 402 and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404.
Optionally, when the processor is configured to execute the computer program stored in the memory, the method for recovering the task state of any virtual machine can also be implemented.
The communication bus mentioned for the above-mentioned electronic devices may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include RAM (Random Access Memory ) or NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the following steps when being executed by a processor:
when the task state of the target virtual machine is abnormal, judging whether the task state of the target virtual machine is abnormal due to migration;
when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine;
determining a host machine where the target virtual machine marked in the management information is located;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information into the source end host machine, cleaning the bottom environment of the target end host machine and modifying the task state of the target virtual machine;
when the host machine where the target virtual machine marked in the management information is located is the destination end host machine and the target virtual machine is detected in the destination end host machine, the bottom layer environment of the source end host machine is cleaned, and the task state of the target virtual machine is modified.
Optionally, when the computer program is executed by the processor, the method for recovering the task state of any virtual machine can also be implemented.
It should be noted that, in this document, the technical features in each alternative may be combined to form a solution, so long as they are not contradictory, and all such solutions are within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for embodiments of the apparatus, electronic device and storage medium, the description is relatively simple as it is substantially similar to the method embodiments, where relevant see the section description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A method for recovering a task state of a virtual machine, the method comprising:
when the task state of the target virtual machine is abnormal, judging whether the task state of the target virtual machine is abnormal due to migration;
when the task state of the target virtual machine is abnormal due to migration, determining a source end host and a destination end host of the target virtual machine;
determining a host machine where the target virtual machine marked in the management information is located;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine, and the target virtual machine is not detected in the target end host machine, modifying the host machine where the target virtual machine is located in the management information into the source end host machine, cleaning the bottom environment of the target end host machine, and modifying the task state of the target virtual machine;
when the host machine where the target virtual machine marked in the management information is located is the target end host machine and the target virtual machine is detected in the target end host machine, cleaning the bottom environment of the source end host machine and modifying the task state of the target virtual machine;
after the judging whether the task state of the target virtual machine is abnormal due to migration, the method further comprises the following steps:
judging whether the target virtual machine is detected in a target host machine or not when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located;
if the target virtual machine is detected in the target host machine, modifying the task state of the target virtual machine;
if the target virtual machine is not detected in the target host machine, reestablishing the target virtual machine and modifying the task state of the target virtual machine.
2. The method of claim 1, wherein after determining the host machine in which the target virtual machine marked in the management information is located, the method further comprises:
and when the host machine where the target virtual machine marked in the management information is located is the source end host machine, modifying the task state of the target virtual machine.
3. The method according to claim 1, wherein the determining whether the task state of the target virtual machine is abnormal due to migration when the task state of the target virtual machine is abnormal comprises:
judging whether the mirror image of the target virtual machine exists or not when the task state of the target virtual machine is abnormal;
and when the mirror image of the target virtual machine exists, judging whether the task state of the target virtual machine is abnormal due to migration.
4. A method according to any one of claims 1-3, wherein the method further comprises:
and monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
5. A device for recovering a task state of a virtual machine, the device comprising:
the abnormality judging module is used for judging whether the task state of the target virtual machine is abnormal due to migration or not when the task state of the target virtual machine is abnormal;
the host determining module is used for determining a source host and a destination host of the target virtual machine when the task state of the target virtual machine is abnormal due to migration;
the record inquiry module is used for determining a host machine where the target virtual machine marked in the management information is located;
the first state modifying module is used for modifying the host machine where the target virtual machine is located in the management information into the source end host when the host machine where the target virtual machine is located marked in the management information is the target end host and the target virtual machine is not detected in the target end host, cleaning the bottom environment of the target end host and modifying the task state of the target virtual machine;
the second state modifying module is used for cleaning the bottom environment of the source end host and modifying the task state of the target virtual machine when the host machine where the target virtual machine marked in the management information is located is the target end host and the target virtual machine is detected in the target end host;
the virtual machine detection module is used for judging whether the target virtual machine is detected in a target host machine or not when the task state of the target virtual machine is abnormal due to no migration, wherein the target host machine is the host machine where the target virtual machine marked in the management information is located;
a third state modifying module, configured to modify a task state of the target virtual machine if the target virtual machine is detected in the target host;
and the fourth state modification module is used for reestablishing the target virtual machine and modifying the task state of the target virtual machine if the target virtual machine is not detected in the target host machine.
6. The apparatus of claim 5, wherein the apparatus further comprises:
and a fifth state modifying module, configured to modify a task state of the target virtual machine when the host where the target virtual machine marked in the management information is located is the source host.
7. The apparatus of claim 5, wherein the anomaly determination module is specifically configured to:
judging whether the mirror image of the target virtual machine exists or not when the task state of the target virtual machine is abnormal;
and when the mirror image of the target virtual machine exists, judging whether the task state of the target virtual machine is abnormal due to migration.
8. The apparatus according to any one of claims 5-7, wherein the apparatus further comprises:
the abnormality monitoring module is used for monitoring the task state of the target virtual machine, and judging that the task state of the target virtual machine is abnormal when the task state of the target virtual machine is wrong or the duration time of the same task state is longer than a preset duration time threshold value.
9. An electronic device, comprising a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to implement the method for recovering a task state of a virtual machine according to any one of claims 1 to 4 when executing the program stored in the memory.
10. A computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the method for recovering the task state of the virtual machine according to any one of claims 1-4 is implemented.
CN201910595536.5A 2019-07-03 2019-07-03 Virtual machine task state recovery method and device and electronic equipment Active CN111090491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910595536.5A CN111090491B (en) 2019-07-03 2019-07-03 Virtual machine task state recovery method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910595536.5A CN111090491B (en) 2019-07-03 2019-07-03 Virtual machine task state recovery method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111090491A CN111090491A (en) 2020-05-01
CN111090491B true CN111090491B (en) 2023-10-10

Family

ID=70393360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910595536.5A Active CN111090491B (en) 2019-07-03 2019-07-03 Virtual machine task state recovery method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111090491B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296889B (en) * 2021-05-06 2023-03-14 曙光信息产业股份有限公司 Task management method, device, system, computer equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729280A (en) * 2013-12-23 2014-04-16 国云科技股份有限公司 High availability mechanism for virtual machine
US9317314B2 (en) * 2010-06-29 2016-04-19 Microsoft Techology Licensing, Llc Techniques for migrating a virtual machine using shared storage
WO2017008584A1 (en) * 2015-07-15 2017-01-19 中兴通讯股份有限公司 Virtual machine starting method and device, and management node
CN103885830B (en) * 2014-04-16 2017-02-15 中国科学院软件研究所 Data processing method used in cross-data-center live migration process of virtual machine
CN104113574B (en) * 2013-04-19 2017-04-12 中国科学院计算技术研究所 Safe transfer method and system of wide area network trusted virtual machine
CN103577245B (en) * 2013-10-29 2017-05-03 中国科学院计算技术研究所 Lightweight class virtual machine migration method
CN107196803A (en) * 2017-05-31 2017-09-22 中国人民解放军信息工程大学 The dynamic generation and maintaining method of isomery cloud main frame
CN107797878A (en) * 2016-09-06 2018-03-13 阿里巴巴集团控股有限公司 Live migration of virtual machine processing method and system
US10007533B2 (en) * 2012-08-22 2018-06-26 V3 Systems Holdings, Inc. Virtual machine migration
CN108763405A (en) * 2018-05-22 2018-11-06 深信服网络科技(深圳)有限公司 A kind of business datum moving method, device, system and readable storage medium storing program for executing
CN109086118A (en) * 2018-07-25 2018-12-25 浪潮(北京)电子信息产业有限公司 VTPM virtual machine migration method, device and equipment based on KVM
CN109213570A (en) * 2018-08-28 2019-01-15 郑州云海信息技术有限公司 A kind of virtual machine migration method, device, equipment and readable storage medium storing program for executing
CN106708603B (en) * 2016-12-28 2019-04-26 平安科技(深圳)有限公司 Virtual machine quick recovery method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713131B2 (en) * 2017-07-31 2020-07-14 Wmware, Inc. Automatic selection of networks when recovering a virtual machine

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9317314B2 (en) * 2010-06-29 2016-04-19 Microsoft Techology Licensing, Llc Techniques for migrating a virtual machine using shared storage
US10007533B2 (en) * 2012-08-22 2018-06-26 V3 Systems Holdings, Inc. Virtual machine migration
CN104113574B (en) * 2013-04-19 2017-04-12 中国科学院计算技术研究所 Safe transfer method and system of wide area network trusted virtual machine
CN103577245B (en) * 2013-10-29 2017-05-03 中国科学院计算技术研究所 Lightweight class virtual machine migration method
CN103729280A (en) * 2013-12-23 2014-04-16 国云科技股份有限公司 High availability mechanism for virtual machine
CN103885830B (en) * 2014-04-16 2017-02-15 中国科学院软件研究所 Data processing method used in cross-data-center live migration process of virtual machine
WO2017008584A1 (en) * 2015-07-15 2017-01-19 中兴通讯股份有限公司 Virtual machine starting method and device, and management node
CN107797878A (en) * 2016-09-06 2018-03-13 阿里巴巴集团控股有限公司 Live migration of virtual machine processing method and system
CN106708603B (en) * 2016-12-28 2019-04-26 平安科技(深圳)有限公司 Virtual machine quick recovery method and device
CN107196803A (en) * 2017-05-31 2017-09-22 中国人民解放军信息工程大学 The dynamic generation and maintaining method of isomery cloud main frame
CN108763405A (en) * 2018-05-22 2018-11-06 深信服网络科技(深圳)有限公司 A kind of business datum moving method, device, system and readable storage medium storing program for executing
CN109086118A (en) * 2018-07-25 2018-12-25 浪潮(北京)电子信息产业有限公司 VTPM virtual machine migration method, device and equipment based on KVM
CN109213570A (en) * 2018-08-28 2019-01-15 郑州云海信息技术有限公司 A kind of virtual machine migration method, device, equipment and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN111090491A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
JP5075736B2 (en) System failure recovery method and system for virtual server
CN109815049B (en) Node downtime recovery method and device, electronic equipment and storage medium
US11030052B2 (en) Data protection using checkpoint restart for cluster shared resources
US8910172B2 (en) Application resource switchover systems and methods
US10191879B2 (en) System and method for creating snapshots in openflame environment
JP6333410B2 (en) Fault processing method, related apparatus, and computer
CN105357038A (en) Method and system for monitoring virtual machine cluster
CN109656742B (en) Node exception handling method and device and storage medium
JP6447258B2 (en) Management program, management method, and management apparatus
CN109992452B (en) Fault processing method and device
CN105607973B (en) Method, device and system for processing equipment fault in virtual machine system
CN111090491B (en) Virtual machine task state recovery method and device and electronic equipment
CN107203451B (en) Method and apparatus for handling failures in a storage system
CN112199240A (en) Method for switching nodes during node failure and related equipment
US20100085871A1 (en) Resource leak recovery in a multi-node computer system
CN114020527A (en) Snapshot recovery method and device, computer equipment and storage medium
CN110968456B (en) Method and device for processing fault disk in distributed storage system
CN111130856A (en) Server configuration method, system, equipment and computer readable storage medium
CN111488124A (en) Data updating method and device, electronic equipment and storage medium
CN113778763B (en) Intelligent switching method and system for three-way interface service faults
US20230088318A1 (en) Remotely healing crashed processes
CN114996955A (en) Target range environment construction method and device for cloud-originated chaotic engineering experiment
JP5466740B2 (en) System failure recovery method and system for virtual server
CN113485872A (en) Fault processing method and device and distributed storage system
CN114168389A (en) Method and device for recovering CAD file, storage medium and processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant