CN114884836A - High-availability method, device and medium for virtual machine - Google Patents
High-availability method, device and medium for virtual machine Download PDFInfo
- Publication number
- CN114884836A CN114884836A CN202210461403.0A CN202210461403A CN114884836A CN 114884836 A CN114884836 A CN 114884836A CN 202210461403 A CN202210461403 A CN 202210461403A CN 114884836 A CN114884836 A CN 114884836A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- fault
- physical network
- network card
- preset
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 83
- 230000001960 triggered effect Effects 0.000 claims abstract description 48
- 238000004590 computer program Methods 0.000 claims description 15
- 238000013508 migration Methods 0.000 claims description 15
- 230000005012 migration Effects 0.000 claims description 15
- 238000001514 detection method Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 238000012423 maintenance Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002688 persistence Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Computer And Data Communications (AREA)
Abstract
The application discloses a high-availability method, a high-availability device and a high-availability medium for a virtual machine, relates to the technical field of information, and provides the high-availability method for the virtual machine aiming at the problem that the virtual machine cannot normally run due to the failure of a physical network card of a service network: the method comprises the steps of detecting the running state of a physical network card of a source host, judging whether a fault meets a preset fault condition when the physical network card has the fault, writing a virtual machine associated with the physical network card into a to-be-triggered data list if the fault meets the preset fault condition, polling the to-be-triggered data list, judging whether the virtual machine meets the preset service network disconnection requirement, and migrating the virtual machine to a target host if the fault meets the preset service network disconnection requirement, wherein the physical network card of the target host and the associated virtual machine are in a normal connection state. The method and the device have the advantages that the running state of the physical network card is detected, the virtual machine with the service network fault is found in time, and the virtual machine is migrated to other hosts with good network conditions in time, so that the user service is recovered, inconvenience caused by instability of the service network is reduced, and service interruption time is shortened.
Description
Technical Field
The present application relates to the field of information technology, and in particular, to a method, an apparatus, and a medium for high availability of a virtual machine.
Background
The virtual machine exists depending on the host, and the normal operation of the host cannot be influenced by anything running on the virtual machine due to the relatively independent simulation system formed by the virtual machine on the host. Since the virtual machine is used as an environment for the user to use directly, the stability and usability of the virtual machine directly relate to the use experience of the user. In the running process of a server virtualization product, the situation that the state of a virtual machine is normal but a service system in which the virtual machine runs cannot run occurs, and the reason for the situation is that the service network used by the virtual machine is disconnected due to the fault of a physical network card of a host in which the virtual machine runs, so that the service of the virtual machine is interrupted, and great inconvenience is brought to a user.
Therefore, how to solve the problem that the virtual machine cannot normally operate due to the failure of the physical network card of the service network is a technical problem to be solved urgently by the person in the art.
Disclosure of Invention
The application aims to provide a virtual machine high-availability method, a virtual machine high-availability device and a virtual machine high-availability medium, which solve the problem that a virtual machine cannot normally run due to a physical network card failure of a service network.
In order to solve the above technical problem, the present application provides a method for high availability of a virtual machine, including:
detecting the running state of a physical network card of a source host;
when the physical network card fails, judging whether the failure meets a preset failure condition;
if yes, writing the identity identification number of the virtual machine associated with the physical network card into a to-be-triggered data list;
polling the data list to be triggered, and judging whether the virtual machine meets the disconnection requirement of a preset service network;
and if so, migrating the virtual machine to a target host, wherein the connection state of the physical network card of the target host and the associated virtual machine is normal.
Preferably, in the above method for high availability of a virtual machine, before determining whether the fault satisfies a preset fault condition, the method further includes:
writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the running state, the fault time and the fault frequency of the physical network card;
correspondingly, the judging whether the fault meets the preset fault condition includes:
and judging whether the fault meets a preset fault condition or not according to the fault information of the physical network card recorded in the fault information table.
Preferably, in the above method for determining whether the fault meets a preset fault condition includes:
and judging whether the fault time exceeds a preset fault time or whether the fault frequency exceeds a preset fault frequency threshold value according to the fault information table.
Preferably, in the above-mentioned virtual machine high availability method,
the polling of the data list to be triggered and the judgment of whether the virtual machine meets the requirement of the disconnection of a preset service network comprise the following steps:
polling the data list to be triggered, and judging whether the virtual machine is started and whether physical network cards associated with the virtual machine are disconnected;
and if the virtual machine is started and the associated physical network cards are disconnected, the step of migrating the virtual machine to a target host is carried out.
Preferably, in the above method for high availability of a virtual machine, after the virtual machine is started and the associated physical network cards are all disconnected, the method further includes:
writing the identification number of the virtual machine into a downtime information table;
correspondingly, after migrating the virtual machine to the target host, the method further includes:
and deleting the identity identification number of the current virtual machine recorded in the downtime information table.
Preferably, in the above method for migrating a virtual machine to a target host, the method includes:
shutting down the source host of the virtual machine;
and starting the virtual machine at the target host.
Preferably, in the above method for high availability of a virtual machine, after migrating the virtual machine to a target host, the method further includes:
and deleting the identity identification number of the virtual machine recorded in the data list to be triggered.
In order to solve the above technical problem, the present application further provides a virtual machine high availability apparatus, which includes:
the detection module is used for detecting the running state of the physical network card of the source host;
the fault triggering and judging module is used for judging whether the fault meets a preset fault condition or not when the physical network card is in fault; if yes, triggering a recording module;
the recording module is used for writing the identity identification number of the virtual machine associated with the physical network card into a data list to be triggered;
the polling judgment module is used for polling the data list to be triggered and judging whether the virtual machine meets the disconnection requirement of a preset service network; if yes, triggering a migration module;
the migration module is used for migrating the virtual machine to a target host, and the connection state of a physical network card of the target host and the associated virtual machine is normal.
The writing module is used for writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the state of the physical network card, fault time and fault frequency;
the fault triggering judgment subunit is used for polling the data list to be triggered and judging whether the virtual machine is started and whether the physical network cards associated with the virtual machine are disconnected;
in order to solve the above technical problem, the present application further provides a virtual machine high availability apparatus, which includes:
a memory for storing a computer program;
and the processor is used for realizing the steps of the virtual machine high availability method when executing the computer program.
In order to solve the technical problem, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the above-mentioned virtual machine high availability method.
The high-availability method for the virtual machine comprises the following steps: detecting the running state of a physical network card of a source host; when the physical network card breaks down, judging whether the fault meets a preset fault condition; if yes, writing the virtual machine associated with the physical network card into a to-be-triggered data list; polling a data list to be triggered, and judging whether the virtual machine meets the disconnection requirement of a preset service network; if yes, the virtual machine is migrated to the target host, and the connection state of the physical network card of the target host and the associated virtual machine is normal. In the operation process of a virtual machine product, the state of the virtual machine is normal, but the operation of a service system of the virtual machine cannot be performed, namely the operation of the service system of the virtual machine cannot be performed due to the failure of a physical network card.
In addition, the application also provides a virtual machine high availability device and a computer readable storage medium, which comprise the virtual machine high availability method and have the same effects as the above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for making a virtual machine available in high availability according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another method for making a virtual machine available in high availability according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a virtual machine high availability apparatus according to an embodiment of the present disclosure;
fig. 4 is a block diagram of another virtual machine high availability device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a high-availability method, device and medium for a virtual machine.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
A Virtual Machine (Virtual Machine) refers to a complete computer system with complete hardware system functionality, operating in a completely isolated environment, simulated by software. The work that can be done in a physical computer can be implemented in a virtual machine. The method and the device are applied to a system comprising a plurality of source hosts, wherein one source host is associated with one or more virtual machines, one virtual machine is associated with one or more source hosts, and disconnection of a physical network card of the source host may cause the condition that the associated virtual machine is in a normal state, but a service system in which the virtual machine runs cannot run. The method for the virtual machine high availability aims at solving the problems that a management network is normal in a virtualization environment, and a virtual machine service network cannot be normally accessed due to physical network card faults, timely finds the service network faults, recovers the virtual machine operation, reduces the service interruption time of the virtual machine, and reduces the maintenance cost.
Fig. 1 is a flowchart of a method for high availability of a virtual machine according to an embodiment of the present application, and as shown in fig. 1, the method includes:
step S11: detecting the running state of a physical network card of a source host;
the source host mentioned in this embodiment refers to a currently running host, the source host is associated with a plurality of virtual machines, a user can access the virtual machines, the source host is connected with the virtual machines through a virtual switch, and the running state of a physical network card of the source host affects the running state of the virtual machines. And detecting the running state of the physical network card of the source host in real time and judging whether the physical network card works normally or not.
Step S12: when the physical network card breaks down, judging whether the fault meets a preset fault condition;
it should be noted that, in this embodiment, the preset fault condition refers to a judgment condition set according to the current service type or the user tolerance, for example, through judgment of the time when the fault occurs, and through judgment of the frequency when the fault occurs.
When the user preset fault condition is satisfied, the flow proceeds to step S13: writing the identity identification number of the virtual machine associated with the physical network card into a data list to be triggered;
the to-be-triggered data list mentioned in this embodiment refers to a database that records virtual machines associated with physical network cards that currently meet preset failure conditions. The number of virtual machines associated with the physical network card may be multiple.
Step S14: polling a data list to be triggered, and judging whether the virtual machine meets the disconnection requirement of a preset service network;
polling the to-be-triggered data list refers to sequentially checking the virtual machines recorded in the to-be-triggered list at preset time intervals. The preset service network disconnection requirement mentioned in this embodiment refers to determining whether the current virtual machine is actually disconnected from the service network, and since one physical network card may be associated with a plurality of virtual machines and one virtual machine may also be associated with a plurality of physical network cards, if one of the physical network cards fails, the service network of the virtual machine may not be disconnected. However, under special circumstances, in order to ensure that the virtual machine works normally, more than one physical network card of the host associated with the virtual machine can be set to work normally, for example, if the number of the physical network cards of the host associated with the virtual machine is less than 2, it is determined that the virtual machine service network is disconnected; and judging whether the virtual machine recorded in the data list to be triggered meets the preset service network disconnection requirement or not, and judging whether all physical network cards associated with the virtual machine are disconnected or not.
If the virtual machine recorded in the to-be-triggered data list meets the preset service network disconnection requirement, step S15 is performed to migrate the virtual machine to the target host, and the connection state between the physical network card of the target host and the associated virtual machine is normal.
The target host mentioned in this embodiment refers to a host with a normal connection state between the physical network card and the virtual machine, so as to ensure that the service network can be restored to an available state after the virtual machine is migrated to the target host. The embodiment does not limit the manner in which the virtual machine is migrated to the target host, such as static migration or dynamic migration.
Specifically, the method includes detecting an operating state of a physical network card of a source host, judging whether the physical network card normally works, writing virtual machines associated with the physical network card into a to-be-triggered data list when the physical network card fails and meets a preset failure condition, polling the virtual machines recorded in the to-be-triggered list at preset time intervals, and judging whether the virtual machines recorded in the to-be-triggered data list meet a preset service network disconnection requirement, namely judging whether all the physical network cards associated with the virtual machines are disconnected. If the virtual machine recorded in the data list to be triggered meets the preset service network disconnection requirement, the virtual machine is migrated to the target host, and the connection state of the physical network card of the target host and the associated virtual machine is normal, so that the service network can be recovered to be in an available state after the virtual machine is migrated to the target host.
According to the method for high availability of the virtual machine, the state of the virtual machine is normal in the operation process of a virtual machine product, but the operation of a service system in which the virtual machine operates cannot be performed, namely the operation of the service system in which the virtual machine operates due to the failure of the physical network card, the virtual machine in which the service network fails is found in time by detecting the operation state of the physical network card, and the virtual machine is migrated to a host with good network conditions to operate in time, so that the user service is recovered, the inconvenience caused by the instability of the service network is reduced, the service interruption time is shortened, and the fault maintenance cost is reduced.
Because, when the physical network card of the source host fails, other influences may also be caused, and these fault information are recorded, including the fault data that satisfies the preset fault condition and does not satisfy the preset fault condition, so that the worker can query and analyze the problem that the physical network card appears when working, therefore, this embodiment provides an optimal scheme, and step S12 still includes before judging whether the fault satisfies the preset fault condition:
step S121: writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the running state, the fault time and the fault frequency of the physical network card;
correspondingly, step S12 determines whether the fault satisfies a preset fault condition, which includes:
and judging whether the fault meets a preset fault condition or not according to the fault information of the physical network card recorded in the fault information table.
In the embodiment, the fault information when the physical network card fails is written into the fault information table, so that the working state of the physical network card can be known by a worker through inquiring the fault information table. Preferably, the fault data table for recording the fault information is subjected to persistence processing, for example, stored in a database storage manner. When the system or service reboots, the failure information can still be queried.
Correspondingly, in step S12, the data that meets the preset fault condition may be directly screened from the fault information table, and the fault information that meets the preset fault condition is written into the to-be-triggered data list.
According to the foregoing embodiment, this embodiment provides a preferable scheme, where determining whether a fault satisfies a preset fault condition includes:
step S122: and judging whether the fault time exceeds a preset fault time or whether the fault frequency exceeds a preset fault frequency threshold value according to the fault information table.
In the embodiment, it is determined whether the failure time exceeds the preset failure time and the failure frequency exceeds the preset failure frequency threshold, and the preset failure condition is satisfied as long as any one of the failure time and the failure frequency is satisfied. The embodiment does not limit the sequence of judgment, and the design is carried out according to actual needs.
According to the foregoing embodiment, this embodiment provides a preferred scheme for determining disconnection of a virtual machine service network, where the step S14 polls a to-be-triggered data list to determine whether a virtual machine meets a preset service network disconnection requirement, including:
step S141: polling a data list to be triggered, and judging whether the virtual machine is started and whether physical network cards associated with the virtual machine are disconnected;
and if the virtual machine is started and the associated physical network cards are disconnected, the step of migrating the virtual machine to the target host is carried out.
Whether the virtual machine is started or not in this embodiment means whether the virtual machine is in a working state, and it is determined that the current virtual machine meets the preset service network disconnection requirement only when the virtual machine is in the working state and all physical network cards associated with the virtual machine are disconnected. The scheme provided by the embodiment can save the host resources to the maximum extent.
According to the foregoing embodiment, this embodiment provides a preferable scheme, and after the virtual machine is started and the associated physical network cards are all disconnected, the method further includes:
writing the identification number of the virtual machine into a downtime information table;
correspondingly, after migrating the virtual machine to the target host, the method further includes:
and deleting the identity identification number of the current virtual machine recorded in the downtime information table.
If the virtual machine is started and the physical network interface cards of the internet of things are all disconnected, judging that the current virtual machine service network is disconnected, recording the current virtual machine information into the downtime information table, and recording the virtual machine information of all the disconnected service networks in the downtime information table after polling the data list to be triggered. And after the virtual machine is migrated to the target host, deleting the information recorded in the downtime information table so as to prevent missing the virtual machine with the disconnected service network.
Preferably, after writing the virtual machine and the virtual machine fault information into the downtime information table, the method further includes:
traversing whether the virtual machine in the downtime information table meets the preset service network disconnection requirement or not;
if so, pairing the current virtual machine with the host machines in the host machine list to be selected, and taking the paired host machines as target host machines;
in this embodiment, traversing whether the virtual machine in the downtime information table meets the preset service network disconnection requirement is to ensure whether the virtual machine in the downtime information table is still in a service network disconnection state, and if the virtual machine is connected again, the pairing migration is not performed.
Preferably, the present embodiment provides a preferred scheme for migrating a virtual machine, where migrating the virtual machine to a target host includes:
closing a source host of the virtual machine;
the virtual machine is started at the target host.
The embodiment migrates the virtual machine with the power off. Through cold migration, the associated disk may be selected to be moved from one data store to another. By this method, the virtual machine does not need to be located on the shared memory, and the data loss rate is small.
According to the foregoing embodiment, this embodiment provides a preferable scheme, where after migrating the virtual machine to the target host in step S15, the method further includes:
and deleting the identity identification number of the virtual machine recorded in the data list to be triggered.
After the virtual machine is migrated to the target host, the virtual machine data recorded in the data list to be triggered is deleted, so that repeated triggering is avoided, and computing resources are wasted.
Since the above description of the high availability method for the virtual machine provided by the present application is progressive layer by layer, in order to further describe the method, in combination with an actual application scenario, as shown in fig. 2, the present application provides a preferred embodiment as follows:
the method and the device are applied to a system comprising a plurality of source hosts, wherein one source host is associated with one or more virtual machines, one virtual machine is associated with one or more source hosts, and disconnection of a physical network card of the source host may cause the condition that the state of the virtual machine is normal but a service system operated by the virtual machine cannot be operated. The method for the virtual machine high availability aims at solving the problems that a management network is normal in a virtualization environment, and a virtual machine service network cannot be normally accessed due to the fact that a physical network card fails, and the method for the virtual machine high availability is capable of finding out service network failures in time, recovering virtual machine operation, reducing service interruption time of the virtual machine and reducing maintenance cost.
Step S11: detecting the running state of a physical network card of a source host;
and detecting the running state of the physical network card of the source host in real time and judging whether the physical network card works normally or not.
Step S121: when the physical network card fails, writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the running state, the fault time and the fault frequency of the physical network card;
the fault information when the physical network card is in fault is written into the fault information table, so that a worker can conveniently know the working state of the physical network card by inquiring the fault information table. Preferably, the fault data table for recording the fault information is subjected to persistence processing, for example, stored in a database storage manner. When the system or service reboots, the failure information can still be queried.
Step S122: judging whether the fault time exceeds a preset fault time or whether the fault frequency exceeds a preset fault frequency threshold value according to a fault information table; if yes, go to step S13;
and directly screening the data which meet the preset fault condition from the fault information table, and writing the data which meet the preset fault condition and correspond to the fault information into a to-be-triggered data list.
Step S13: writing the identity identification number of the virtual machine associated with the physical network card into a to-be-triggered data list;
the data list to be triggered refers to a database for recording virtual machines associated with physical network cards which currently meet preset fault conditions. The number of virtual machines associated with the physical network card may be multiple.
Step S141: polling a data list to be triggered, and judging whether the virtual machine is started and whether physical network cards associated with the virtual machine are disconnected; if yes, go to step S142;
whether the virtual machine is started or not in this embodiment means whether the virtual machine is in a working state, and it is determined that the current virtual machine meets the requirements only when the virtual machine is in the working state and all physical network cards associated with the virtual machine are disconnected.
Step S142: writing the identification number of the virtual machine into a downtime information table;
if the virtual machine is started and the physical network cards of the internet of things are all disconnected, judging that the current virtual machine service network is disconnected, recording the current virtual machine information into the downtime information table, and recording the virtual machine information of all the disconnected service networks in the downtime information table after polling the to-be-triggered data list. And after the virtual machine is migrated to the target host, deleting the information recorded in the downtime information table so as to prevent missing the virtual machine with the disconnected service network.
Step S15: migrating the virtual machine to a target host, wherein the connection state of a physical network card of the target host and the associated virtual machine is normal;
the target host mentioned in this embodiment refers to a host with a normal connection state between the physical network card and the virtual machine, so as to ensure that the service network can be restored to an available state after the virtual machine is migrated to the target host. The embodiment does not limit the manner in which the virtual machine is migrated to the target host, such as static migration or dynamic migration.
Step S151: deleting the identity identification number of the current virtual machine recorded in the downtime information table;
and after the virtual machine is migrated to the target host, deleting the virtual machine data recorded in the downtime information table, and avoiding repeated pairing migration.
Step S152: and deleting the identity identification number of the virtual machine recorded in the data list to be triggered.
After the virtual machine is migrated to the target host, the virtual machine data recorded in the data list to be triggered is deleted, so that repeated triggering is avoided, and computing resources are wasted.
By the virtual machine high-availability method, when the virtual machine has a service network fault in the operation process, the virtual machine product migrates to other hosts with good network conditions to operate so as to recover user services, reduce inconvenience caused by instability of the service network, reduce service interruption time and reduce fault maintenance cost.
In the foregoing embodiment, a detailed description is given of a virtual machine high availability method, and the present application also provides an embodiment corresponding to a virtual machine high availability device. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one is from the perspective of the function module, and the other is from the perspective of the hardware.
Fig. 3 is a schematic diagram of a virtual machine high availability apparatus according to an embodiment of the present application, as shown in fig. 3, including:
a detection module 31, configured to detect an operating state of a physical network card of a source host;
the failure triggering and judging module 32 is configured to, when the physical network card fails, judge whether the failure meets a preset failure condition; if yes, triggering the recording module 33;
the recording module 33 is configured to write the identity number of the virtual machine associated with the physical network card into the to-be-triggered data list;
the polling judging module 34 is configured to poll the to-be-triggered data list, and judge whether the virtual machine meets a preset service network disconnection requirement; if yes, triggering the migration module 35;
the migration module 35 is configured to migrate the virtual machine to the target host, where a connection state between the physical network card of the target host and the associated virtual machine is normal.
Specifically, the detection module 31 detects the running state of the physical network card of the source host; when the physical network card fails, the failure triggering and judging module 32 judges whether the failure meets a preset failure condition; if yes, triggering the recording module 33, and writing the virtual machine associated with the physical network card into a to-be-triggered data list by the recording module 33; the polling judgment module 34 polls the data list to be triggered to judge whether the virtual machine meets the preset service network disconnection requirement; if yes, triggering the migration module 35; the migration module 35 migrates the virtual machine to the target host, and the connection state between the physical network card of the target host and the associated virtual machine is normal. In the operation process of a virtual machine product, the state of the virtual machine is normal, but the operation of a service system of the virtual machine cannot be performed, namely, the operation of the service system of the virtual machine cannot be performed due to the failure of a physical network card.
In addition, the device further comprises:
a writing module: the system is used for writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the running state, the fault time and the fault frequency of the physical network card;
the fault trigger judging module 32 includes a fault trigger judging subunit, configured to poll the data list to be triggered, and judge whether the virtual machine is started and whether the physical network cards associated with the virtual machine are all disconnected;
since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 4 is a block diagram of another virtual machine high availability device according to an embodiment of the present application, where as shown in fig. 4, the virtual machine high availability device includes: a memory 40 for storing a computer program;
a processor 41, configured to implement the steps of the virtual machine high availability method according to the above-described embodiment when executing the computer program.
The virtual machine high availability device provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
Processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The Processor 41 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 41 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 41 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 41 may also include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 40 may include one or more computer-readable storage media, which may be non-transitory. Memory 40 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 40 is at least used for storing a computer program 401, wherein after being loaded and executed by the processor 41, the computer program can implement the relevant steps of the virtual machine high availability method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 40 may also include an operating system 402, data 403, and the like, and the storage manner may be a transient storage or a permanent storage. Operating system 402 may include, among other things, Windows, Unix, Linux, and the like. Data 403 may include, but is not limited to, data involved in implementing a virtual machine high availability method, and the like.
In some embodiments, the virtual machine high availability device may further include a display 42, an input/output interface 43, a communication interface 44, a power supply 45, and a communication bus 46.
Those skilled in the art will appreciate that the architecture shown in FIG. 4 does not constitute a limitation on the highly available devices of a virtual machine, and may include more or fewer components than those shown.
The high-availability device of the virtual machine provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the following method can be realized: a virtual machine high availability method. By detecting the running state of the physical network card, the virtual machine with the service network fault is found in time, and the virtual machine is migrated to other hosts with good network conditions in time to run, so that the user service is recovered, inconvenience caused by instability of the service network is reduced, service interruption time is shortened, and fault maintenance cost is reduced.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps recited in the above-described embodiments of the virtual machine high availability method.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of: the virtual machine high availability method detects the running state of the physical network card, timely discovers the virtual machine with a service network fault, and timely migrates the virtual machine to other hosts with good network conditions to run so as to recover the user service, reduce inconvenience caused by instability of the service network, reduce service interruption time and reduce fault maintenance cost.
The above detailed description is provided for the method, apparatus, and medium for virtual machine high availability provided by the present application. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A method for high availability of a virtual machine, comprising:
detecting the running state of a physical network card of a source host;
when the physical network card fails, judging whether the failure meets a preset failure condition;
if yes, writing the identity identification number of the virtual machine associated with the physical network card into a to-be-triggered data list;
polling the data list to be triggered, and judging whether the virtual machine meets the disconnection requirement of a preset service network;
and if so, migrating the virtual machine to a target host, wherein the connection state of the physical network card of the target host and the associated virtual machine is normal.
2. The method according to claim 1, wherein before determining whether the fault satisfies a preset fault condition, the method further includes:
writing fault information corresponding to the fault into a fault information table, wherein the fault information comprises the running state, the fault time and the fault frequency of the physical network card;
correspondingly, the judging whether the fault meets the preset fault condition includes:
and judging whether the fault meets a preset fault condition or not according to the fault information of the physical network card recorded in the fault information table.
3. The method according to claim 2, wherein the determining whether the fault satisfies a preset fault condition includes:
and judging whether the fault time exceeds a preset fault time or whether the fault frequency exceeds a preset fault frequency threshold value according to the fault information table.
4. The method for high availability of the virtual machine according to claim 1, wherein the polling of the to-be-triggered data list to determine whether the virtual machine meets a preset service network disconnection requirement includes:
polling the data list to be triggered, and judging whether the virtual machine is started and whether physical network cards associated with the virtual machine are disconnected;
and if the virtual machine is started and the associated physical network cards are disconnected, the step of migrating the virtual machine to a target host is carried out.
5. The method according to claim 4, further comprising, if the virtual machine is turned on and the associated physical network cards are all disconnected:
writing the identification number of the virtual machine into a downtime information table;
correspondingly, after migrating the virtual machine to the target host, the method further includes:
and deleting the identity identification number of the current virtual machine recorded in the downtime information table.
6. The method of claim 1, wherein migrating the virtual machine to a target host comprises:
shutting down the source host of the virtual machine;
and starting the virtual machine at the target host.
7. The method of claim 1, wherein after migrating the virtual machine to the target host, the method further comprises:
and deleting the identity identification number of the virtual machine recorded in the data list to be triggered.
8. A virtual machine high availability apparatus, comprising:
the detection module is used for detecting the running state of the physical network card of the source host;
the fault triggering and judging module is used for judging whether the fault meets a preset fault condition or not when the physical network card is in fault; if yes, triggering a recording module;
the recording module is used for writing the identity identification number of the virtual machine associated with the physical network card into a data list to be triggered;
the polling judgment module is used for polling the data list to be triggered and judging whether the virtual machine meets the disconnection requirement of a preset service network; if yes, triggering a migration module;
the migration module is used for migrating the virtual machine to a target host, and the connection state of a physical network card of the target host and the associated virtual machine is normal.
9. A virtual machine high availability apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the virtual machine high availability method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the virtual machine high availability method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210461403.0A CN114884836A (en) | 2022-04-28 | 2022-04-28 | High-availability method, device and medium for virtual machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210461403.0A CN114884836A (en) | 2022-04-28 | 2022-04-28 | High-availability method, device and medium for virtual machine |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114884836A true CN114884836A (en) | 2022-08-09 |
Family
ID=82671490
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210461403.0A Pending CN114884836A (en) | 2022-04-28 | 2022-04-28 | High-availability method, device and medium for virtual machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114884836A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115794470A (en) * | 2022-12-01 | 2023-03-14 | 北京首都在线科技股份有限公司 | Operation management method and device of virtual machine, electronic equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120005521A1 (en) * | 2010-06-30 | 2012-01-05 | Oracle America, Inc. | Method and system for maintaining direct hardware access in the event of network interface card failure |
JP2017073763A (en) * | 2015-10-09 | 2017-04-13 | ニューソフト コーポレーションNeusoft Corporation | Physical network security device and method for controlling the same |
CN106874136A (en) * | 2017-02-22 | 2017-06-20 | 郑州云海信息技术有限公司 | The fault handling method and device of a kind of storage system |
CN107179957A (en) * | 2016-03-10 | 2017-09-19 | 阿里巴巴集团控股有限公司 | Physical machine failure modes processing method, device and virtual machine restoration methods, system |
CN109308232A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | The method, apparatus and system of rollback after live migration of virtual machine failure |
CN110740054A (en) * | 2019-07-17 | 2020-01-31 | 东南大学 | data center virtualization network fault diagnosis method based on reinforcement learning |
CN112000504A (en) * | 2020-08-19 | 2020-11-27 | 浪潮云信息技术股份公司 | Fault processing method and device for computing node and electronic equipment |
US20220104147A1 (en) * | 2019-02-04 | 2022-03-31 | Apple Inc. | Tracking reference signal setup in radio resource management testing |
US20220103265A1 (en) * | 2019-02-15 | 2022-03-31 | Apple Inc. | Method for initialization seed generation for pn sequences in remote interference management |
-
2022
- 2022-04-28 CN CN202210461403.0A patent/CN114884836A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120005521A1 (en) * | 2010-06-30 | 2012-01-05 | Oracle America, Inc. | Method and system for maintaining direct hardware access in the event of network interface card failure |
JP2017073763A (en) * | 2015-10-09 | 2017-04-13 | ニューソフト コーポレーションNeusoft Corporation | Physical network security device and method for controlling the same |
CN107179957A (en) * | 2016-03-10 | 2017-09-19 | 阿里巴巴集团控股有限公司 | Physical machine failure modes processing method, device and virtual machine restoration methods, system |
CN106874136A (en) * | 2017-02-22 | 2017-06-20 | 郑州云海信息技术有限公司 | The fault handling method and device of a kind of storage system |
CN109308232A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | The method, apparatus and system of rollback after live migration of virtual machine failure |
US20220104147A1 (en) * | 2019-02-04 | 2022-03-31 | Apple Inc. | Tracking reference signal setup in radio resource management testing |
US20220103265A1 (en) * | 2019-02-15 | 2022-03-31 | Apple Inc. | Method for initialization seed generation for pn sequences in remote interference management |
CN110740054A (en) * | 2019-07-17 | 2020-01-31 | 东南大学 | data center virtualization network fault diagnosis method based on reinforcement learning |
CN112000504A (en) * | 2020-08-19 | 2020-11-27 | 浪潮云信息技术股份公司 | Fault processing method and device for computing node and electronic equipment |
Non-Patent Citations (1)
Title |
---|
焦繁: "《VMWARE虚拟化技术应用实验[M]》", 31 December 2021, pages: 133 - 137 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115794470A (en) * | 2022-12-01 | 2023-03-14 | 北京首都在线科技股份有限公司 | Operation management method and device of virtual machine, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105607973B (en) | Method, device and system for processing equipment fault in virtual machine system | |
US20210374155A1 (en) | Synchronizing changes to stale components of a distributed object using synchronization bitmaps | |
US20240264915A1 (en) | Data storage method and apparatus, and electronic device and readable storage medium | |
CN104036043A (en) | High availability method of MYSQL and managing node | |
WO2023226380A1 (en) | Disk processing method and system, and electronic device | |
WO2021004256A1 (en) | Node switching method in node failure and related device | |
US12050778B2 (en) | Data restoration method and related device | |
CN114884836A (en) | High-availability method, device and medium for virtual machine | |
CN113868023B (en) | Snapshot method and device of storage system, electronic equipment and readable storage medium | |
CN110692058A (en) | Auxiliary storage device providing independent backup and recovery functions and apparatus using the same | |
CN108845772B (en) | Hard disk fault processing method, system, equipment and computer storage medium | |
CN114189429B (en) | Monitoring system, method, device and medium for server cluster faults | |
CN113672306B (en) | Server component self-checking abnormity recovery method, device, system and medium | |
CN114461341A (en) | Method, device and medium for preventing brain crack of cloud platform virtual machine | |
CN109445909A (en) | Backup method, system, terminal and the storage medium of virtual-machine data | |
CN110798347B (en) | Service state detection method, device, equipment and storage medium | |
JP2020149090A (en) | Determination method, information processing device and determination program | |
CN115562593A (en) | Abnormal RAID member disk processing method, device and medium | |
US9836515B1 (en) | Systems and methods for adding active volumes to existing replication configurations | |
CN115114086A (en) | Array volume recovery method, system, equipment and storage medium based on disk array | |
CN114301927B (en) | Main node selection method, device and medium in distributed system | |
CN115454339A (en) | Data storage method, device and medium | |
CN112596941B (en) | Tool result judging method and device of industrial image processing software | |
CN104252395B (en) | A kind of information processing method and electronic equipment | |
CN116820822A (en) | Read-write link control method, device and medium |
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 |