Virtual machine migration method, device, equipment and storage medium

By detecting and processing virtual machine network interfaces and IP addresses in migration mode, and generating configuration information, the problem of IP address interruption during virtual machine migration is solved, ensuring the integrity and accuracy of network interfaces and IP addresses, and guaranteeing service continuity.

CN122173196APending Publication Date: 2026-06-09BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411804368.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2026-06-09

Smart Images

  • Figure CN122173196A_ABST
    Figure CN122173196A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a virtual machine migration method and device, equipment and storage medium, and relate to the technical field of virtual machines. The method comprises: if a migration operation of a virtual machine on a current host is detected, determining a current migration mode; processing a first virtual machine network interface according to the current migration mode to obtain a second virtual machine network interface; processing a first virtual IP address according to the current migration mode to obtain a second virtual IP address; obtaining configuration information from a preset database, and creating the second virtual machine network interface and the second virtual IP address on a target host according to the configuration information, so as to complete migration of the virtual machine from the current host to the target host. By using the technical solution, the integrity and accuracy of the migration of the network interface of the virtual machine and the virtual IP address bound thereto can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of virtual machine technology, and in particular to a virtual machine migration method, apparatus, device, and storage medium. Background Technology

[0002] With the development of cloud computing technology, virtual machine migration technology has become an important function in cloud computing platforms.

[0003] Currently, in virtual machine migration scenarios, the deletion and re-creation of virtual machine network interfaces may cause the virtual IP address bound to the virtual machine network interface to be interrupted, affecting service continuity.

[0004] Therefore, there is an urgent need for a virtual machine migration method that can improve the integrity and accuracy of migrating the network interface of the virtual machine and the virtual IP address it is bound to. Summary of the Invention

[0005] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a virtual machine migration method, apparatus, device, and storage medium.

[0006] A first aspect of this disclosure provides a virtual machine migration method, the method comprising:

[0007] If a migration operation for a virtual machine on the current host is detected, the current migration mode is determined; wherein the current migration mode is either a cold migration mode or a hot migration mode.

[0008] Based on the current migration mode, the first virtual machine network interface is processed to obtain the second virtual machine network interface; wherein, the first virtual machine network interface is used to characterize the network interface created on the current host;

[0009] Based on the current migration mode, the first virtual IP address is processed to obtain a second virtual IP address; wherein, the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship;

[0010] The system retrieves configuration information from a preset database and creates the second virtual machine network interface and the second virtual IP address on the target host based on the configuration information, thereby migrating the virtual machine from the current host to the target host.

[0011] In one example, if the current migration mode is a cold migration mode, then processing the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface includes:

[0012] The second association between the first virtual machine network interface and the current host is deleted from the preset database, and the second virtual machine network interface is generated in the preset database.

[0013] In one example, if the current migration mode is a cold migration mode, then processing the first virtual IP address according to the current migration mode to obtain the second virtual IP address includes:

[0014] The first association between the first virtual IP address and the first virtual machine network interface is severed, and the first virtual IP address is determined as the second virtual IP address.

[0015] In one example, after determining the first virtual IP address as the second virtual IP address, the method further includes:

[0016] Establish a third association between the second virtual machine network interface and the target host;

[0017] Establish a fourth association between the second virtual IP address and the second virtual machine network interface;

[0018] Based on the third and fourth association relationships, the configuration information is generated in the preset database.

[0019] In one example, if the current migration mode is a hot migration mode, then processing the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface includes:

[0020] The migration status of the virtual machine is added to the preset database, and the second virtual machine network interface is established in the preset database according to the first virtual machine network interface.

[0021] In one example, if the current migration mode is a hot migration mode, then processing the first virtual IP address according to the current migration mode to obtain the second virtual IP address includes:

[0022] The first virtual IP address is determined as the second virtual IP address.

[0023] In one example, after determining the first virtual IP address as the second virtual IP address, the method further includes:

[0024] Establish a fifth association between the second virtual IP address and the second virtual machine network interface;

[0025] Based on the fifth association, the configuration information is generated in the preset database.

[0026] In one example, after creating the second virtual machine network interface and the second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host, the method further includes:

[0027] Delete the second association between the first virtual machine network interface and the current host from the preset database;

[0028] The first association between the first virtual IP address and the first virtual machine network interface is severed.

[0029] In one example, the method further includes:

[0030] The current configuration information of the virtual machine in the target host is retrieved, and the current configuration information of the virtual machine is compared with the configuration information in the preset database. If they are inconsistent, an error message is sent.

[0031] A second aspect of this disclosure provides a virtual machine migration apparatus, the apparatus comprising:

[0032] The determination module is used to determine the current migration mode if a migration operation triggering a virtual machine on the current host is detected; wherein the current migration mode is either a cold migration mode or a hot migration mode.

[0033] The first processing module is used to process the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface; wherein, the first virtual machine network interface is used to represent the network interface created on the current host.

[0034] The second processing module is used to process the first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; and the first virtual IP address has a first association relationship with the first virtual machine network interface;

[0035] The acquisition module is used to acquire configuration information and, based on the configuration information, create the second virtual machine network interface and the second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0036] A third aspect of this disclosure provides an electronic device comprising: a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method described in the first aspect.

[0037] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the method of the first aspect described above.

[0038] This disclosure provides a virtual machine migration method, apparatus, device, and storage medium. The method includes: if a migration operation of a virtual machine on a current host is detected, determining a current migration mode; wherein the current migration mode is a cold migration mode or a hot migration mode; processing a first virtual machine network interface according to the current migration mode to obtain a second virtual machine network interface; wherein the first virtual machine network interface is used to represent a network interface created on the current host; processing a first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship; obtaining configuration information from a preset database, and creating the second virtual machine network interface and the second virtual IP address on a target host according to the configuration information, to complete the migration of the virtual machine from the current host to the target host. Using this technical solution can improve the completeness and accuracy of migrating the virtual machine's network interface and its bound virtual IP address. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0040] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating a virtual machine migration method provided in an embodiment of this disclosure;

[0042] Figure 2a This is a flowchart illustrating a virtual machine migration method provided in an embodiment of this disclosure;

[0043] Figure 2bThis is a schematic diagram of an architecture under a cold migration mode provided in an embodiment of this disclosure;

[0044] Figure 3a This is a flowchart illustrating a virtual machine migration method provided in an embodiment of this disclosure;

[0045] Figure 3b This is a schematic diagram of an architecture under a hot migration mode provided in an embodiment of this disclosure;

[0046] Figure 4 This is a schematic diagram of the structure of a virtual machine migration device provided in an embodiment of this disclosure;

[0047] Figure 5 This is a schematic diagram of the structure of a virtual machine migration device provided in an embodiment of this disclosure;

[0048] Figure 6 This is a schematic diagram of the structure of a virtual machine migration device provided in an embodiment of this disclosure;

[0049] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0050] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0051] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0052] Figure 1 This is a flowchart illustrating a virtual machine migration method provided in an embodiment of this disclosure. This method can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, tablet computer, laptop computer, desktop computer, or smart TV. Figure 1 As shown, the method provided in this embodiment includes the following steps:

[0053] S101. If a migration operation of a virtual machine on the current host is detected, the current migration mode is determined; wherein the current migration mode is either cold migration mode or hot migration mode.

[0054] In one example, the current host is the physical host to be migrated. The virtual machine migration operation moves the virtual machine from the current host to the target host. The target host is the physical host after the migration.

[0055] In one example, cold migration mode involves migrating the virtual machine while it is powered off. Hot migration mode involves migrating the virtual machine while it is powered on.

[0056] S102. Based on the current migration mode, process the first virtual machine network interface to obtain the second virtual machine network interface; wherein, the first virtual machine network interface is used to represent the network interface created on the current host.

[0057] In one example, the first virtual machine network interface represents the network interface created on the current host. This first virtual machine network interface is the virtual interface used by the virtual machine to communicate with the external network before migration. The second virtual machine network interface is the virtual interface used by the migrated virtual machine to communicate with the external network. Specifically, the way the first virtual machine network interface is handled differs depending on the current migration mode.

[0058] S103. According to the current migration mode, the first virtual IP address is processed to obtain the second virtual IP address; wherein, the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship.

[0059] In one example, the first virtual IP address is used to represent the address of the virtual machine service. The first virtual IP address and the first virtual machine network interface have a first association relationship. Further, for example, if the first virtual machine network interface is VI F1 and the first virtual IP address is VIP1, then VI F1 and VIP1 have a first association relationship.

[0060] In one example, the way the first virtual IP address is handled differs depending on the current migration mode.

[0061] S104. Obtain configuration information from the preset database, and based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0062] In one example, the configuration information indicates how to create a second virtual machine network interface and a second virtual IP address on the target host. In this embodiment, the configuration information in the preset database can be pre-set or generated in real time.

[0063] This disclosure provides a virtual machine migration method, which includes: if a migration operation of a virtual machine on the current host is detected, determining the current migration mode; wherein the current migration mode is a cold migration mode or a hot migration mode; processing a first virtual machine network interface according to the current migration mode to obtain a second virtual machine network interface; wherein the first virtual machine network interface is used to represent a network interface created on the current host; processing a first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of a virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship; obtaining configuration information from a preset database, and creating a second virtual machine network interface and a second virtual IP address on the target host according to the configuration information, so as to complete the migration of the virtual machine from the current host to the target host. Using this technical solution can improve the completeness and accuracy of the migration of the virtual machine's network interface and its bound virtual IP address.

[0064] Figure 2a This illustration shows a flowchart of a virtual machine migration method provided by an embodiment of the present disclosure. The embodiments of the present disclosure are optimized based on the above embodiments, and can be combined with various optional solutions from one or more of the above embodiments.

[0065] like Figure 2a As shown, the virtual machine migration method may include the following steps:

[0066] S201. If a migration operation of a virtual machine on the current host is detected, the current migration mode is determined; wherein the current migration mode is either cold migration mode or hot migration mode.

[0067] In one example, this step can be found in step S101.

[0068] S202. If the current migration mode is cold migration mode, then according to the current migration mode, the first virtual machine network interface is processed to obtain the second virtual machine network interface, including: deleting the second association relationship between the first virtual machine network interface and the current host in the preset database, and generating the second virtual machine network interface in the preset database.

[0069] In one example, the first virtual machine network interface is used to represent the network interface created on the current host. In this embodiment, since the first virtual machine network interface is used to represent the network interface created on the current host, there is a second association between the first virtual machine network interface and the current host. In cold migration mode, the second association between the first virtual machine network interface and the current host needs to be deleted from the preset database. The advantage of this setting is that it can prepare for virtual machine migration. Further, a second virtual machine network interface is generated in the preset database. The advantage of this setting is that the migrated virtual machine can be connected to the external network through the second virtual machine network interface.

[0070] S203. If the current migration mode is cold migration mode, then according to the current migration mode, the first virtual IP address is processed to obtain the second virtual IP address, including: removing the first association between the first virtual IP address and the first virtual machine network interface, and determining the first virtual IP address as the second virtual IP address.

[0071] In one example, the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address has a first association relationship with the first virtual machine network interface.

[0072] In one example, since there is a first association between the first virtual IP address and the first virtual machine network interface before the virtual machine migration, and the first virtual IP address will not change in cold migration mode, it is necessary to first remove the first association between the first virtual IP address and the first virtual machine network interface, and then determine the first virtual IP address as the second virtual IP address.

[0073] S204. Establish a third association between the second virtual machine network interface and the target host.

[0074] In this embodiment, after determining the second virtual machine network interface, the second virtual machine network interface is associated with the target host, and then a third association relationship between the second virtual machine network interface and the target host is obtained.

[0075] S205. Establish a fourth association between the second virtual IP address and the second virtual machine network interface.

[0076] In one example, the second virtual IP address is associated with the second virtual machine network interface, resulting in a fourth association. The advantage of this setup is that by establishing this association, the virtual IP address can be prevented from being lost during virtual machine migration.

[0077] S206. Based on the third and fourth association relationships, generate configuration information in the preset database.

[0078] In one example, the third and fourth associations are used to generate configuration information that indicates how to create a second virtual machine network interface and a second virtual IP address on the target host.

[0079] S207. Obtain configuration information from the preset database, and based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0080] In one example, this step can be found in step S104.

[0081] For a clearer explanation, please refer to [link to relevant documentation]. Figure 2b The diagram shows an architecture diagram under a cold migration mode.

[0082] This disclosure provides a virtual machine migration method, which includes: if the current migration mode is a cold migration mode, processing a first virtual machine network interface to obtain a second virtual machine network interface according to the current migration mode, including: deleting a second association between the first virtual machine network interface and the current host in a preset database, and generating a second virtual machine network interface in the preset database; if the current migration mode is a cold migration mode, processing a first virtual IP address to obtain a second virtual IP address according to the current migration mode, including: removing a first association between the first virtual IP address and the first virtual machine network interface, and determining the first virtual IP address as the second virtual IP address; establishing a third association between the second virtual machine network interface and the target host; establishing a fourth association between the second virtual IP address and the second virtual machine network interface; generating configuration information in the preset database according to the third and fourth associations; obtaining the configuration information from the preset database, and creating a second virtual machine network interface and a second virtual IP address on the target host according to the configuration information, to complete the migration of the virtual machine from the current host to the target host. This technical solution can improve the efficiency and stability of virtual machine migration.

[0083] Figure 3a This illustration shows a flowchart of a virtual machine migration method provided by an embodiment of the present disclosure. The embodiments of the present disclosure are optimized based on the above embodiments, and can be combined with various optional solutions from one or more of the above embodiments.

[0084] like Figure 3a As shown, the virtual machine migration method may include the following steps:

[0085] S301. If a migration operation of a virtual machine on the current host is detected, the current migration mode is determined; wherein the current migration mode is either cold migration mode or hot migration mode.

[0086] In one example, this step can be found in step S101.

[0087] S302. If the current migration mode is hot migration mode, then the first virtual machine network interface is processed according to the current migration mode to obtain the second virtual machine network interface, including: adding the migration status of the virtual machine to the preset database, and establishing the second virtual machine network interface in the preset database according to the first virtual machine network interface.

[0088] The first virtual machine network interface is used to characterize the network interface created on the current host.

[0089] In one example, the migration status of a virtual machine is used to indicate that the virtual machine is in the process of migration. For example, the first virtual machine network interface is VI F1, and the second virtual machine network interface is VI F2. In this embodiment, VI F1 and VI F2 exist simultaneously in the preset database at this time.

[0090] S303. If the current migration mode is hot migration mode, then according to the current migration mode, the first virtual IP address is processed to obtain the second virtual IP address, including: determining the first virtual IP address as the second virtual IP address.

[0091] In one example, the first virtual IP address is used to represent the address of the virtual machine service. The virtual IP address does not change in hot migration mode; therefore, the first virtual IP address is designated as the second virtual IP address.

[0092] S304. Establish the fifth association between the second virtual IP address and the second virtual machine network interface.

[0093] In one example, the second virtual IP address is associated with the second virtual machine network interface to obtain the fifth association.

[0094] S305. Based on the fifth association relationship, generate configuration information in the preset database.

[0095] In one example, the configuration information includes a fifth association, and this configuration information is used to indicate how to create a second virtual machine network interface and a second virtual IP address on the target host.

[0096] S306. Obtain configuration information from the preset database, and based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0097] In one example, this step can be found in step S104.

[0098] S307. Delete the second association between the first virtual machine network interface and the current host in the preset database.

[0099] In one example, in hot migration mode, after the virtual machine migration is completed, the second association between the first virtual machine network interface and the current host can be disconnected and deleted from the preset database.

[0100] S308. Remove the first association between the first virtual IP address and the first virtual machine network interface.

[0101] In one example, the second virtual IP address, which is the first virtual IP address, has already been associated with the second virtual machine network interface. At this time, after the virtual machine is migrated, the first association between the first virtual IP address and the first virtual machine network interface can be broken.

[0102] S309. Retrieve the current configuration information of the virtual machine in the target host, compare the current configuration information of the virtual machine with the configuration information in the preset database, and if they are inconsistent, send an error message.

[0103] In one example, to ensure the correctness of the migration process, the current configuration information of the virtual machine can be compared with the configuration information in the preset database. If they are inconsistent, an error message can be sent in time for timely correction.

[0104] For a clearer explanation, please refer to [link to relevant documentation]. Figure 3b The diagram shows an architecture under a hot migration mode.

[0105] This disclosure provides a virtual machine migration method, which includes: if the current migration mode is a hot migration mode, processing a first virtual machine network interface according to the current migration mode to obtain a second virtual machine network interface, including: adding the migration status of the virtual machine to a preset database, and establishing the second virtual machine network interface in the preset database according to the first virtual machine network interface. If the current migration mode is a hot migration mode, processing a first virtual IP address according to the current migration mode to obtain a second virtual IP address, including: determining the first virtual IP address as the second virtual IP address. Establishing a fifth association relationship between the second virtual IP address and the second virtual machine network interface. Generating configuration information in a preset database according to the fifth association relationship. Obtaining the configuration information from the preset database, and creating the second virtual machine network interface and the second virtual IP address on the target host according to the configuration information to complete the migration of the virtual machine from the current host to the target host. Deleting a second association relationship between the first virtual machine network interface and the current host in the preset database. Deactivating a first association relationship between the first virtual IP address and the first virtual machine network interface. The system retrieves the current configuration information of the virtual machine on the target host and compares it with the configuration information in a pre-set database. If they do not match, an error message is sent. This technical solution ensures service continuity during virtual machine migration.

[0106] Figure 4 This is a schematic diagram of a virtual machine migration device provided in an embodiment of this disclosure. This virtual machine migration device can be understood as the aforementioned electronic device or a functional module within the aforementioned electronic device. Figure 4 As shown, the virtual machine migration device 40 includes:

[0107] The determination module 401 is used to determine the current migration mode if a migration operation of a virtual machine on the current host is detected; wherein the current migration mode is either cold migration mode or hot migration mode.

[0108] The first processing module 402 is used to process the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface; wherein the first virtual machine network interface is used to represent the network interface created on the current host.

[0109] The second processing module 403 is used to process the first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship.

[0110] The acquisition module 404 is used to acquire configuration information and, based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0111] The apparatus provided in this embodiment can execute the methods of any of the above embodiments, and its execution method and beneficial effects are similar, so they will not be described again here.

[0112] Figure 5 This is a schematic diagram of a virtual machine migration device provided in an embodiment of this disclosure. This virtual machine migration device can be understood as the aforementioned electronic device or a functional module within the aforementioned electronic device. Figure 5 As shown, the virtual machine migration device 50 includes:

[0113] The determination module 501 is used to determine the current migration mode if a migration operation of a virtual machine on the current host is detected; wherein the current migration mode is either cold migration mode or hot migration mode.

[0114] The first processing module 502 is used to process the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface; wherein the first virtual machine network interface is used to represent the network interface created on the current host.

[0115] The second processing module 503 is used to process the first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship.

[0116] The acquisition module 504 is used to obtain configuration information from a preset database and, based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0117] In one example, if the current migration mode is cold migration mode, then according to the current migration mode, the first processing module 502 includes:

[0118] The delete submodule is used to delete the second association between the first virtual machine network interface and the current host in the preset database, and to generate the second virtual machine network interface in the preset database.

[0119] In one example, if the current migration mode is cold migration mode, then the second processing module 503 includes:

[0120] The release submodule is used to release the first association between the first virtual IP address and the first virtual machine network interface, and to determine the first virtual IP address as the second virtual IP address.

[0121] In one example, device 50 also includes:

[0122] The first module 505 is used to establish a third association between the second virtual machine network interface and the target host;

[0123] The second establishment module 506 is used to establish a fourth association relationship between the second virtual IP address and the second virtual machine network interface;

[0124] The first generation module 507 is used to generate configuration information in a preset database based on the third and fourth association relationships.

[0125] The apparatus provided in this embodiment can execute the methods of any of the above embodiments, and its execution method and beneficial effects are similar, so they will not be described again here.

[0126] Figure 6 This is a schematic diagram of a virtual machine migration device provided in an embodiment of this disclosure. This virtual machine migration device can be understood as the aforementioned electronic device or a functional module within the aforementioned electronic device. Figure 6 As shown, the virtual machine migration device 60 includes:

[0127] The determination module 601 is used to determine the current migration mode if a migration operation of a virtual machine on the current host is detected; wherein the current migration mode is either cold migration mode or hot migration mode.

[0128] The first processing module 602 is used to process the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface; wherein the first virtual machine network interface is used to represent the network interface created on the current host.

[0129] The second processing module 603 is used to process the first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship.

[0130] The acquisition module 604 is used to obtain configuration information from a preset database and, based on the configuration information, create a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0131] In one example, if the current migration mode is hot migration mode, then the first processing module 602 includes:

[0132] A submodule is added to add the migration status of virtual machines in a preset database, and to establish a second virtual machine network interface in the preset database based on the first virtual machine network interface.

[0133] In one example, if the current migration mode is hot migration mode, then the second processing module 603 includes:

[0134] The first virtual IP address is designated as the second virtual IP address.

[0135] In one example, device 60 also includes:

[0136] The third module 605 is used to establish a fifth association between the second virtual IP address and the second virtual machine network interface;

[0137] The second generation module 606 is used to generate configuration information in a preset database based on the fifth association relationship.

[0138] In one example, device 60 also includes:

[0139] The deletion module 607 is used to delete the second association between the first virtual machine network interface and the current host in a preset database;

[0140] The release module 608 is used to release the first association between the first virtual IP address and the first virtual machine network interface.

[0141] In one example, device 60 also includes:

[0142] The comparison module 609 is used to retrieve the current configuration information of the virtual machine in the target host, compare the current configuration information of the virtual machine with the configuration information in the preset database, and send an error message if they are inconsistent.

[0143] The apparatus provided in this embodiment can execute the methods of any of the above embodiments, and its execution method and beneficial effects are similar, so they will not be described again here.

[0144] This disclosure also provides an electronic device, which includes: a memory storing a computer program; and a processor for executing the computer program, wherein when the computer program is executed by the processor, it can implement the methods of any of the above embodiments.

[0145] Example, Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. See below for details. Figure 7The diagram illustrates a structural schematic suitable for implementing the electronic device 1000 in the embodiments of this disclosure. The electronic device 1000 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0146] like Figure 7 As shown, the electronic device 1000 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0147] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 1000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0148] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.

[0149] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0150] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0151] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0152] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following: if it detects that a migration operation of a virtual machine on the current host has been triggered, it determines the current migration mode; wherein the current migration mode is a cold migration mode or a hot migration mode; according to the current migration mode, it processes a first virtual machine network interface to obtain a second virtual machine network interface; wherein the first virtual machine network interface is used to represent a network interface created on the current host; according to the current migration mode, it processes a first virtual IP address to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship; it retrieves configuration information from a preset database, and according to the configuration information, creates a second virtual machine network interface and a second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

[0153] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltank, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0154] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0155] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0156] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0157] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0158] This disclosure also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the methods of any of the above embodiments. The execution method and beneficial effects are similar, and will not be described again here.

[0159] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0160] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A virtual machine migration method, characterized in that, include: If a migration operation for a virtual machine on the current host is detected, the current migration mode is determined; wherein the current migration mode is either a cold migration mode or a hot migration mode. Based on the current migration mode, the first virtual machine network interface is processed to obtain the second virtual machine network interface; wherein, the first virtual machine network interface is used to characterize the network interface created on the current host; Based on the current migration mode, the first virtual IP address is processed to obtain a second virtual IP address; wherein, the first virtual IP address is used to represent the address of the virtual machine service; the first virtual IP address and the first virtual machine network interface have a first association relationship; The system retrieves configuration information from a preset database and creates the second virtual machine network interface and the second virtual IP address on the target host based on the configuration information, thereby migrating the virtual machine from the current host to the target host.

2. The method according to claim 1, characterized in that, If the current migration mode is a cold migration mode, then processing the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface includes: The second association between the first virtual machine network interface and the current host is deleted from the preset database, and the second virtual machine network interface is generated in the preset database.

3. The method according to claim 2, characterized in that, If the current migration mode is a cold migration mode, then the process of processing the first virtual IP address according to the current migration mode to obtain the second virtual IP address includes: The first association between the first virtual IP address and the first virtual machine network interface is severed, and the first virtual IP address is determined as the second virtual IP address.

4. The method according to claim 3, characterized in that, After determining the first virtual IP address as the second virtual IP address, the method further includes: Establish a third association between the second virtual machine network interface and the target host; Establish a fourth association between the second virtual IP address and the second virtual machine network interface; Based on the third and fourth association relationships, the configuration information is generated in the preset database.

5. The method according to claim 1, characterized in that, If the current migration mode is a hot migration mode, then processing the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface includes: The migration status of the virtual machine is added to the preset database, and the second virtual machine network interface is established in the preset database according to the first virtual machine network interface.

6. The method according to claim 5, characterized in that, If the current migration mode is a hot migration mode, then the step of processing the first virtual IP address according to the current migration mode to obtain the second virtual IP address includes: The first virtual IP address is determined as the second virtual IP address.

7. The method according to claim 6, characterized in that, After determining the first virtual IP address as the second virtual IP address, the method further includes: Establish a fifth association between the second virtual IP address and the second virtual machine network interface; Based on the fifth association, the configuration information is generated in the preset database.

8. The method according to claim 7, characterized in that, After creating the second virtual machine network interface and the second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host, the method further includes: Delete the second association between the first virtual machine network interface and the current host from the preset database; The first association between the first virtual IP address and the first virtual machine network interface is severed.

9. The method according to claim 1, characterized in that, The method further includes: The current configuration information of the virtual machine in the target host is retrieved, and the current configuration information of the virtual machine is compared with the configuration information in the preset database. If they are inconsistent, an error message is sent.

10. A virtual machine migration device, characterized in that, include: The determination module is used to determine the current migration mode if a migration operation triggering a virtual machine on the current host is detected; wherein the current migration mode is either a cold migration mode or a hot migration mode. The first processing module is used to process the first virtual machine network interface according to the current migration mode to obtain the second virtual machine network interface; wherein, the first virtual machine network interface is used to represent the network interface created on the current host. The second processing module is used to process the first virtual IP address according to the current migration mode to obtain a second virtual IP address; wherein the first virtual IP address is used to represent the address of the virtual machine service; and the first virtual IP address has a first association relationship with the first virtual machine network interface; The acquisition module is used to acquire configuration information and, based on the configuration information, create the second virtual machine network interface and the second virtual IP address on the target host to complete the migration of the virtual machine from the current host to the target host.

11. An electronic device, characterized in that, include: A processor and a memory, wherein the memory stores a computer program that, when executed by the processor, performs the method of any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-9.