CN117215722A - Virtual machine management method and device, electronic equipment and storage medium - Google Patents

Virtual machine management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117215722A
CN117215722A CN202311166742.7A CN202311166742A CN117215722A CN 117215722 A CN117215722 A CN 117215722A CN 202311166742 A CN202311166742 A CN 202311166742A CN 117215722 A CN117215722 A CN 117215722A
Authority
CN
China
Prior art keywords
network card
virtual machine
computing node
current computing
management method
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
Application number
CN202311166742.7A
Other languages
Chinese (zh)
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.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication 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 Inspur Communication Technology Co Ltd filed Critical Inspur Communication Technology Co Ltd
Priority to CN202311166742.7A priority Critical patent/CN117215722A/en
Publication of CN117215722A publication Critical patent/CN117215722A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to the technical field of cloud computing, and provides a virtual machine management method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: carrying out link fault monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network; if the service network card has a link fault, closing the virtual machine on the current computing node; and after the virtual machine is evacuated to the target computing node, starting the virtual machine. The virtual machine management method provided by the invention can avoid the situation that virtual machines with the same names and running states are remained on the failed node and the evacuated current computing node at the same time, thereby avoiding the problem of brain fracture of the virtual machine, and improving the usability of the virtual machine.

Description

Virtual machine management method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a virtual machine management method, a virtual machine management device, electronic equipment and a storage medium.
Background
Currently, conventional virtualization vendors mostly use open source OpenStack, and communities do not provide reliable virtual machine fault migration management capability for business. When the network card connection of a single physical node carrying a virtual machine is disconnected or the physical node is very restarted, due to triggering of a virtual machine high availability (High Availability, HA) evacuation migration mechanism, a situation often occurs in which virtual machines with the same name and running state remain on a failed node and an evacuated target node at the same time. The most serious influence of the problems is that virtual machines in multiple running states read and write the same shared disk at the same time, virtual machine desktop blue screens or file systems of cloud desktop users are damaged, user data are directly lost, and usability of the virtual machines is low.
Disclosure of Invention
The embodiment of the invention provides a virtual machine management method, a device, electronic equipment and a storage medium, which are used for solving the problem of low availability of the current virtual machine.
In a first aspect, an embodiment of the present invention provides a virtual machine management method applied to a high availability monitoring component for managing at least one computing node in a created high availability cluster; the virtual machine management method comprises the following steps:
carrying out link fault monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
if the service network card has a link fault, closing the virtual machine on the current computing node;
and after the virtual machine is evacuated to the target computing node, starting the virtual machine.
In one embodiment, the target computing node is determined by:
acquiring load index information of other computing nodes except the current computing node;
comparing each load index information with a preset load index threshold value;
determining other computing nodes with load index information smaller than or equal to the preset load index threshold value as intermediate computing nodes;
and determining the computing node with the smallest numerical value of the load index information in the intermediate computing nodes as a target computing node.
In one embodiment, the physical network card further comprises a management network card and a storage network card; the management network card is a network card for managing the current computing node; the storage network card is a network interface used for data transmission and access between the current computing node and a storage node, and the storage node is used for storing and providing data.
In one embodiment, after closing the virtual machine on the current computing node, further comprising:
and if the management network card or the storage network card has a link fault, clearing the configuration information of the virtual network card in the virtual machine.
In one embodiment, the link failure monitoring of the physical network card of the current computing node includes:
monitoring the flow of a communication port in a physical network card of a current computing node;
if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, determining that the physical network card has a link fault.
In one embodiment, after evacuating the virtual machine to the target computing node, further comprising:
carrying out link monitoring on the service network card;
if the service network card has no link fault, detecting the state of the virtual machine migration task of the current computing node;
if the current computing node does not have the unfinished virtual machine migration task, the virtual machine is migrated from the target computing node to the current computing node after being closed, and the virtual machine after the migration is completed is started.
In one embodiment, the link monitoring of the service network card includes:
monitoring the flow of the communication port of the service network card;
if the number of times that the communication port of the service network card receives the flow packet within the second preset time threshold is greater than or equal to the preset number of times, determining that the service network card has no link fault; the second preset duration threshold is a preset multiple of the first preset duration threshold; the value of the preset times is larger than or equal to the value of the preset multiple.
In a second aspect, an embodiment of the present invention provides a virtual machine management apparatus, including:
the monitoring module is used for monitoring the link fault of the physical network card of the current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
the closing module is used for closing the virtual machine on the current computing node if the service network card has a link fault;
and the evacuation module is used for starting the virtual machine after evacuating the virtual machine to the target computing node.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory storing a computer program, where the processor implements the virtual machine management method according to the first aspect when executing the program.
In a fourth aspect, an embodiment of the present invention provides a storage medium, where the storage medium is a computer readable storage medium, including a computer program, where the computer program when executed by a processor implements the virtual machine management method according to the first aspect.
The virtual machine management method, the virtual machine management device, the electronic equipment and the storage medium provided by the embodiment of the invention monitor the link fault of the physical network card of the current computing node; when the link fault of the service network card in the physical network card is monitored, the virtual machine on the current computing node can be timely closed, and the virtual machine is evacuated to the target computing node and then restarted, so that the situation that the virtual machines with the same name and running state are remained on the failed node and the evacuated current computing node at the same time is avoided, the problem of brain crack of the virtual machine is avoided, and the usability of the virtual machine can be improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a virtual machine management method according to an embodiment of the present invention;
FIG. 2 is a flowchart of an overall scheme of a virtual machine management method provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a functional module of a virtual machine management device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The method, the device, the electronic equipment and the storage medium for managing the virtual machine provided by the invention are described in detail below with reference to the embodiments.
Referring to fig. 1, fig. 1 is a flowchart illustrating a virtual machine management method according to an embodiment of the present invention. The embodiment of the invention provides a virtual machine management method, which can comprise the following steps:
step 100, monitoring link faults of a physical network card of a current computing node;
step 200, if the service network card has a link failure, closing the virtual machine on the current computing node;
step 300, after evacuating the virtual machine to the target computing node, starting the virtual machine.
It should be noted that, the virtual machine management method provided by the embodiment of the invention is implemented based on a virtual machine management device, the virtual machine management method is applied to an OpenStack cloud platform, based on the cluster management capability of a high availability component masakari and pacemaek of a native OpenStack cloud platform, the virtual machine high availability monitoring (High Availability Monitor, HA Monitor) component in the virtual machine management device is used for periodically detecting the connection state of the physical network card, that is, monitoring the communication and data transmission states between the computing node and the physical network card, the management state of the computing node and the data transmission and access states between the computing node and the storage node, when the connection of a plurality of physical network cards of the computing node is abnormal, the virtual machine on the computing node is automatically closed, the virtual machine is evacuated to a target computing node, and the virtual machine is started. Therefore, the embodiment of the invention describes the virtual machine management method by taking the HA Monitor component as an execution main body as an example.
Specifically, the HA Monitor component creates a high availability cluster based on cluster management capabilities and configures high availability resources for the high availability cluster, and further, the HA Monitor component adds a computing node that HAs turned on the high availability function to the high availability cluster that was created successfully, so that the current computing node with the high availability function begins to participate in failover and load balancing of the high availability cluster. It should be noted that, high availability refers to the capability of a system or service to continuously provide stable operation in the face of unexpected situations such as equipment failure, software errors, natural disasters, or human interference.
Further, the HA Monitor component monitors link faults of the physical network card of the current computing node within preset HA migration window time, wherein the HA migration window time refers to a time period when the HA Monitor component needs to stop external service when performing evacuation operation of the virtual machine, and the preset HA migration window time is set according to actual conditions; the physical network cards include, but are not limited to, a service network card, a management network card and a storage network card, the service network card is a network interface for processing communication and data transmission between the current computing node and an external network, the management network card is a network card for managing the current computing node, and the storage network card is a network interface for performing data transmission and access between the current computing node and the storage node.
Therefore, it can be understood that the HA monitor component monitors link failures of the service network card, the management network card, the storage network card and other physical network cards of the current computing node within the preset HA migration window time.
Further, if the service network card HAs a link failure, the HA Monitor component determines that the current computing node HAs a failure, and closes the virtual machine on the failed computing node, that is, if the service network card of the current computing node HAs a communication failure and a data transmission failure between the current computing node and an external network, the HA Monitor component determines that the current computing node HAs a failure, and closes the virtual machine on the failed computing node.
Further, the HA Monitor component forces the nova-computer service of the failed computing node to be in a maintenance mode for switching the failed computing node from a normal operation state to a maintenance state, and further, the HA Monitor component evacuates the virtual machine on the failed computing node to the target computing node to enable the virtual machine to operate normally on the target computing node.
Further, after the HA Monitor component evacuates the virtual machine on the failed computing node to the target computing node, the HA Monitor component determines whether the failed computing node HAs recovered to normal.
Further, if the HA Monitor component determines that the failed computing node is restored to normal, the HA Monitor component switches off the virtual machine and then migrates to the restored computing node, switches on the virtual machine again, and cancels the forced maintenance mode of the nova-computer service to continue providing the service to the outside.
According to the virtual machine management method provided by the embodiment of the invention, the link fault is monitored through the physical network card of the current computing node; when the link fault of the service network card in the physical network card is monitored, the virtual machine on the current computing node can be timely closed, and the virtual machine is evacuated to the target computing node and then restarted, so that the situation that the virtual machines with the same name and running state are remained on the fault node and the evacuated target node at the same time is avoided, the problem of brain crack of the virtual machine is avoided, and the usability of the virtual machine can be improved.
Further, based on the link failure monitoring of the physical network card of the current computing node in step 100, the method includes:
monitoring the flow of a communication port in a physical network card of a current computing node;
if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, determining that the physical network card has a link fault.
Specifically, the HA Monitor component monitors traffic of the communication ports in the physical network card of the current computing node through an analysis tool that grabs the network data packet, so as to determine whether the communication ports in the physical network card communicate normally.
Further, if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, the HA Monitor component determines that the physical network card HAs a link failure, and further, if the communication port in the physical network card receives the flow packet within the first preset duration threshold, the HA Monitor component determines that the physical network card does not have a link failure, where the first preset duration threshold is set according to an actual situation.
In one embodiment, the analysis tool that grabs the network packets may employ a tcpdump tool, and the HA Monitor component may implement traffic monitoring of the communication ports in the physical network card of the current computing node by user input of the instruction "tcpdump-n-c 1-p-i nic port", where the "-n" characterizes disable the conversion of the internet protocol address and port number into hostname and service name, the "-c 1" characterizes the grabbing and displaying of only 1 matching packet, and then exit, the "-p" characterizes disable the promiscuous mode, capture only packets destined for or issued by the local machine, the "-i nic" characterizes the network port designated for listening, and the "port" characterizes the filtering of a specific port number.
According to the embodiment of the invention, the communication ports in the physical network card of the current computing node are subjected to flow monitoring, if the communication ports in the physical network card do not receive the flow packet within the first preset duration threshold, the physical network card is determined to have the link fault, the multi-network card communication monitoring of the current computing node is realized, the rapid positioning and evacuation processing of the fault node are further realized, the automation monitoring level is improved, and meanwhile, the high availability capacity of the virtual machine management device is improved through the periodic communication inspection of the current computing node.
Further, after closing the virtual machine on the current computing node, further comprising:
and if the management network card or the storage network card has a link fault, clearing the configuration information of the virtual network card in the virtual machine.
Specifically, if it is determined that the service network card of the current computing node HAs a link failure, the HA Monitor component determines that the current computing node HAs a failure, and closes the virtual machine on the failed computing node, and further, if it is determined that the management network card or the storage network card of the current computing node HAs a link failure, the HAMonitor component clears configuration information of the virtual network card in the virtual machine on the failed computing node, so as to prevent virtual network card residues in the virtual machine.
It should be noted that, when determining that the service network card of the current computing node HAs a link failure, the HA Monitor component clears the configuration information of the virtual network card in the virtual machine based on the condition that the management network card or the storage network card of the current computing node HAs a link failure, that is, when determining that the service network card of the current computing node does not have a link failure, the HA Monitor component does not close the virtual machine on the current computing node and clear the configuration information of the virtual network card in the virtual machine even if based on the condition that the management network card or the storage network card of the current computing node HAs a link failure.
According to the embodiment of the invention, the virtual machine on the current computing node is closed and the configuration information of the virtual network card in the virtual machine is cleared through the multi-network card communication monitoring fault, so that the virtual machine is evacuated, the situation that the virtual machine with the same name and the same running state is remained on the fault node and the evacuated current computing node is avoided, the problem of brain fracture of the virtual machine is avoided, the usability of the virtual machine is improved, meanwhile, the problem of evacuation of the abnormal virtual machine caused by a single network card physical link port is avoided, the fault tolerance and the usability of the virtual machine management device are improved, and the stability of high-availability functions, the continuity of service functions and the stability of data transmission are ensured.
Further, the target computing node is determined by:
acquiring load index information of other computing nodes except the current computing node;
comparing each load index information with a preset load index threshold value;
determining other computing nodes with load index information smaller than or equal to the preset load index threshold value as intermediate computing nodes;
and determining the computing node with the smallest numerical value of the load index information in the intermediate computing nodes as a target computing node.
Specifically, the HA Monitor component obtains load index information of other computing nodes except the fault computing node, and further, the HA Monitor component compares the value of each load index information with a preset load index threshold according to each load index information and the preset load index threshold, where the preset load index threshold is set according to an actual situation.
Further, if the load index information is less than or equal to the preset load index threshold, the HA Monitor component determines other computing nodes with load index information less than or equal to the preset load index threshold as intermediate computing nodes.
Further, the Hamonitor component compares the values of the load index information of the intermediate computing nodes according to the load index information of the intermediate computing nodes to obtain a comparison result, and further, the Hamonitor component determines the computing node with the smallest value of the load index information in the intermediate computing nodes according to the comparison result and determines the computing node with the smallest value as the target computing node.
According to the embodiment of the invention, the load index information of other computing nodes except the fault computing node is obtained, and the computing node with the minimum load index information in the intermediate computing nodes which are smaller than or equal to the preset load index threshold is further determined as the target computing node, so that the virtual machine on the fault node is evacuated to the target computing node, the performance degradation caused by overload of a single node is avoided, the load balancing capability is improved, the resource utilization efficiency is optimized, the evacuation speed of the virtual machine is improved, and the suspension running time of the virtual machine is shortened.
Further, after evacuating the virtual machine to the target computing node, further comprising:
carrying out link monitoring on the service network card;
if the service network card has no link fault, detecting the state of the virtual machine migration task of the current computing node;
if the current computing node does not have the unfinished virtual machine migration task, the virtual machine is migrated from the target computing node to the current computing node after being closed, and the virtual machine after the migration is completed is started.
Specifically, after the HA Monitor component evacuates the virtual machine on the failed computing node to the target computing node, the HA Monitor component determines the failed computing node as the computing node to be restored, and performs link detection on the service network card of the computing node to be restored.
Further, if it is determined that the service network card HAs a link failure, the HA Monitor component determines that the computing node to be restored does not restore the normal communication function.
Further, if it is determined that the service network card HAs no link failure, the HAMonitor component performs state detection of a virtual machine migration task on the computing node to be restored, and further, if it is determined that the computing node to be restored HAs no unfinished virtual machine migration task, that is, the virtual machine HAs been completely evacuated to the target computing node, the HA Monitor component determines that the computing node to be restored restores the normal communication function, and obtains the computing node to be restored to the normal state.
Further, the HAMonitor component shuts down the virtual machines that are evacuated to the target computing node, and migrates the shut down virtual machines from the target computing node to the recovery computing node.
Further, the HAMonitor component restarts the virtual machine after the migration is completed, and cancels the forced maintenance mode of the nova-computer service to continue to provide the service to the outside.
According to the embodiment of the invention, the link monitoring is carried out on the service network card, the state detection of the migration task of the virtual machine is carried out, the normal communication function of the fault computing node is restored, the virtual machine is further migrated from the target computing node to the normal computing node after being closed, and the virtual machine after being migrated is restarted, so that the active configuration maintenance and the active release maintenance of the fault node are realized, the automatic monitoring level is improved, meanwhile, the problem that the same virtual machine exists in a plurality of computing nodes due to network abnormality and abnormal power failure, namely the virtual machine brain fracture problem is solved, the blank and the short plate of the virtual machine high-availability management function for preventing the virtual brain fracture problem are filled, and the usability of the virtual machine is improved.
Further, the link monitoring for the service network card includes:
monitoring the flow of the communication port of the service network card;
if the number of times that the communication port of the service network card receives the flow packet within the second preset time threshold is greater than or equal to the preset number of times, determining that the service network card has no link fault; the second preset duration threshold is a preset multiple of the first preset duration threshold; the value of the preset times is larger than or equal to the value of the preset multiple.
Specifically, the HA Monitor component monitors the traffic of the communication port of the service network card of the computing node to be restored by capturing an analysis tool of the network data packet, so as to determine whether the communication port in the service network card is normal in communication and normal in data transmission.
Further, if it is determined that the number of times that the communication port of the service network card receives the traffic packet within the second preset duration threshold is greater than or equal to the preset number of times, the HAMonitor component determines that the service network card has no link failure, where the second preset duration threshold is a preset multiple of the first preset duration threshold, and a value of the preset number of times is greater than or equal to a value of the preset multiple.
It should be noted that, if the preset multiple is 1 and the preset number of times is equal to the preset multiple and is 1, the second preset duration threshold is equal to the first preset duration threshold, that is, the communication port of the service network card receives the 1-time traffic packet within the second preset duration threshold, but the communication port of the service network card receives the 1-time traffic packet in an occasional case, where the occasional case includes, but is not limited to, network jitter, configuration error and physical layer problem, so that the preset multiple is set to 1 and is not suitable, and at least needs to be set to 2, so as to determine that the communication port of the service network card can stably and continuously receive the traffic packet within the second preset duration threshold.
It should be further noted that, in the process of performing link monitoring on the service network card, the HA Monitor component does not consider the number of the traffic packets received each time, but determines whether the communication port of the service network card stably and continuously receives the traffic packets within the second preset duration threshold according to the number of times of receiving the traffic packets, so as to determine that the service network card HAs no link failure.
In an embodiment, the first preset duration threshold is 5 minutes, the preset multiple is 2, and the preset times are 3, and then the second preset duration threshold is 10 minutes, so that the HA Monitor component determines that the communication port of the service network card receives 3 traffic packets within 10 minutes, further, the HA Monitor component determines that the communication port of the service network card can stably and continuously receive the traffic packets within 10 minutes, and determines that the service network card HAs no link failure.
According to the embodiment of the invention, the communication port of the service network card is monitored in the flow, so that the communication port of the service network card can stably and continuously receive the flow packet within the second preset time threshold, and the condition that the service network card has no link fault is determined, so that the normal computing node is determined to be restored, the link connection is ensured to be normal, and the availability of the virtual machine is improved.
Further, referring to fig. 2, fig. 2 is a flowchart of an overall scheme of a virtual machine management method according to an embodiment of the present invention, so that an overall flow of the virtual machine management method according to the present invention may be understood as follows:
the HA Monitor component creates a high availability cluster of computing nodes and configures high availability resources for the high availability cluster, and further, the HA Monitor component adds the computing nodes with the high availability functions already started into the high availability cluster which is successfully created, so that the current computing nodes with the high availability functions start to participate in the failover and the load balancing of the high availability cluster.
Further, the HAMonitor component monitors link faults of the physical network card of the current computing node within the preset HA migration window time, namely monitors link faults of the physical network card such as the service network card, the management network card and the storage network card of the current computing node.
Further, the HAMonitor component monitors traffic of the communication port in the physical network card of the current computing node through an analysis tool for capturing the network data packet.
Further, if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, the HA Monitor component determines that the physical network card HAs a link failure, and further, if the communication port in the physical network card receives the flow packet within the first preset duration threshold, the HA Monitor component determines that the physical network card does not have a link failure.
Further, if the service network card HAs a link failure, the HA Monitor component determines that the current computing node HAs a failure, and closes the virtual machine on the failed computing node, and further, if it is determined that the management network card or the storage network card of the current computing node HAs a link failure, the HA Monitor component clears the configuration information of the virtual network card in the virtual machine on the failed computing node.
Further, the HAMonitor component forces a nova-computer service of the failed computing node to be placed in a maintenance mode for switching the failed computing node from a normal operation state to a maintenance state, and further, the HAMonitor component evacuates a virtual machine on the failed computing node to a target computing node to enable the virtual machine to normally operate on the target computing node.
Further, after the HAMonitor component evacuates the virtual machine on the failed computing node to the target computing node, the HA Monitor component determines the failed computing node as the computing node to be restored, and performs link detection on the service network card of the computing node to be restored.
Further, if it is determined that the service network card HAs a link failure, the HA Monitor component determines that the computing node to be restored does not restore the normal communication function.
Further, if it is determined that the service network card has no link failure, the HAMonitor component performs state detection of virtual machine migration tasks on the computing node to be restored, and further, if it is determined that the computing node to be restored has no unfinished virtual machine migration tasks, the HAMonitor component determines that the computing node to be restored restores normal communication functions, and obtains the computing node to be restored to normal.
Further, the HAMonitor component shuts down the virtual machines that are evacuated to the target computing node, and migrates the shut down virtual machines from the target computing node to the recovery computing node.
Further, the HAMonitor component restarts the virtual machine after the migration is completed, and cancels the forced maintenance mode of the nova-computer service to continue to provide the service to the outside.
Further, the invention also provides a virtual machine management device.
Referring to fig. 3, fig. 3 is a schematic functional block diagram of a virtual machine management device according to an embodiment of the present invention.
The virtual machine management device includes:
the monitoring module 310 is configured to perform link failure monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
a closing module 320, configured to close the virtual machine on the current computing node if the service network card has a link failure;
and the evacuation module 330 is configured to start the virtual machine after evacuating the virtual machine to the target computing node.
The virtual machine management device provided by the embodiment of the invention monitors the link fault of the physical network card of the current computing node; when the link fault of the service network card in the physical network card is monitored, the virtual machine on the current computing node can be timely closed, and the virtual machine is evacuated to the target computing node and then restarted, so that the situation that the virtual machines with the same name and running state are remained on the failed node and the evacuated current computing node at the same time is avoided, the problem of brain crack of the virtual machine is avoided, and the usability of the virtual machine can be improved.
In one embodiment, the monitoring module 310 is further configured to:
monitoring the flow of a communication port in a physical network card of a current computing node;
if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, determining that the physical network card has a link fault.
In one embodiment, the virtual machine management apparatus is further configured to:
and if the management network card or the storage network card has a link fault, clearing the configuration information of the virtual network card in the virtual machine.
In one embodiment, the virtual machine management apparatus is further configured to:
acquiring load index information of other computing nodes except the current computing node;
comparing each load index information with a preset load index threshold value;
determining other computing nodes with load index information smaller than or equal to the preset load index threshold value as intermediate computing nodes;
and determining the computing node with the smallest numerical value of the load index information in the intermediate computing nodes as a target computing node.
In one embodiment, the virtual machine management apparatus is further configured to:
carrying out link monitoring on the service network card;
if the service network card has no link fault, detecting the state of the virtual machine migration task of the current computing node;
if the current computing node does not have the unfinished virtual machine migration task, the virtual machine is migrated from the target computing node to the current computing node after being closed, and the virtual machine after the migration is completed is started.
In one embodiment, the virtual machine management apparatus is further configured to:
monitoring the flow of the communication port of the service network card;
if the number of times that the communication port of the service network card receives the flow packet within the second preset time threshold is greater than or equal to the preset number of times, determining that the service network card has no link fault; the second preset duration threshold is a preset multiple of the first preset duration threshold; the value of the preset times is larger than or equal to the value of the preset multiple.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 410, communication interface (Communication Interface) 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other via communication bus 440. The processor 410 may call a computer program in the memory 430 to perform the steps of a virtual machine management method, including, for example:
carrying out link fault monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
if the service network card has a link fault, closing the virtual machine on the current computing node;
and after the virtual machine is evacuated to the target computing node, starting the virtual machine.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a medium, where the medium is a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program is configured to cause a processor to execute the steps of the method provided in the foregoing embodiments, where the method includes:
carrying out link fault monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
if the service network card has a link fault, closing the virtual machine on the current computing node;
and after the virtual machine is evacuated to the target computing node, starting the virtual machine.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CD, DVD, BD, HVD, etc.), and semiconductor memory (e.g., ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid State Disk (SSD)), etc.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A virtual machine management method, characterized by being applied to a high availability monitoring component for managing at least one computing node in a created high availability cluster; the virtual machine management method comprises the following steps:
carrying out link fault monitoring on a physical network card of a current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
if the service network card has a link fault, closing the virtual machine on the current computing node;
and after the virtual machine is evacuated to the target computing node, starting the virtual machine.
2. The virtual machine management method of claim 1, wherein the target computing node is determined by:
acquiring load index information of other computing nodes except the current computing node;
comparing each load index information with a preset load index threshold value;
determining other computing nodes with load index information smaller than or equal to the preset load index threshold value as intermediate computing nodes;
and determining the computing node with the smallest numerical value of the load index information in the intermediate computing nodes as a target computing node.
3. The virtual machine management method of claim 1, wherein the physical network card further comprises a management network card and a storage network card; the management network card is a network card for managing the current computing node; the storage network card is a network interface used for data transmission and access between the current computing node and a storage node, and the storage node is used for storing and providing data.
4. The virtual machine management method of claim 3, further comprising, after shutting down the virtual machine on the current computing node:
and if the management network card or the storage network card has a link fault, clearing the configuration information of the virtual network card in the virtual machine.
5. The method of claim 1, wherein the link failure monitoring of the physical network card of the current computing node comprises:
monitoring the flow of a communication port in a physical network card of a current computing node;
if the communication port in the physical network card does not receive the flow packet within the first preset duration threshold, determining that the physical network card has a link fault.
6. The virtual machine management method of claim 1, further comprising, after evacuating the virtual machine to a target computing node:
carrying out link monitoring on the service network card;
if the service network card has no link fault, detecting the state of the virtual machine migration task of the current computing node;
if the current computing node does not have the unfinished virtual machine migration task, the virtual machine is migrated from the target computing node to the current computing node after being closed, and the virtual machine after the migration is completed is started.
7. The virtual machine management method of claim 6, wherein the link monitoring of the service network card comprises:
monitoring the flow of the communication port of the service network card;
if the number of times that the communication port of the service network card receives the flow packet within the second preset time threshold is greater than or equal to the preset number of times, determining that the service network card has no link fault; the second preset duration threshold is a preset multiple of the first preset duration threshold; the value of the preset times is larger than or equal to the value of the preset multiple.
8. A virtual machine management apparatus, comprising:
the monitoring module is used for monitoring the link fault of the physical network card of the current computing node; the physical network card comprises a business network card; the service network card is a network interface for processing communication and data transmission between the current computing node and an external network;
the closing module is used for closing the virtual machine on the current computing node if the service network card has a link fault;
and the evacuation module is used for starting the virtual machine after evacuating the virtual machine to the target computing node.
9. An electronic device comprising a processor and a memory storing a computer program, wherein the processor implements the virtual machine management method of any of claims 1 to 7 when executing the computer program.
10. A storage medium, which is a computer readable storage medium comprising a computer program, characterized in that the computer program, when executed by a processor, implements the virtual machine management method of any of claims 1 to 7.
CN202311166742.7A 2023-09-11 2023-09-11 Virtual machine management method and device, electronic equipment and storage medium Pending CN117215722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311166742.7A CN117215722A (en) 2023-09-11 2023-09-11 Virtual machine management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311166742.7A CN117215722A (en) 2023-09-11 2023-09-11 Virtual machine management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117215722A true CN117215722A (en) 2023-12-12

Family

ID=89047404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311166742.7A Pending CN117215722A (en) 2023-09-11 2023-09-11 Virtual machine management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117215722A (en)

Similar Documents

Publication Publication Date Title
US10114713B1 (en) Systems and methods for preventing split-brain scenarios in high-availability clusters
CN107179957B (en) Physical machine fault classification processing method and device and virtual machine recovery method and system
US10387241B2 (en) Cognitive analysis for healing an IT system
US10606674B1 (en) Systems and methods for prognostic network management
US9720763B2 (en) Proactive cloud orchestration
US20180212819A1 (en) Troubleshooting Method and Apparatus
US11165690B2 (en) Request routing based on server software versions
CN109286529B (en) Method and system for recovering RabbitMQ network partition
US20050262411A1 (en) Migration method for software application in a multi-computing architecture, method for carrying out functional continuity implementing said migration method and multi-computing system provided therewith
CN107508694B (en) Node management method and node equipment in cluster
US10120779B1 (en) Debugging of hosted computer programs
CN111935244B (en) Service request processing system and super-integration all-in-one machine
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
EP3680780B1 (en) Cluster system, control method, and corresponding computer program
US10884878B2 (en) Managing a pool of virtual functions
CN109617716B (en) Data center exception handling method and device
CN117215722A (en) Virtual machine management method and device, electronic equipment and storage medium
US11294761B1 (en) Apparatus, system, and method for correcting slow field-replaceable units in network devices
CN113596195B (en) Public IP address management method, device, main node and storage medium
CN112131201B (en) Method, system, equipment and medium for high availability of network additional storage
CN116248484B (en) Management method and device of cloud primary integrated machine, electronic equipment and storage medium
CN111258845A (en) Detection of event storms
US11249902B1 (en) Apparatus, system, and method for detecting and remedying memory buffer leaks in network devices
CN116506327B (en) Physical node monitoring method, device, computer equipment and storage medium
CN116155691A (en) Data processing method and device

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