CN117041213A - IP exception handling method, device, equipment and medium - Google Patents
IP exception handling method, device, equipment and medium Download PDFInfo
- Publication number
- CN117041213A CN117041213A CN202311014298.7A CN202311014298A CN117041213A CN 117041213 A CN117041213 A CN 117041213A CN 202311014298 A CN202311014298 A CN 202311014298A CN 117041213 A CN117041213 A CN 117041213A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- target
- configuration information
- abnormal
- target virtual
- 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 44
- 230000008859 change Effects 0.000 claims abstract description 83
- 230000002159 abnormal effect Effects 0.000 claims abstract description 74
- 238000012216 screening Methods 0.000 claims abstract description 24
- 238000012544 monitoring process Methods 0.000 claims abstract description 23
- 238000012545 processing Methods 0.000 claims abstract description 21
- 238000012986 modification Methods 0.000 claims description 38
- 230000004048 modification Effects 0.000 claims description 38
- 238000004590 computer program Methods 0.000 claims description 16
- 230000002093 peripheral effect Effects 0.000 claims description 15
- 238000001514 detection method Methods 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 10
- 230000008569 process Effects 0.000 description 7
- 238000012217 deletion Methods 0.000 description 4
- 230000037430 deletion Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000002708 enhancing effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5076—Update or notification mechanisms, e.g. DynDNS
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-2 addresses, e.g. medium access control [MAC] addresses
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a method, a device, equipment and a medium for processing IP exception, which relate to the technical field of computers and comprise the steps of detecting the state of a virtual machine enhancement tool, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in a target virtual machine into a local database; monitoring whether a device change event occurs in the current target virtual machine, and detecting whether the device address information in the current network card is changed when the device change event occurs; if the change occurs, detecting the IP state of all the current network cards; if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP, and reconfiguring the abnormal IP by utilizing a virtual machine enhancement tool based on the target IP configuration information, so that the problem of IP configuration loss caused by address change is avoided, IP real-time configuration and abnormal processing are realized, and the stability of a virtualization platform is enhanced.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for processing IP exceptions.
Background
Unlike traditional physical machines, many hardware such as CPU (Central Processing Unit ), memory, network card, GPU (Graphics Processing Unit, graphics processor) and the like can be configured by user, so that the hardware configuration is not the same when the virtual machine is started up each time, and some problems which cannot be encountered on the physical machine can occur. In the process of adding hardware, each hardware is allocated with a corresponding PCI device address, and under a physical environment, the PCI device sockets are limited and the expansibility is not high, so that the corresponding device addresses are relatively fixed; however, in a virtualized environment, a virtual machine may support 32, 64 or even 128 PCI (Peripheral Component Interconnect, peripheral component interconnect standard) devices, but as more and more PCI devices are allocated to the virtual machine, the probability that the device address corresponding to the PCI device of the original virtual machine will be changed will be greater. When the address of the original PCI device is changed, particularly the network card, the operating system of the virtual machine can consider that the original network card is pulled out and a new network card is inserted, so that the original network configuration can be lost, and a series of problems are caused. Based on the existing virtualization function, an IP/MAC binding function can be used, so that the network card directly binds an IP (Internet Protocol Address ) and a MAC address (Media Access Control Address, physical address/hardware address), but manual configuration is required and modification is complicated.
From the above, how to automatically identify the virtual machine network card device, avoid the problem of losing the IP configuration caused by address variation, implement real-time configuration and exception handling of the IP, and enhance the stability of the virtualization platform is a problem to be solved in the field.
Disclosure of Invention
In view of the above, the present application aims to provide a method, apparatus, device and medium for processing IP anomalies, which can automatically identify a virtual machine network card device, avoid the problem of losing IP configuration caused by address variation, implement real-time configuration and anomaly processing of IP, and enhance the stability of a virtualization platform. The specific scheme is as follows:
in a first aspect, the present application discloses an IP exception handling method, applied to a virtualized platform, including:
detecting the state of a virtual machine enhancement tool in a target virtual machine, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in the target virtual machine into a local database; monitoring whether a device change event occurs in the target virtual machine currently,
when the device change event of the current target virtual machine is monitored, detecting whether the device address information in the current network card is changed or not; the equipment change event is a change event of equipment based on the peripheral component interconnect standard;
if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present;
and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information.
Optionally, before detecting the state of the virtual machine enhancement tool in the target virtual machine, the method further includes:
installing a virtual machine enhancement tool in the target virtual machine so as to establish a communication connection between the local and an operating system of the target virtual machine by using the virtual machine enhancement tool.
Optionally, the monitoring whether the current target virtual machine generates a device change event includes:
and monitoring whether a device adding event and/or a device deleting event occurs in the target virtual machine currently.
Optionally, after storing the IP configuration information of all network cards in the target virtual machine in the local database, the method further includes:
triggering IP modification operation aiming at the network card in the target virtual machine to modify the IP needing to be changed in the target virtual machine;
the IP of the network card in the target virtual machine is monitored in real time to determine whether the IP of the network card in the target virtual machine is changed or not;
if the IP of any network card in the target virtual machine is changed, triggering a database updating operation to correspondingly update the IP configuration information in the local database according to the IP changing result of the any network card so as to obtain the updated local database;
wherein the IP modification operation includes: modifying the IP needing to be changed in the target virtual machine through the virtualization platform; or, modifying the IP which needs to be changed in the target virtual machine through the target virtual machine;
correspondingly, the database updating operation comprises the following steps: if the IP modification operation is modification performed by the virtualization platform, the IP configuration information in the local database is updated correspondingly directly according to the IP modification result of the arbitrary network card; and if the IP modification operation is modification performed by the target virtual machine, acquiring an IP modification result of the arbitrary network card sent by the target virtual machine through the virtual machine enhancement tool, and correspondingly updating the IP configuration information in the local database by utilizing the received IP update result.
Optionally, detecting the IP states of all the current network cards, and if detecting that the current existing state is an unavailable abnormal IP, screening target IP configuration information corresponding to the abnormal IP from the local database, where the screening includes:
detecting the IP states of all network cards currently by executing a preset ping command;
if the ping command is not successfully executed, judging that the current existing state is an unavailable abnormal IP, and screening out target IP configuration information corresponding to the abnormal IP from the local database.
Optionally, the screening the target IP configuration information corresponding to the abnormal IP from the local database, and using the virtual machine enhancement tool to reconfigure the abnormal IP based on the target IP configuration information includes:
determining a network card name and a serial number corresponding to the abnormal IP, and screening target IP configuration information corresponding to the abnormal IP from the local database according to the network card name and the serial number;
and generating an IP reconfiguration command and sending the IP reconfiguration command to the virtual machine enhancement tool so that the virtual machine enhancement tool reconfigures the abnormal IP based on the target IP configuration information after acquiring the IP reconfiguration command.
Optionally, after the reconfiguring the abnormal IP using the virtual machine enhancement tool and based on the target IP configuration information, the method further includes:
acquiring configuration completion information sent by the virtual machine enhancement tool, and carrying out state detection on the IP after configuration completion again;
and if the IP after the configuration is detected to be in the available state, sending prompt information for representing that the IP reconfiguration is successful to the client.
In a second aspect, the present application discloses an IP exception handling apparatus, including:
the IP configuration information storage module is used for detecting the state of a virtual machine enhancement tool in the target virtual machine, and if the virtual machine enhancement tool is in a state of being started, the IP configuration information of all network cards in the target virtual machine is stored in the local database;
the equipment change event monitoring module is used for monitoring whether equipment change events occur in the target virtual machine at present; the equipment change event is a change event of equipment based on the peripheral component interconnect standard;
the information change detection module is used for detecting whether the equipment address information in the network card is changed or not when the equipment change event of the current target virtual machine is monitored;
the IP state detection module is used for detecting the IP states of all the network cards when detecting that the equipment address information in the network cards is changed;
and the abnormal IP reconfiguration module is used for screening out target IP configuration information corresponding to the abnormal IP from the local database when detecting that the current existing state is the unavailable abnormal IP, and utilizing the virtual machine enhancement tool to reconfigure the abnormal IP based on the target IP configuration information.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the IP exception handling method.
In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the previously disclosed IP exception handling method.
It can be seen that the present application provides an IP exception handling method, including detecting a state of a virtual machine enhancement tool in a target virtual machine, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in the target virtual machine to a local database; monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the equipment change event is a change event of equipment based on the peripheral component interconnect standard; if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present; and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information. According to the application, through the mutual matching of the virtualization platform and the virtual machine enhancement tool, aiming at the address change scene of the network card of the virtual machine target equipment, the virtual network card configuration is automatically stored, whether the address of the network card of the virtual machine target equipment in an offline state is changed or not is monitored, and after the target virtual machine is started, the IP corresponding to the original network card is automatically reconfigured, so that the problem of IP configuration loss caused by address change is avoided, the real-time configuration and abnormal processing of the IP are realized, and the stability of the virtualization platform is enhanced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an IP exception handling method disclosed in the present application;
FIG. 2 is a flow chart of another method for handling IP exceptions in accordance with the present disclosure;
FIG. 3 is a schematic diagram of an IP exception handling apparatus according to the present disclosure;
fig. 4 is a block diagram of an electronic device according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Unlike traditional physical machines, many hardware such as CPU (Central Processing Unit ), memory, network card, GPU (Graphics Processing Unit, graphics processor) and the like can be configured by user, so that the hardware configuration is not the same when the virtual machine is started up each time, and some problems which cannot be encountered on the physical machine can occur. In the process of adding hardware, each hardware is allocated with a corresponding PCI device address, and under a physical environment, the PCI device sockets are limited and the expansibility is not high, so that the corresponding device addresses are relatively fixed; however, in a virtualized environment, a virtual machine may support 32, 64 or even 128 PCI (Peripheral Component Interconnect, peripheral component interconnect standard) devices, but as more and more PCI devices are allocated to the virtual machine, the probability that the device address corresponding to the PCI device of the original virtual machine will be changed will be greater. When the address of the original PCI device is changed, particularly the network card, the operating system of the virtual machine can consider that the original network card is pulled out and a new network card is inserted, so that the original network configuration can be lost, and a series of problems are caused. Based on the existing virtualization function, an IP/MAC binding function can be used, so that the network card directly binds an IP (Internet Protocol Address ) and a MAC address (Media Access Control Address, physical address/hardware address), but manual configuration is required and modification is complicated. From the above, how to automatically identify the virtual machine network card device, avoid the problem of losing the IP configuration caused by address variation, implement real-time configuration and exception handling of the IP, and enhance the stability of the virtualization platform is a problem to be solved in the field.
Referring to fig. 1, the embodiment of the application discloses an IP exception handling method, which is applied to a virtualization platform and specifically may include:
step S11: detecting the state of a virtual machine enhancement tool in a target virtual machine, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in the target virtual machine into a local database.
In this embodiment, before detecting the state of the virtual machine enhancement tool in the target virtual machine, the method further includes: installing a virtual machine enhancement tool in the target virtual machine so as to establish a communication connection between the local and an operating system of the target virtual machine by using the virtual machine enhancement tool. Specifically, after vmtools (i.e. virtual machine enhancement tools) are installed in the virtual machine, detecting the state of the vmtools, if the vmtools are in a state of being started, recording the IP configuration information of all network cards installed on the target device at the moment, and storing the IP configuration information in a local database.
Step S12: monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the device change event is a change event of a device based on a peripheral component interconnect standard.
In this embodiment, after storing the IP configuration information of all the network cards in the target virtual machine in the local database, the method further includes: triggering IP modification operation aiming at the network card in the target virtual machine to modify the IP needing to be changed in the target virtual machine; the IP of the network card in the target virtual machine is monitored in real time to determine whether the IP of the network card in the target virtual machine is changed or not; if the IP of any network card in the target virtual machine is changed, triggering a database updating operation to correspondingly update the IP configuration information in the local database according to the IP changing result of the any network card so as to obtain the updated local database; wherein the IP modification operation includes: modifying the IP needing to be changed in the target virtual machine through the virtualization platform; or, modifying the IP which needs to be changed in the target virtual machine through the target virtual machine; correspondingly, the database updating operation comprises the following steps: if the IP modification operation is modification performed by the virtualization platform, the IP configuration information in the local database is updated correspondingly directly according to the IP modification result of the arbitrary network card; and if the IP modification operation is modification performed by the target virtual machine, acquiring an IP modification result of the arbitrary network card sent by the target virtual machine through the virtual machine enhancement tool, and correspondingly updating the IP configuration information in the local database by utilizing the received IP update result. That is, after the IP configuration information of all the network cards in the target virtual machine is saved in the local database, if the modification operation is triggered to the IP to be changed in the target virtual machine through the virtualization platform for the network cards in the target virtual machine, the IP to be changed in the target virtual machine is modified, and the IP configuration information in the local database is updated accordingly according to the IP change result of any network card; if the IP to be changed in the target virtual machine is triggered by the target virtual machine, acquiring an IP changing result of any network card sent by the target virtual machine through the virtual machine enhancing tool, and correspondingly updating the IP configuration information in the local database by utilizing the received IP updating result. If the IP modification operation is modification performed by the virtualization platform, the IP configuration information in the local database is correspondingly updated; if the IP modification operation is the modification performed by the target virtual machine, the IP update result sent by the target virtual machine is sent to the virtualization platform again by utilizing vmtools, and the virtualization platform correspondingly updates the IP configuration information in the local database according to the IP update result.
Step S13: if the change of the equipment address information in the network card is detected, detecting the IP state of all the network cards currently.
Step S14: and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information.
In this embodiment, after the abnormal IP is reconfigured by using the virtual machine enhancement tool and based on the target IP configuration information, the method further includes: acquiring configuration completion information sent by the virtual machine enhancement tool, and carrying out state detection on the IP after configuration completion again; and if the IP after the configuration is detected to be in the available state, sending prompt information for representing that the IP reconfiguration is successful to the client. Specifically, after reconfiguration is completed, vmtools sends configuration completion information to the virtualization platform, at this time, the virtualization platform detects the state of the IP again, if the configured IP is in an available state, a prompt message of successful IP reconfiguration is sent to the client, so as to remind the user that the network configuration is restored due to address change of the network card PCI device.
In this embodiment, the state of a virtual machine enhancement tool in a target virtual machine is detected, and if the virtual machine enhancement tool is in a state of being started, the IP configuration information of all network cards in the target virtual machine is saved to a local database; monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the equipment change event is a change event of equipment based on the peripheral component interconnect standard; if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present; and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information. According to the application, through the mutual matching of the virtualization platform and the virtual machine enhancement tool, aiming at the address change scene of the network card of the virtual machine target equipment, the virtual network card configuration is automatically stored, whether the address of the network card of the virtual machine target equipment in an offline state is changed or not is monitored, and after the target virtual machine is started, the IP corresponding to the original network card is automatically reconfigured, so that the problem of IP configuration loss caused by address change is avoided, the real-time configuration and abnormal processing of the IP are realized, and the stability of the virtualization platform is enhanced.
Referring to fig. 2, the embodiment of the application discloses an IP exception handling method, which is applied to a virtualization platform and specifically may include:
step S21: detecting the state of a virtual machine enhancement tool in a target virtual machine, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in the target virtual machine into a local database.
Step S22: monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the device change event is a change event of a device based on a peripheral component interconnect standard.
In this embodiment, whether a device addition event and/or a device deletion event occurs in the current target virtual machine is monitored, and when it is monitored that a device addition event and/or a device deletion event occurs in the current target virtual machine, for example, updating of a PCI device occurs, for example, when a device addition event and/or a device deletion event such as adding, deleting a network card, a disk, a GPU, etc., is detected whether a change occurs in device address information in the current network card.
Step S23: if the change of the equipment address information in the network card is detected, the IP state of all the network cards is detected by executing a preset ping command.
Step S24: if the ping command is not successfully executed, judging that the current existing state is an unavailable abnormal IP, determining a network card name and a serial number corresponding to the abnormal IP, and screening target IP configuration information corresponding to the abnormal IP from the local database according to the network card name and the serial number.
S25: and generating an IP reconfiguration command and sending the IP reconfiguration command to the virtual machine enhancement tool so that the virtual machine enhancement tool reconfigures the abnormal IP based on the target IP configuration information after acquiring the IP reconfiguration command.
In this embodiment, a preset ping command is executed to detect the IP states of all the network cards, and if the ping command is executed successfully, it is indicated that the change of the network card device address does not cause the problem of IP loss; if the ping command is not successfully executed, network configuration (i.e. reconfiguration process) of the network card losing the IP is started to be recovered.
The specific reconfiguration process is as follows: the network card name and the serial number corresponding to the abnormal IP are determined, then the virtualization platform screens out target IP configuration information corresponding to the abnormal IP from a local database through the network card name and the serial number, then an IP reconfiguration command is sent to vmtools, and after receiving an instruction, the vmtools reconfigure the abnormal IP based on the target IP configuration information.
The application provides an automatic processing scheme aiming at the scene of IP loss caused by PCI address change of the virtual machine network card, and can ensure first time perception and automatic configuration recovery after the occurrence of problems through the mutual matching of vmtools and the virtualization platform, thereby enhancing the stability of the virtualization platform. The key points of the application are as follows: through the mutual matching of the virtualization platform and the vmtools, aiming at PCI device address variation scenes of the virtual machine network card, virtual network card configuration is automatically stored, whether the PCI device address of the virtual machine network card in an offline state is changed or not is monitored, and after the virtual machine is started, network configuration corresponding to the original network card is automatically recovered, so that the problem that internal application of the virtual machine cannot run due to IP loss is avoided.
In this embodiment, the state of a virtual machine enhancement tool in a target virtual machine is detected, and if the virtual machine enhancement tool is in a state of being started, the IP configuration information of all network cards in the target virtual machine is saved to a local database; monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the equipment change event is a change event of equipment based on the peripheral component interconnect standard; if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present; and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information. According to the application, through the mutual matching of the virtualization platform and the virtual machine enhancement tool, aiming at the address change scene of the network card of the virtual machine target equipment, the virtual network card configuration is automatically stored, whether the address of the network card of the virtual machine target equipment in an offline state is changed or not is monitored, and after the target virtual machine is started, the IP corresponding to the original network card is automatically reconfigured, so that the problem of IP configuration loss caused by address change is avoided, the real-time configuration and abnormal processing of the IP are realized, and the stability of the virtualization platform is enhanced.
Referring to fig. 3, an embodiment of the present application discloses an IP exception handling apparatus, which may specifically include:
the IP configuration information storage module 11 is configured to detect a state of a virtual machine enhancement tool in the target virtual machine, and if the virtual machine enhancement tool is in a state of being started, store IP configuration information of all network cards in the target virtual machine to a local database;
a device change event monitoring module 12, configured to monitor whether a device change event occurs in the target virtual machine; the equipment change event is a change event of equipment based on the peripheral component interconnect standard;
the information change detection module 13 is configured to detect whether device address information in the network card is changed when the device change event of the current target virtual machine is detected;
the IP state detection module 14 is configured to detect an IP state of all the current network cards when detecting that the device address information in the network cards is changed;
and the abnormal IP reconfiguration module 15 is used for screening out target IP configuration information corresponding to the abnormal IP from the local database when detecting that the current existing state is the unavailable abnormal IP, and utilizing the virtual machine enhancement tool to reconfigure the abnormal IP based on the target IP configuration information.
In this embodiment, the state of a virtual machine enhancement tool in a target virtual machine is detected, and if the virtual machine enhancement tool is in a state of being started, the IP configuration information of all network cards in the target virtual machine is saved to a local database; monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the equipment change event is a change event of equipment based on the peripheral component interconnect standard; if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present; and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information. According to the application, through the mutual matching of the virtualization platform and the virtual machine enhancement tool, aiming at the address change scene of the network card of the virtual machine target equipment, the virtual network card configuration is automatically stored, whether the address of the network card of the virtual machine target equipment in an offline state is changed or not is monitored, and after the target virtual machine is started, the IP corresponding to the original network card is automatically reconfigured, so that the problem of IP configuration loss caused by address change is avoided, the real-time configuration and abnormal processing of the IP are realized, and the stability of the virtualization platform is enhanced.
In some specific embodiments, the IP configuration information storage module 11 may specifically include:
and the communication connection establishment module is used for installing a virtual machine enhancement tool in the target virtual machine so as to establish communication connection between the local and an operating system of the target virtual machine by using the virtual machine enhancement tool.
In some embodiments, the device change event monitoring module 12 may specifically include:
and the equipment change event monitoring module is used for monitoring whether equipment addition events and/or equipment deletion events occur in the target virtual machine at present.
In some specific embodiments, the IP configuration information storage module 11 may specifically include:
the change IP modification module is used for triggering the IP modification operation aiming at the network card in the target virtual machine so as to modify the IP needing to be changed in the target virtual machine;
the IP real-time monitoring module is used for monitoring the IP of the network card in the target virtual machine in real time so as to determine whether the IP of the network card in the target virtual machine is changed or not;
the IP configuration information updating module is used for triggering database updating operation if the IP of any network card in the target virtual machine is changed, so as to correspondingly update the IP configuration information in the local database according to the IP change result of the any network card, and obtain the updated local database;
the IP modification module is used for modifying the IP which needs to be changed in the target virtual machine through the virtualization platform; or, modifying the IP which needs to be changed in the target virtual machine through the target virtual machine;
the database updating module is used for updating the IP configuration information in the local database correspondingly directly according to the IP change result of the arbitrary network card if the IP change operation is the modification performed by the virtualization platform; and if the IP modification operation is modification performed by the target virtual machine, acquiring an IP modification result of the arbitrary network card sent by the target virtual machine through the virtual machine enhancement tool, and correspondingly updating the IP configuration information in the local database by utilizing the received IP update result.
In some specific embodiments, the IP status detection module 14 may specifically include:
and the IP state detection module is used for detecting the IP states of all the network cards currently by executing a preset ping command.
In some specific embodiments, the abnormal IP reconfiguration module 15 may specifically include:
and the target IP configuration information screening module is used for judging that the current existing state is the unavailable abnormal IP if the ping command is not successfully executed, and screening target IP configuration information corresponding to the abnormal IP from the local database.
In some specific embodiments, the abnormal IP reconfiguration module 15 may specifically include:
the target IP configuration information screening module is used for determining the network card name and the serial number corresponding to the abnormal IP, and screening target IP configuration information corresponding to the abnormal IP from the local database according to the network card name and the serial number;
and the reconfiguration module is used for generating an IP reconfiguration command and sending the IP reconfiguration command to the virtual machine enhancement tool so that the virtual machine enhancement tool reconfigures the abnormal IP based on the target IP configuration information after acquiring the IP reconfiguration command.
In some specific embodiments, the abnormal IP reconfiguration module 15 may specifically include:
the state detection module is used for acquiring configuration completion information sent by the virtual machine enhancement tool and carrying out state detection on the IP after configuration completion again;
and the prompt information sending module is used for sending prompt information for representing successful IP reconfiguration to the client if the IP after the configuration is detected to be in the available state.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement relevant steps in the IP exception handling method performed by the electronic device as disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the data 223 in the memory 22 by the processor 21, which may be Windows, unix, linux or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the IP exception handling method performed by the electronic device 20 as disclosed in any of the foregoing embodiments. The data 223 may include data received by the IP exception processing apparatus and transmitted from an external apparatus, data acquired by the own input/output interface 25, and the like.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Further, the embodiment of the application also discloses a computer readable storage medium, wherein the storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the steps of the method for processing the IP exception disclosed in any embodiment are realized.
Finally, it is further noted that 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above detailed description of the method, the device, the equipment and the storage medium for processing the IP exception provided by the present application applies specific examples to illustrate the principles and the implementation of the present application, and the above description of the examples is only used to help understand the method and the core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (10)
1. The IP exception handling method is characterized by being applied to a virtualization platform and comprising the following steps of:
detecting the state of a virtual machine enhancement tool in a target virtual machine, and if the virtual machine enhancement tool is in a state of being started, storing IP configuration information of all network cards in the target virtual machine into a local database;
monitoring whether the current target virtual machine generates a device change event, and detecting whether the device address information in the network card is changed or not when the current target virtual machine generates the device change event; the equipment change event is a change event of equipment based on the peripheral component interconnect standard;
if the change of the equipment address information in the network card is detected, detecting the IP states of all the network cards at present;
and if the abnormal IP with the unavailable current existing state is detected, screening out target IP configuration information corresponding to the abnormal IP from the local database, and reconfiguring the abnormal IP by utilizing the virtual machine enhancement tool based on the target IP configuration information.
2. The method for processing an IP exception according to claim 1, further comprising, before detecting the state of the virtual machine enhancement tool in the target virtual machine:
installing a virtual machine enhancement tool in the target virtual machine so as to establish a communication connection between the local and an operating system of the target virtual machine by using the virtual machine enhancement tool.
3. The method according to claim 1, wherein the monitoring whether the current target virtual machine has a device change event comprises:
and monitoring whether a device adding event and/or a device deleting event occurs in the target virtual machine currently.
4. The method for processing the IP exception according to claim 1, wherein after storing the IP configuration information of all network cards in the target virtual machine in the local database, further comprises:
triggering IP modification operation aiming at the network card in the target virtual machine to modify the IP needing to be changed in the target virtual machine;
the IP of the network card in the target virtual machine is monitored in real time to determine whether the IP of the network card in the target virtual machine is changed or not;
if the IP of any network card in the target virtual machine is changed, triggering a database updating operation to correspondingly update the IP configuration information in the local database according to the IP changing result of the any network card so as to obtain the updated local database;
wherein the IP modification operation includes: modifying the IP needing to be changed in the target virtual machine through the virtualization platform; or, modifying the IP which needs to be changed in the target virtual machine through the target virtual machine;
correspondingly, the database updating operation comprises the following steps: if the IP modification operation is modification performed by the virtualization platform, the IP configuration information in the local database is updated correspondingly directly according to the IP modification result of the arbitrary network card; and if the IP modification operation is modification performed by the target virtual machine, acquiring an IP modification result of the arbitrary network card sent by the target virtual machine through the virtual machine enhancement tool, and correspondingly updating the IP configuration information in the local database by utilizing the received IP update result.
5. The method for processing the IP exception according to claim 1, wherein detecting the IP states of all the current network cards, if detecting that there is an abnormal IP whose current state is unavailable, selecting the target IP configuration information corresponding to the abnormal IP from the local database, includes:
detecting the IP states of all network cards currently by executing a preset ping command;
if the ping command is not successfully executed, judging that the current existing state is an unavailable abnormal IP, and screening out target IP configuration information corresponding to the abnormal IP from the local database.
6. The IP exception handling method of claim 1, wherein said screening out target IP configuration information corresponding to said exception IP from said local database and reconfiguring said exception IP using said virtual machine enhancement tool and based on said target IP configuration information comprises:
determining a network card name and a serial number corresponding to the abnormal IP, and screening target IP configuration information corresponding to the abnormal IP from the local database according to the network card name and the serial number;
and generating an IP reconfiguration command and sending the IP reconfiguration command to the virtual machine enhancement tool so that the virtual machine enhancement tool reconfigures the abnormal IP based on the target IP configuration information after acquiring the IP reconfiguration command.
7. The IP exception handling method according to any one of claims 1 to 6, wherein after said reconfiguring the exception IP using the virtual machine enhancement tool and based on the target IP configuration information, further comprising:
acquiring configuration completion information sent by the virtual machine enhancement tool, and carrying out state detection on the IP after configuration completion again;
and if the IP after the configuration is detected to be in the available state, sending prompt information for representing that the IP reconfiguration is successful to the client.
8. An IP exception handling apparatus, comprising:
the IP configuration information storage module is used for detecting the state of a virtual machine enhancement tool in the target virtual machine, and if the virtual machine enhancement tool is in a state of being started, the IP configuration information of all network cards in the target virtual machine is stored in the local database;
the equipment change event monitoring module is used for monitoring whether equipment change events occur in the target virtual machine at present; the equipment change event is a change event of equipment based on the peripheral component interconnect standard;
the information change detection module is used for detecting whether the equipment address information in the network card is changed or not when the equipment change event of the current target virtual machine is monitored;
the IP state detection module is used for detecting the IP states of all the network cards when detecting that the equipment address information in the network cards is changed;
and the abnormal IP reconfiguration module is used for screening out target IP configuration information corresponding to the abnormal IP from the local database when detecting that the current existing state is the unavailable abnormal IP, and utilizing the virtual machine enhancement tool to reconfigure the abnormal IP based on the target IP configuration information.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the IP exception handling method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the IP exception handling method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311014298.7A CN117041213A (en) | 2023-08-11 | 2023-08-11 | IP exception handling method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311014298.7A CN117041213A (en) | 2023-08-11 | 2023-08-11 | IP exception handling method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117041213A true CN117041213A (en) | 2023-11-10 |
Family
ID=88625853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311014298.7A Pending CN117041213A (en) | 2023-08-11 | 2023-08-11 | IP exception handling method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117041213A (en) |
-
2023
- 2023-08-11 CN CN202311014298.7A patent/CN117041213A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2871553A1 (en) | Systems and methods for protecting virtualized assets | |
CN106528143A (en) | Configuration management method and device | |
CN108628716B (en) | Information receiving and managing system, method and device | |
CN111225064A (en) | Ceph cluster deployment method, system, device and computer-readable storage medium | |
CN112769652B (en) | Node service monitoring method, device, equipment and medium | |
CN110928554A (en) | Deployment method, device, equipment and storage medium | |
CN110780918B (en) | Middleware container processing method and device, electronic equipment and storage medium | |
CN111176577A (en) | Distributed block storage service command processing method, device, equipment and medium | |
CN112104576B (en) | Resident flow table storage and calibration method of SDN switch | |
CN106911508B (en) | DNS configuration recovery method and device | |
US11431795B2 (en) | Method, apparatus and storage medium for resource configuration | |
CN114201458B (en) | Information updating method, micro-service system and computer readable storage medium | |
CN117041213A (en) | IP exception handling method, device, equipment and medium | |
CN114697191A (en) | Resource migration method, device, equipment and storage medium | |
CN111061537A (en) | Method, system and device for updating Tools of virtual machine and readable storage medium | |
CN116016209A (en) | Network automation method and device | |
CN114328026B (en) | Virtual disk backup method, device, equipment and medium | |
CN113312148B (en) | Big data service deployment method, device, equipment and medium | |
CN112104513B (en) | Visual software load method, device, equipment and storage medium | |
CN114817134A (en) | Snapshot task monitoring method, device, equipment and medium | |
CN114706772A (en) | Installation environment detection method, device, equipment and storage medium | |
CN109101253B (en) | Management method and device for host in cloud computing system | |
CN115865667B (en) | Network switching method, device, equipment and storage medium | |
CN114826886B (en) | Disaster recovery method and device for application software and electronic equipment | |
CN116107875A (en) | Software testing method, device, equipment and storage 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 |