A virtual machine live migration method, device and system
By updating database port information and refreshing flow tables after virtual machine hot migration is completed at the underlying level, the network interruption problem during virtual machine hot migration is solved, thus achieving stable business operation and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2023-02-10
- Publication Date
- 2026-06-26
Smart Images

Figure CN116204274B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual machine hot migration technology, and more specifically, to a virtual machine hot migration method, apparatus and system. Background Technology
[0002] Virtual machine hot migration refers to migrating a running virtual machine from one host to another without interrupting business operations or affecting users.
[0003] With the continuous development of virtual machine technology, SDN (Software Defined Networking) is being used more and more widely. In a virtualized environment, when a virtual machine using an SDN network is hot-migrated to a different host, the typical process is as follows: Figure 1 The diagram illustrates the existing virtual machine migration process. A migration task is performed on the platform within the management host. The underlying QEMU (an open-source machine emulator and virtualizer) executes the migration, and upon completion, returns a success message to the platform on the management host. Upon receiving this message, the platform on the management host terminates the task, updates the port information in the database, and then distributes the target host's flow table, restoring network connectivity. However, because this process, from successful migration at the underlying level to port update, requires task confirmation and termination by the platform, the time required is unpredictable—it could be a few seconds or tens of seconds. This can lead to virtual machine network interruptions, impacting user services.
[0004] In summary, ensuring network stability during virtual machine hot migration to guarantee stable business operations is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a virtual machine hot migration method, apparatus and system to ensure network normal operation during virtual machine hot migration, so as to ensure stable operation of services.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] A virtual machine hot migration method, applied to a target host, includes:
[0008] Create a target virtual machine and use the target virtual machine to receive memory data copied from the virtual machine in the source host by the source host.
[0009] At the underlying level, it is determined whether the virtual machine has completed hot migration;
[0010] If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0011] Preferably, determining whether the virtual machine has completed hot migration at the underlying level includes:
[0012] Determine whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine;
[0013] If so, then it is determined at the underlying level that the virtual machine has completed hot migration.
[0014] Preferably, updating the port information in the database based on the target host information includes:
[0015] Connect to the ovn northbound db database in the management host, and update the port information in the ovn northbound db database according to the information of the target host.
[0016] Preferably, updating the port information in the ovn northbound db database based on the information of the target host includes:
[0017] Using the built-in ovn-nbctl tool, update the requested-chassis field in logical_switch_port to the information of the target host; the logical_switch_port is located in the ovn northbound db database.
[0018] Preferably, creating the target virtual machine includes:
[0019] After receiving the virtual machine hot migration task sent by the management host, the target virtual machine is created.
[0020] A virtual machine hot migration method, applied to the source host, includes:
[0021] The memory data of the virtual machine in the source host is copied to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0022] Preferred options also include:
[0023] Monitor the copying progress of the memory data;
[0024] After confirming that the memory data copy is complete, a migration success message is sent to the management host so that the management host can end the virtual machine hot migration task.
[0025] A virtual machine hot migration device, applied to a target host, includes:
[0026] A creation module is used to create a target virtual machine, which receives memory data copied from the virtual machine in the source host by the source host.
[0027] The determination module is used to determine at the underlying level whether the virtual machine has completed hot migration;
[0028] The update module is used to update the port information in the database according to the information of the target host if it is determined at the underlying level that the virtual machine has completed hot migration. The management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0029] A virtual machine hot migration device, applied to a source host, includes:
[0030] The copy module is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0031] A virtual machine hot migration system includes a management host and a managed host, wherein the managed host includes a source host and a target host, wherein:
[0032] The source host is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created;
[0033] The target host is used to receive the memory data using the target virtual machine and determine at the underlying level whether the virtual machine has completed hot migration; if so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0034] This application provides a method, apparatus, and system for hot migration of virtual machines. The method is applied to a target host and includes: creating a target virtual machine; using the target virtual machine to receive memory data copied from the virtual machine in the source host by the source host; determining at the underlying level whether the virtual machine has completed hot migration; if so, updating the port information in the database according to the information of the target host, and having the management host refresh the flow table according to the updated port information and distribute the refreshed flow table to each host to restore the network of the target virtual machine.
[0035] The technical solution disclosed in this application determines whether the virtual machine has completed hot migration at the underlying level. Once the underlying level confirms that the virtual machine has completed hot migration, it updates the port information in the database based on the target host's information. The management host then refreshes the flow table and distributes the refreshed flow table to each host to restore the target virtual machine's network, enabling it to access the internet normally. As can be seen from the above, this application no longer considers the end of the platform task on the management host as the end of the virtual machine hot migration, but rather determines the end of the virtual machine hot migration at the underlying level. Therefore, it can immediately restore the target virtual machine's network after the virtual machine completes hot migration, ensuring uninterrupted network operation during the migration, thereby guaranteeing stable business operation, improving user experience, and enhancing product reliability and competitiveness. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0037] Figure 1 A flowchart for migrating existing virtual machines;
[0038] Figure 2 A flowchart illustrating a virtual machine hot migration method applied to a target host, provided as an embodiment of this application;
[0039] Figure 3 A flowchart illustrating a virtual machine migration method provided in this application embodiment;
[0040] Figure 4 A flowchart illustrating the implementation of a virtual machine hot migration method under an SDN network provided in this application embodiment;
[0041] Figure 5 A flowchart illustrating another virtual machine migration method provided in this application embodiment;
[0042] Figure 6 This is a schematic diagram of the RARP message format provided in the embodiments of this application;
[0043] Figure 7 This is a schematic diagram of a virtual machine hot migration device applied to a target host, provided as an embodiment of this application. Detailed Implementation
[0044] The core of this application is to provide a method, apparatus, and system for hot migration of virtual machines, which can ensure that the network remains uninterrupted during the hot migration of virtual machines, so as to ensure the stable operation of services.
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] See Figures 2 to 4 ,in, Figure 2 The flowchart shown is a method for hot migration of virtual machines applied to a target host, according to an embodiment of this application. Figure 3 A flowchart of a virtual machine migration method provided in an embodiment of this application is shown. Figure 4 This document illustrates a flowchart of a virtual machine hot migration method under an SDN network, as provided in an embodiment of this application. The virtual machine hot migration method provided in this embodiment, applied to a target host, may include:
[0047] S11: Create a target virtual machine and use the target virtual machine to receive the memory data copied from the source host from the virtual machine in the source host.
[0048] In this application, the virtual machine hot migration system may include a management host and managed hosts. The managed hosts include a source host, a target host, and may also include other hosts. The source host is the host within the management host to which the virtual machine is to be migrated, and the target host is the host to which the virtual machine from the source host is to be migrated. The management host deploys a virtualization platform or cloud management platform, and both the management host and the managed hosts in the virtual machine hot migration system are collectively deployed with OVN (Open Virtual Network). OVN is a lightweight SDN controller composed of multiple components such as ovn northbounddb, ovn-northd, and ovn-controller.
[0049] When performing a live virtual machine migration, a target virtual machine can be created within the target host. Specifically, an empty target virtual machine can be created using QEMU on the target host. The target virtual machine mentioned here is the virtual machine on the target host that will participate in the virtual machine migration.
[0050] Furthermore, when performing a virtual machine hot migration, the source host can copy the memory data of the virtual machine on the source host to (specifically, continuously copy it to) the target host. This can be done using QEMU on the source host, which continuously copies the memory data of the virtual machine on the source host to the target host via the physical switch connecting the source and target hosts. Correspondingly, the target host can use its created target virtual machine to receive the copied memory data from the virtual machine on the source host.
[0051] The above method can be used to perform hot migration of virtual machines to change the host machine.
[0052] S12: Determine at the underlying level whether the virtual machine has completed hot migration; if yes, proceed to step S13; otherwise, return to step S12.
[0053] During step S11, the target host can determine at the underlying level whether the virtual machine has completed the hot migration. If it is determined at the underlying level that the virtual machine has completed the hot migration, step S13 can be executed. If it is determined at the underlying level that the virtual machine has not completed the hot migration, the process can return to step S12 and continue to determine at the underlying level whether the virtual machine has completed the hot migration.
[0054] S13: Update the port information in the database based on the target host information, and the management host refreshes the flow table based on the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0055] If the target host determines at the underlying level that the virtual machine has completed hot migration, it can update the port information in the database based on the target host's information. Specifically, the port information related to traffic transmission can be updated from the source host's information to the destination host's information. After the port information in the database is updated, the management host can refresh the flow table based on the updated port information and distribute the refreshed flow table to each host in the system (i.e., each managed host). Specifically, the refreshed flow table can be distributed to the ovn-controller of each host to restore the target virtual machine's network, thereby enabling the target virtual machine to access the Internet normally.
[0056] Furthermore, in this application, when the virtual machine has completed its hot migration, while the target host updates the port information in the database based on the target host's information, and the management host refreshes the flow table based on the updated port information and distributes the refreshed flow table to each host, the source host can send a migration success message to the management host, allowing the platform on the management host to terminate the virtual machine hot migration task. That is, while the target host updates the port information in the database based on the target host's information, and the management host refreshes the flow table based on the updated port information and distributes the refreshed flow table to each host, the platform on the management host can terminate the virtual machine migration task. This allows for the parallel execution of port information updates and the platform's termination of the virtual machine migration task, minimizing the flow table update time and ensuring uninterrupted network access for the virtual machine.
[0057] As described above, this application no longer uses the completion of the virtual machine migration task on the platform as the end point for port updates. That is, after the virtual machine's underlying hot migration is completed, this application does not wait for the platform to finish the task before updating the database. Therefore, there is no need to wait for the platform to confirm and end the task. Specifically, this application determines whether the virtual machine has completed hot migration at the underlying level, and directly updates and distributes port information and flow table updates after confirming the completion of the virtual machine's hot migration. This implementation method allows for immediate port information updates even in the event of a network interruption (which occurs after the underlying level confirms the completion of the virtual machine's hot migration), enabling immediate network recovery. In other words, this application virtually eliminates network interruptions, ensuring uninterrupted network operation during virtual machine hot migration and host changes in an SDN network environment, thus ensuring stable business operation.
[0058] The technical solution disclosed in this application determines whether the virtual machine has completed hot migration at the underlying level. Once the underlying level confirms that the virtual machine has completed hot migration, it updates the port information in the database based on the target host's information. The management host then refreshes the flow table and distributes the refreshed flow table to each host to restore the target virtual machine's network, enabling it to access the internet normally. As can be seen from the above, this application no longer considers the end of the platform task on the management host as the end of the virtual machine hot migration, but rather determines the end of the virtual machine hot migration at the underlying level. Therefore, it can immediately restore the target virtual machine's network after the virtual machine completes hot migration, ensuring uninterrupted network operation during the migration, thereby guaranteeing stable business operation, improving user experience, and enhancing product reliability and competitiveness.
[0059] For details, please refer to [link / reference]. Figure 5 This document illustrates a flowchart of another virtual machine migration method provided in an embodiment of this application. The virtual machine hot migration method provided in this application, which determines at the underlying level whether the virtual machine has completed hot migration, may include:
[0060] Determine whether the ovn-controller on the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends a RARP message to broadcast the location of the target virtual machine;
[0061] If so, then it is confirmed at the underlying level that the virtual machine has completed hot migration.
[0062] In this application, after all memory data in the virtual machine on the source host is migrated to the target virtual machine, that is, after the migration is complete, the target virtual machine on the target host will be started, and the QEMU corresponding to the target virtual machine will send a RARP (Reverse Address Resolution Protocol) message (i.e., a RARP protocol message) to broadcast the location of the target virtual machine to the entire local area network. Specifically, QEMU can send RARP messages by calling the `qemu_announce_self` interface. The RARP message resolves the physical address to an IP address. For details, please refer to [link to relevant documentation]. Figure 6 It shows a schematic diagram of the RARP message format provided in the embodiments of this application. The message contains the source physical address (i.e., the source MAC address), which is the physical address of the sender.
[0063] Based on the above, when the target host determines whether the virtual machine has completed hot migration at the underlying level, it can specifically check whether the ovn-controller on the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine. If the ovn-controller on the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine, it is confirmed that the target virtual machine is already running on the target host. Therefore, it can be confirmed that the underlying hot migration has been completed, that is, the virtual machine has completed hot migration at the underlying level.
[0064] Once the ovn-controller on the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine, it can determine that the source physical address in the RARP message is the physical address of the target virtual machine, which means that the underlying virtual machine hot migration has been completed.
[0065] As described above, after the virtual machine's hot migration is completed at the underlying level, this application uses QEMU on the target host to send RARP packets and uses ovn-controller on the target host to intercept RARP packets. The combination of these two operations enables the underlying system to confirm that the virtual machine has completed the hot migration, thereby enabling the next step of updating the database quickly, without waiting for the platform to finish its task before updating the database. Therefore, it can ensure that the network is normal and uninterrupted, thus ensuring the stable operation of the business.
[0066] This application provides a virtual machine hot migration method that updates port information in a database based on the target host's information, and may include:
[0067] Connect to the ovn northbound db database on the management host and update the port information in the ovnnorthbound db database based on the target host's information.
[0068] In this application, when the target host updates the port information in the database based on the target host's information, it can specifically connect to the ovn northbound db database in the management host. Then, based on the target host's information (such as the target host's name, target host's IP address, etc.), it updates the port information in the ovn northbound db database from the source host's information to the destination host's information, so that subsequent traffic can be sent according to the updated port information, thereby ensuring the correctness of traffic forwarding.
[0069] This application provides a virtual machine hot migration method that updates port information in the ovnnorthbound db database based on the target host's information, and may include:
[0070] Using the built-in ovn-nbctl tool, update the requested-chassis field in logical_switch_port to the target host information; logical_switch_port is located in the ovn northbound db database.
[0071] In this application, when updating port information in the ovn northbound db database based on the target host's information, the target host can specifically use the ovn-nbctl tool built into ovn to update the requested-chassis field in logical_switch_port (located in the ovn northbound db database) to the target host's information, thereby achieving accurate updating of port information. Here, logical_switch_port is a database table in the ovn northbound db database, and the switch uses this table to forward energy-efficient traffic.
[0072] Based on the above, the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host. Specifically, after the ovn-northd in the management host detects the update of the port information in the ovn northbound db database, it refreshes the flow table and distributes the refreshed flow table to each host.
[0073] This application provides a virtual machine hot migration method, which creates a target virtual machine and may include:
[0074] After receiving the virtual machine hot migration task sent by the management host, the target virtual machine is created.
[0075] In this application, when creating the target virtual machine, the target host can create the target virtual machine after receiving a virtual machine hot migration task sent by the management host, thereby improving the timeliness of target virtual machine creation and facilitating better preparation for virtual machine hot migration. Specifically, the virtualization platform or cloud management platform in the management host can issue the virtual machine hot migration task to the target host, so that the target host can receive the virtual machine hot migration task issued by the management host.
[0076] This application also provides a method for hot migration of virtual machines applied to a source host, which may include:
[0077] The memory data of the virtual machine in the source host is copied to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0078] In this application, the source host can specifically utilize QEMU within the source host to continuously copy memory data from the virtual machine on the source host to the target host. For details regarding the operations performed on the target host, please refer to the specific description of the relevant parts of the virtual machine hot migration method applied to the target host provided in the embodiments of this application; these details will not be repeated here.
[0079] The technical solution disclosed in this application determines whether the virtual machine has completed hot migration at the underlying level. Once the underlying level confirms that the virtual machine has completed hot migration, it updates the port information in the database based on the target host's information. The management host then refreshes the flow table and distributes the refreshed flow table to each host to restore the target virtual machine's network, enabling it to access the internet normally. As can be seen from the above, this application no longer considers the end of the platform task on the management host as the end of the virtual machine hot migration, but rather determines the end of the virtual machine hot migration at the underlying level. Therefore, it can immediately restore the target virtual machine's network after the virtual machine completes hot migration, ensuring uninterrupted network operation during the migration, thereby guaranteeing stable business operation, improving user experience, and enhancing product reliability and competitiveness.
[0080] The virtual machine hot migration method provided in this application embodiment may further include:
[0081] Monitor the progress of copying data in memory;
[0082] After confirming that the memory data copy is complete, a migration success message is sent to the management host, allowing the management host to end the virtual machine hot migration task.
[0083] In this application, when the source host copies the memory data of the virtual machine on the source host to the target host, the source host can also monitor (specifically, monitor in real time) the progress of the memory data copying, that is, monitor the migration progress of the virtual machine. Specifically, the migration progress can be monitored using libvirt (a toolkit for managing virtualization platforms, which is an open-source API, background program, and management tool for managing virtualization platforms). The migration progress can be queried through the libvirt interface, specifically using `ivirsh domjobinfo i-000x`.
[0084] Once the migration is complete and the virtual machine switches to the target host, the underlying layer completes the virtual machine hot migration. After libvirt confirms that the memory data copy is finished, that is, after confirming the virtual machine hot migration is complete, the source host can send a copy success message to the management host. Specifically, libvirt can be used to send a copy success message to the management host, so that the management host can end the virtual machine hot migration task on the appropriate platform after receiving the message. This allows the user to intuitively see the completion of the virtual machine hot migration task on the management host, for example, the progress of the virtual machine hot migration task reaches 100%, or the management host displays a message that the virtual machine hot migration task has ended.
[0085] Additionally, once the source host has confirmed that the memory data copy is complete, the virtual machine on the source host can be destroyed. Specifically, QEMU on the source host can be used to destroy the virtual machine on the source host to prevent two identical virtual machines from running, thereby ensuring that the target virtual machine on the target host can be used and run normally.
[0086] Furthermore, when copying the memory data of the virtual machine in the source host to the target host where the target virtual machine is created, this application can specifically copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created after receiving the virtual machine hot migration task sent by the management host (specifically, after receiving the virtual machine hot migration task sent by the virtualization platform or cloud management platform in the management host), so that the virtual machine hot migration can better meet the user's needs.
[0087] This application also provides a virtual machine hot migration device, applied to a target host, see [link to relevant documentation]. Figure 7 It illustrates a structural schematic diagram of a virtual machine hot migration device applied to a target host provided in an embodiment of this application, which may include:
[0088] Module 71 is created to create a target virtual machine, which then receives memory data copied from the source host from the virtual machine in the source host.
[0089] The judgment module 72 is used to determine at the underlying level whether the virtual machine has completed hot migration;
[0090] The update module 73 is used to update the port information in the database based on the target host information if it is determined at the underlying level that the virtual machine has completed hot migration. The management host then refreshes the flow table based on the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0091] This application provides a virtual machine hot migration device, wherein the determination module 72 may include:
[0092] The judgment unit is used to determine whether the ovn-controller in the target host intercepts the RARP protocol RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started and the QEMU corresponding to the target virtual machine sends a RARP message to broadcast the location of the target virtual machine;
[0093] The determination unit is used to determine at the underlying level that the virtual machine has completed hot migration if the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine.
[0094] This application provides a virtual machine hot migration device, wherein the update module 73 may include:
[0095] The update unit is used to connect to the ovn northbound db database in the management host and update the port information in the ovn northbound db database according to the information of the target host.
[0096] This application provides a virtual machine hot migration device, wherein the update unit may include:
[0097] The update sub-unit is used to update the requested-chassis field in logical_switch_port with the target host information using the built-in ovn-nbctl tool; logical_switch_port is located in the ovn northbounddb database.
[0098] This application provides a virtual machine hot migration device, wherein the creation module 71 may include:
[0099] The creation unit is used to create the target virtual machine after receiving a virtual machine hot migration task sent by the management host.
[0100] For a description of the relevant parts of the virtual machine hot migration device applied to the target host provided in the embodiments of this application, please refer to the detailed description of the relevant parts of the virtual machine hot migration method applied to the target host provided in the embodiments of this application, which will not be repeated here.
[0101] This application embodiment also provides a virtual machine hot migration device, applied to a source host, which may include:
[0102] The copy module is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0103] The virtual machine hot migration device provided in this application embodiment may further include:
[0104] The monitoring module is used to monitor the progress of copying data in memory;
[0105] The sending module is used to send a migration success message to the management host after confirming that the memory data copy is complete, so that the management host can end the virtual machine hot migration task.
[0106] For a description of the relevant parts of the virtual machine hot migration device applied to the source host provided in the embodiments of this application, please refer to the detailed description of the relevant parts of the virtual machine hot migration method applied to the source host provided in the embodiments of this application, which will not be repeated here.
[0107] This application also provides a virtual machine hot migration system, which may include a management host and a managed host. The managed host may include a source host and a target host, wherein:
[0108] The source host is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine was created;
[0109] The target host is used to receive memory data from the target virtual machine and determine at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine.
[0110] The technical solution disclosed in this application determines whether the virtual machine has completed hot migration at the underlying level. Once the underlying level confirms that the virtual machine has completed hot migration, it updates the port information in the database based on the target host's information. The management host then refreshes the flow table and distributes the refreshed flow table to each host to restore the target virtual machine's network, enabling it to access the internet normally. As can be seen from the above, this application no longer considers the end of the platform task on the management host as the end of the virtual machine hot migration, but rather determines the end of the virtual machine hot migration at the underlying level. Therefore, it can immediately restore the target virtual machine's network after the virtual machine completes hot migration, ensuring uninterrupted network operation during the migration, thereby guaranteeing stable business operation, improving user experience, and enhancing product reliability and competitiveness.
[0111] This application provides a virtual machine hot migration system. Specifically, the target host determines whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine. After the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends a RARP message to broadcast the location of the target virtual machine. If so, it is determined at the underlying level that the virtual machine has completed the hot migration.
[0112] This application provides a virtual machine hot migration system. The target host is specifically used to connect to the ovn northbound db database in the management host and update the port information in the ovn northbound db database according to the information of the target host.
[0113] This application provides a virtual machine hot migration system. Specifically, the target host is used to update the requested-chassis field in logical_switch_port with the target host's information using the built-in ovn-nbctl tool; logical_switch_port is located in the ovn northbound db database.
[0114] This application provides a virtual machine hot migration system, in which the target host is specifically used to create a target virtual machine after receiving a virtual machine hot migration task sent by the management host.
[0115] This application provides a virtual machine hot migration system. The source host is also used to monitor the copying progress of memory data. After determining that the memory data copying is complete, a migration success message is sent to the management host so that the management host can end the virtual machine hot migration task.
[0116] For a description of the relevant parts of the virtual machine hot migration system provided in this application embodiment, please refer to the detailed description of the relevant parts of the virtual machine hot migration method applied to the target host and the virtual machine hot migration method applied to the source host provided in this application embodiment, which will not be repeated here.
[0117] 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 the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. 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. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0118] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. 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 application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for hot migration of virtual machines, characterized in that, Applied to the target host, including: Create a target virtual machine and use the target virtual machine to receive memory data copied from the virtual machine in the source host by the source host. At the underlying level, it is determined whether the virtual machine has completed hot migration; If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine. Specifically, determining whether the virtual machine has completed hot migration at the underlying level includes: determining whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine; if so, it is determined at the underlying level that the virtual machine has completed hot migration. Updating the port information in the database based on the target host information includes: connecting to the ovn northbound db database in the management host and updating the port information in the ovn northbound db database based on the target host information; Updating the port information in the ovn northbound db database based on the target host information includes: updating the port information related to traffic transmission in the ovn northbound db database from the source host information to the target host information.
2. The virtual machine hot migration method according to claim 1, characterized in that, Update the port information in the ovn northbound db database based on the information of the target host, including: Using the built-in ovn-nbctl tool, update the requested-chassis field in logical_switch_port to the information of the target host; the logical_switch_port is located in the ovn northbound db database.
3. The virtual machine hot migration method according to claim 1, characterized in that, Create the target virtual machine, including: After receiving the virtual machine hot migration task sent by the management host, the target virtual machine is created.
4. A method for hot migration of virtual machines, characterized in that, Applied to the source host, including: The memory data of the virtual machine in the source host is copied to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine. Specifically, determining whether the virtual machine has completed hot migration at the underlying level includes: the target host determining whether the ovn-controller on the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine; if so, it is determined at the underlying level that the virtual machine has completed hot migration. Updating the port information in the database based on the information of the target host includes: the target host connecting to the ovn northbound db database in the management host, and updating the port information in the ovn northbound db database based on the information of the target host; Updating the port information in the ovn northbound db database based on the information of the target host includes: the target host updating the port information related to traffic transmission in the ovn northbound db database from the source host's information to the target host's information.
5. The virtual machine hot migration method according to claim 4, characterized in that, Also includes: Monitor the copying progress of the memory data; After confirming that the memory data copy is complete, a migration success message is sent to the management host so that the management host can end the virtual machine hot migration task.
6. A virtual machine hot migration device, characterized in that, Applied to the target host, including: A creation module is used to create a target virtual machine, which receives memory data copied from the virtual machine in the source host by the source host. The determination module is used to determine at the underlying level whether the virtual machine has completed hot migration; The update module is used to update the port information in the database according to the information of the target host if it is determined at the underlying level that the virtual machine has completed hot migration. The management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine. Specifically, the judgment module is used to determine whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine; if so, it is determined at the underlying level that the virtual machine has completed hot migration. The update module is specifically used to connect to the ovn northbound db database in the management host and update the port information in the ovn northbound db database according to the information of the target host; The update module is specifically used to update the port information related to traffic transmission in the ovn northbound db database from the source host information to the target host information.
7. A virtual machine hot migration device, characterized in that, Applied to the source host, including: The copy module is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created. The target host uses the target virtual machine to receive the memory data and determines at the underlying level whether the virtual machine has completed hot migration. If so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine. The process of determining whether the virtual machine has completed hot migration at the underlying level includes: the target host determining whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine; if so, it is determined at the underlying level that the virtual machine has completed hot migration. The process of updating the port information in the database based on the information of the target host includes: the target host connecting to the ovn northbound db database in the management host, and updating the port information in the ovn northbound db database based on the information of the target host; The process of updating the port information in the ovn northbound db database based on the information of the target host includes: the target host updating the port information related to traffic transmission in the ovn northbound db database from the information of the source host to the information of the target host.
8. A virtual machine hot migration system, characterized in that, It includes a management host and a managed host, wherein the managed host includes a source host and a target host, wherein: The source host is used to copy the memory data of the virtual machine in the source host to the target host where the target virtual machine is created; The target host is used to receive the memory data using the target virtual machine and determine at the underlying level whether the virtual machine has completed hot migration; if so, the port information in the database is updated according to the information of the target host, and the management host refreshes the flow table according to the updated port information and distributes the refreshed flow table to each host to restore the network of the target virtual machine. Specifically, the target host is used to determine whether the ovn-controller in the target host intercepts the RARP message sent by the QEMU corresponding to the target virtual machine; after the memory data migration is completed, the target virtual machine is started, and the QEMU corresponding to the target virtual machine sends the RARP message to broadcast the location of the target virtual machine; if so, it is determined at the underlying level that the virtual machine has completed hot migration. The target host is specifically used to connect to the ovn northbound db database in the management host and update the port information in the ovn northbound db database according to the information of the target host; Specifically, the target host is used to update the port information related to traffic transmission in the ovn northbound db database from the source host's information to the target host's information.