WO2024103800A1 - 虚拟机热迁移方法、装置、设备及非易失性可读存储介质 - Google Patents

虚拟机热迁移方法、装置、设备及非易失性可读存储介质 Download PDF

Info

Publication number
WO2024103800A1
WO2024103800A1 PCT/CN2023/105551 CN2023105551W WO2024103800A1 WO 2024103800 A1 WO2024103800 A1 WO 2024103800A1 CN 2023105551 W CN2023105551 W CN 2023105551W WO 2024103800 A1 WO2024103800 A1 WO 2024103800A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
source node
virtual machine
ovn
migration
Prior art date
Application number
PCT/CN2023/105551
Other languages
English (en)
French (fr)
Inventor
李有
秦海中
Original Assignee
济南浪潮数据技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 济南浪潮数据技术有限公司 filed Critical 济南浪潮数据技术有限公司
Publication of WO2024103800A1 publication Critical patent/WO2024103800A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags

Definitions

  • the present application relates to the field of cloud computing technology, and in particular to a virtual machine hot migration method, device, equipment and non-volatile readable storage medium.
  • OpenStack cloud computing management platform is an open source cloud computing management platform project, which is a combination of a series of software open source projects. OpenStack provides scalable and elastic cloud computing services for private and public clouds. Cloud services provide virtual machine services, and the rapid forwarding of network data in business operations lays the foundation for cloud service performance.
  • the more advanced solution is to re-plan the Open Virtual Switching Standard (Open vSwitch, OVS) flow table based on the Open Virtual Network (OVN) controller, so that OVS not only provides Layer 2 forwarding, but also Layer 3 forwarding. In this way, Layer 3 forwarding can be completed directly within the OVS process, which improves forwarding efficiency, reduces system resource consumption, and OVN also has the advantage of inherent distribution.
  • Open vSwitch Open Virtual Switching Standard
  • OVS Open Virtual Network
  • the migration of virtual machines across nodes is a common function of cloud services.
  • data forwarding can be provided before migration by creating interface devices in advance (network forwarding is achieved by the cooperation of multiple interfaces), thereby achieving zero packet loss.
  • data forwarding based on the OVN solution is implemented by flow tables, and zero packet loss cannot be achieved by creating interfaces in advance, resulting in the inability of the virtual machine hot migration function to achieve uninterrupted business.
  • the purpose of the present application is to provide a virtual machine hot migration method, device, equipment and non-volatile readable storage medium to achieve uninterrupted business during virtual machine hot migration.
  • a virtual machine hot migration method comprising:
  • setting the port of the source node to bind the source node and the destination node simultaneously includes:
  • generating a flow table corresponding to the bound source node includes:
  • the source node processes the traffic including:
  • the port When the port receives traffic, it transmits the traffic to the source node and the destination node through the port;
  • the traffic is forwarded to the network card of the virtual machine through the source node to process the packets in the traffic.
  • the method further includes:
  • deleting the binding relationship between the port and the source node in the ovn northbound database and the ovn southbound database includes:
  • the neutron-server sends the information about deleting the binding relationship between the port and the source node to the ovn northbound database to delete the binding relationship between the port and the source node in the logical_switch_port table in the ovn northbound database.
  • the destination node processes the traffic.
  • the destination node processes the traffic including:
  • the port When the port receives traffic again, it transmits the traffic to the destination node through the port;
  • the traffic is forwarded to the network card of the virtual machine through the destination node to process the packets in the traffic.
  • deleting the source node's port through nova also include:
  • the method further includes:
  • the method further includes:
  • traffic sent to the port through the flow table is sent to both the source node and the destination node.
  • the method after changing the port binding relationship through nova and neutron-server to bind the port to the source node and the destination node at the same time, the method also includes: recording that the port is bound to the source node and the destination node at the same time, and marking the source node as online active and the destination node as inactive offline respectively.
  • deleting the binding relationship between the port and the source node through nova and neutron-server includes: nova notifying neutron-server to delete the binding relationship between the port and the source node, and neutron-server deleting the binding relationship between the port and the source node.
  • deleting the binding relationship between the port and the source node through nova and neutron-server includes: synchronously updating the deletion result of the binding relationship between the port and the source node to the ovn northbound database and the ovn southbound database, so that the ovn northbound database and the ovn southbound database delete the binding relationship between the port and the source node.
  • the method further includes: when the port receives traffic again and the source node receives a message in the traffic, the source node discards the message.
  • the present application also provides a virtual machine hot migration device, including:
  • a migration module is configured to initiate the migration of a virtual machine located at a source node to a destination node based on an OVN distributed network environment
  • a binding module is configured to set the port of the source node and bind the source node and the destination node at the same time;
  • a generating module is configured to generate a flow table corresponding to the bound source node, so as to access the source node and the destination node of the bound port through the flow table;
  • the processing module is configured to process the traffic when the port receives it, and then the source node processes the traffic until the virtual machine is migrated. Finish.
  • the present application also provides a virtual machine hot migration device, including:
  • a memory arranged to store a computer program
  • the processor is configured to implement the steps of the above-mentioned virtual machine hot migration method when executing a computer program.
  • the present application also provides a non-volatile readable storage medium, on which a computer program is stored.
  • a computer program is stored on which a computer program is stored.
  • the steps of the above virtual machine hot migration method are implemented.
  • the virtual machine hot migration method starts the migration of the virtual machine located at the source node to the destination node based on the OVN distributed network environment; sets the port of the source node to bind the source node and the destination node at the same time; generates a flow table corresponding to the bound source node, which is used to access the source node and the destination node of the bound port through the flow table; when the port receives traffic, the source node processes the traffic until the virtual machine migration is completed.
  • the above scheme modifies and expands the attributes of the original table items in the network environment using the OpenStack open source project OVN without changing the original traffic architecture design; the source node and the destination node can be bound at the same time by setting the port of the source node, allowing one port to bind two nodes; the traffic message sent to this port can be sent to two nodes at the same time.
  • the destination node receives the traffic message in advance and has the forwarding function provided by the flow table, ensuring that there is no message loss during the migration process, thereby achieving zero packet loss in hot migration and improving the practicality of the product and the stability of the business.
  • the embodiments of the present application also provide a virtual machine hot migration device, equipment and non-volatile readable storage medium, the effects of which are the same as above.
  • FIG1 is a flow chart of a method for hot migration of a virtual machine provided in an embodiment of the present application
  • FIG2 is a schematic diagram of a virtual machine hot migration device provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a virtual machine hot migration device provided in an embodiment of the present application.
  • the core of this application is to provide a virtual machine hot migration method, device, equipment and non-volatile readable storage medium.
  • OVS is an open source "virtual switch". In terms of control protocol, it not only supports all the features of OpenFlow (a network communication protocol), but also extends some of the functions of OpenFlow. Among them, OpenFlow is a network communication protocol that belongs to the data link layer. It can control the forwarding plane of the online switch or router to change the network path taken by the network data packet.
  • OpenFlow is a network communication protocol that belongs to the data link layer. It can control the forwarding plane of the online switch or router to change the network path taken by the network data packet.
  • OVS has long lacked a unified network model, so OVN was born. OVN aims to provide a control plane for OVS, providing the same network services for containers and virtual machines through a unified network model.
  • OVN provides a lightweight controller that provides a higher level of abstraction than OVS.
  • the lightweight nature of OVN is not only reflected in the small amount of code and simple model of OVN itself, but also in its easy-to-understand flow table design (Pipeline).
  • OVN is a series of daemons that convert virtual network configurations into OpenFlow and install them into OVS. Therefore, the more advanced three-layer forwarding solution is based on the OVN controller to re-plan the OVS flow table, so that OVS not only provides two-layer forwarding, but also three-layer forwarding. In this way, three-layer forwarding can be completed directly within the OVS process, which improves forwarding efficiency and reduces the consumption of system resources.
  • OVN also has the advantage of inherent distribution.
  • FIG. 1 is a flow chart of a method for hot migration of a virtual machine provided in an embodiment of the present application. As shown in Figure 1, the method includes:
  • S10 Initiate migration of the virtual machine located at the source node to the destination node based on the OVN distributed network environment.
  • the migration of the virtual machine located at the source node to the destination node is initiated based on the OVN distributed network environment. It is understandable that the virtual machine is located at the source node before migration and at the destination node after migration.
  • the migration process mainly copies the memory data of the virtual machine to the destination node and builds a new virtual machine in the destination node.
  • Both the source node and the destination node are nodes (chassis) in the OVN distributed network environment. They can be physical nodes in the virtual environment, can be used as computing nodes, can be used as network nodes, or can be both network nodes and computing nodes. At the same time, the nodes need to deploy ovn-controller (controller) and OVS-related processes.
  • S11 Set the port of the source node and bind the source node and the destination node at the same time.
  • the port of the source node is set to bind the source node and the destination node at the same time.
  • Port refers to the network port of the switch; for a hardware switch, the port is a network card interface group; for a soft switch, the port is an interface inserted into the bridge.
  • each node is bound to a port for accessing the corresponding node through the port.
  • the port of the source node is bound to the source node and the destination node at the same time, so that the traffic access to the source node can access the destination node at the same time.
  • nova and neutron-server are the computing organization controller of the OpenStack cloud computing management platform, which is used to manage all activities of the life cycle of instances in the OpenStack cloud. It is a scalability platform required for managing computing resources and network authentication.
  • Neutron is the component responsible for providing network services in the OpenStack project. It implements resource management under network virtualization based on the idea of software-defined networking. The design goal of neutron is to achieve "Networking as a Service”. The design follows the principle of realizing network virtualization based on software-defined networking (SDN), and makes full use of various network-related technologies on the Linux system in implementation; neutron-server is a process for providing services.
  • SDN software-defined networking
  • nova responds to the action of hot migration of the virtual machine and notifies neutron-server to update, update the binding relationship of the port of the source node, and bind the port to the source node and the destination node at the same time; record that the port is bound to the source node and the destination node at the same time, and mark the two nodes as active (online) and inactive (offline) respectively.
  • neutron-server sends the binding relationship to the ovn northbound database to modify the binding relationship of the port in the logical_switch_port table in the ovn northbound database.
  • ovn-northd Open Virtual Networking Northbound Daemon
  • ovn northbound database and the ovn southbound database are lightweight databases that use ovs-db.
  • ovn-northd is used to connect the ovn northbound database above it and the ovn southbound database below it; it converts the logical network configuration in the traditional network concept (taken from the ovn northbound database) into the logical data path flow in the ovn southbound database below it.
  • the update of the binding relationship in the ovn northbound database is synchronized to the ovn southbound database, so that the ovn-controller on all other nodes can perceive that this port is bound to two nodes.
  • ovn-controller is an OVN agent on each Hypervisor (also known as a virtual machine monitor (VMM), which is software, firmware or hardware used to build and execute virtual machines) in the cluster, connecting to the ovn southbound database in the north. It converts the logical flow in the southbound database into OpenFlow for Open vSwitch (a network communication protocol that supports the open virtual switching standard). It also handles certain Traffic, such as Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS).
  • DHCP Dynamic Host Configuration Protocol
  • DNS Domain Name System
  • S12 Generate a flow table corresponding to the bound source node, so as to access the source node and the destination node of the bound port through the flow table.
  • a flow table corresponding to the bound source node is generated.
  • the flow table is a forwarding flow table. Since the port is bound to two nodes (source node and destination node), all traffic sent to this port through the forwarding flow table is sent to the source node and the destination node at the same time.
  • the binding relationship in the ovn southbound database can be obtained through the ovn-controllers of the remaining nodes, and a flow table can be generated based on the binding relationship and OVS to achieve access to the source node and destination node through the flow table.
  • the source node processes the traffic until the virtual machine migration is completed.
  • the virtual machine in the source node is working normally, while the virtual machine in the destination node is not built. Therefore, as an optional embodiment, when the port receives traffic, the traffic is transmitted to the source node and the destination node through the port; the source node forwards the traffic to the network card of the virtual machine according to the flow table to process the message in the traffic. Since the virtual machine in the destination node is still being built and does not have the function of replying to the message, the message is not processed.
  • the migration of the virtual machine located at the source node to the destination node is started based on the OVN distributed network environment; the port of the source node is set to bind the source node and the destination node at the same time; the flow table corresponding to the bound source node is generated to access the source node and the destination node of the bound port through the flow table; when the port receives traffic, the source node processes the traffic until the migration of the virtual machine is completed.
  • the above scheme modifies and expands the attributes of the original table items in the network environment using the OpenStack open source project OVN without changing the original traffic architecture design; the source node and the destination node can be bound at the same time by setting the port of the source node, allowing one port to bind two nodes; the traffic message sent to this port can be sent to two nodes at the same time.
  • the destination node receives the traffic message in advance and has the forwarding function provided by the flow table, ensuring that there is no message loss during the migration process, thereby achieving zero packet loss in hot migration and improving the practicality of the product and business stability.
  • the method further includes:
  • the virtual machine on the destination node can always receive the message, it can directly provide services after the virtual machine is built, thereby achieving zero packet loss.
  • the source node where the virtual machine was previously located no longer participates in the services between other nodes and the virtual machine. Therefore, as an optional embodiment, the relevant content in the source node is deleted after the migration is completed.
  • nova notifies neutron-server to delete the binding relationship between the port and the source node.
  • Neutron-server deletes the binding relationship between the port and the source node and updates it to the ovn northbound database and ovn southbound database synchronously, so that the ovn northbound database and ovn southbound database delete the binding relationship between the port and the source node.
  • the ovn-cotroller of all nodes deletes the binding relationship between this port and the source node, and the source node of this port deletes the corresponding flow table.
  • the deletion result of the binding relationship between the port and the source node is synchronously updated to the ovn northbound database and the ovn southbound database.
  • the deletion result of the binding relationship between the port and the source node may include but is not limited to the identifier of the binding relationship between the port and the source node that needs to be deleted, or the deletion result of the binding relationship between the deleted port and the source node, etc., so that the ovn northbound database and the ovn southbound database delete the binding relationship between the port and the source node.
  • the neutron-server can send the information of deleting the binding relationship between the port and the source node to the ovn northbound database to delete the binding relationship between the port and the source node in the logical_switch_port table in the ovn northbound database.
  • the deleted binding relationship in the ovn northbound database is obtained through ovn-northd, and the binding relationship between the port and the source node in the port_binding table in the ovn southbound database is deleted, and finally the binding relationship between the port and the source node in the database is deleted.
  • the method further includes:
  • the destination node processes the traffic.
  • the destination node since the binding relationship between the port and the source node is deleted after the virtual machine migration is completed, and the flow table corresponding to the source node is deleted, when the port receives traffic again, the destination node processes the traffic.
  • the method further includes:
  • outputting a prompt message indicating that the virtual machine migration is completed can enable the user to promptly know that the virtual machine migration is completed, so as to facilitate subsequent related operations or access to the virtual machine.
  • a migration log of the virtual machine can be generated to record the migration process of the virtual machine. Users can understand the entire migration process of the virtual machine through the migration log to backtrack or audit the migration, thereby improving the security of virtual machine hot migration.
  • setting the port of the source node to bind the source node and the destination node at the same time includes:
  • generating a flow table corresponding to the bound source node includes:
  • the source node processes the traffic including:
  • the port When the port receives traffic, it transmits the traffic to the source node and the destination node through the port;
  • the traffic is forwarded to the network card of the virtual machine through the source node to process the packets in the traffic.
  • the method further includes:
  • deleting the binding relationship between the port and the source node in the ovn northbound database and the ovn southbound database includes:
  • the neutron-server sends the information about deleting the binding relationship between the port and the source node to the ovn northbound database to delete the binding relationship between the port and the source node in the logical_switch_port table in the ovn northbound database.
  • the method further includes:
  • the destination node processes the traffic.
  • the destination node processes the traffic including:
  • the traffic is forwarded to the network card of the virtual machine through the destination node to process the packets in the traffic.
  • the method further includes:
  • the method further includes:
  • the method further includes:
  • the virtual machine hot migration device includes a migration module, a binding module, a generation module and a processing module.
  • the migration of the virtual machine located at the source node to the destination node is started based on the OVN distributed network environment; the port of the source node is set to bind the source node and the destination node at the same time; a flow table corresponding to the bound source node is generated to access the bound port through the flow table. source node and destination node; when the port receives traffic, the source node processes the traffic until the virtual machine migration is completed.
  • the above solution modifies and expands the attributes of the original table items without changing the original traffic architecture design in the network environment using the OpenStack open source project OVN; by setting the port of the source node to bind the source node and the destination node at the same time, one port is allowed to bind two nodes; the traffic message sent to this port can be sent to two nodes at the same time.
  • the destination node receives the traffic message in advance and has the forwarding function provided by the flow table, ensuring that there is no message loss during the migration process, thereby achieving zero packet loss in hot migration and improving the practicality of the product and business stability.
  • FIG3 is a schematic diagram of a virtual machine hot migration device provided in an embodiment of the present application. As shown in FIG3 , the virtual machine hot migration device includes:
  • the memory 20 is configured to store computer programs.
  • the processor 21 is configured to implement the steps of the virtual machine hot migration method mentioned in the above embodiment when executing a computer program.
  • the virtual machine hot migration device may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
  • the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc.
  • the processor 21 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA).
  • DSP digital signal processor
  • FPGA field-programmable gate array
  • PDA programmable logic array
  • the processor 21 may also include a main processor and a coprocessor.
  • the main processor is a processor configured to process data in an awake state, also known as a central processing unit (CPU);
  • the coprocessor is a low-power processor configured to process data in a standby state.
  • the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is configured to be responsible for rendering and drawing the content to be displayed on the display screen.
  • the processor 21 may also include an artificial intelligence (AI) processor, which is configured to process computing operations related to machine learning.
  • AI artificial intelligence
  • the memory 20 may include one or more non-volatile readable storage media, which may be non-transitory.
  • the memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices.
  • the memory 20 is at least configured to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the virtual machine hot migration method disclosed in any of the aforementioned embodiments.
  • the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage.
  • the operating system 202 may include Windows, Unix, Linux, etc.
  • Data 203 may include but is not limited to data related to the virtual machine hot migration method.
  • the virtual machine hot migration device may further include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
  • FIG. 3 does not constitute a limitation on the virtual machine hot migration device, and may include more or fewer components than those shown in the figure.
  • the virtual machine hot migration device includes a memory and a processor.
  • the memory is configured to store a computer program
  • the processor is configured to implement the steps of the virtual machine hot migration method mentioned in the above embodiment when executing the computer program.
  • the migration of the virtual machine located at the source node to the destination node is started based on the OVN distributed network environment; the port of the source node is set to bind the source node and the destination node at the same time; the flow table corresponding to the bound source node is generated to access the source node and the destination node of the bound port through the flow table; when the port receives the traffic, the source node processes the traffic until the virtual machine migration is completed.
  • the above scheme modifies and expands the attributes of the original table items in the network environment using the OpenStack open source project OVN without changing the original traffic architecture design; the source node and the destination node can be bound at the same time by setting the port of the source node, allowing one port to bind two nodes; the traffic message sent to this port can be sent to two nodes at the same time.
  • the destination node receives the traffic message in advance and has the forwarding function provided by the flow table, ensuring that there is no message loss during the migration process, thereby achieving zero packet loss in hot migration and improving the practicality of the product and the stability of the business.
  • the present application also provides an embodiment corresponding to a non-volatile readable storage medium.
  • the non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
  • the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a non-volatile readable storage medium and executes all or part of the steps of the methods of each embodiment of the present application.
  • the aforementioned non-volatile readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., which can store program code.
  • Non-volatile readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
  • a computer program is stored on a non-volatile readable storage medium, and when the computer program is executed by a processor, the steps described in the above method embodiment are implemented.
  • the migration of a virtual machine located at a source node to a destination node is initiated based on an OVN distributed network environment; the port of the source node is set to bind the source node and the destination node at the same time; a flow table corresponding to the bound source node is generated to access the source node and the destination node of the bound port through the flow table; when the port receives traffic, the source node processes the traffic until the migration of the virtual machine is completed.
  • the above scheme modifies and expands the attributes of the original table items without changing the original traffic architecture design in a network environment using the OpenStack open source project OVN; the source node and the destination node can be bound to the same time by setting the port of the source node, allowing one port to bind to two nodes; and sent to The traffic packets of this port can be sent to two nodes at the same time.
  • the destination node receives the traffic packets in advance and has the forwarding function provided by the flow table, ensuring that there is no packet loss during the migration process, thereby achieving zero packet loss in hot migration and improving the practicality of the product and business stability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种虚拟机热迁移方法、装置、设备及非易失性可读存储介质,涉及云计算技术领域。通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包。

Description

虚拟机热迁移方法、装置、设备及非易失性可读存储介质
相关申请的交叉引用
本申请要求于2022年11月15日提交中国专利局,申请号为202211422892.5,申请名称为“一种虚拟机热迁移方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云计算技术领域,特别是涉及一种虚拟机热迁移方法、装置、设备及非易失性可读存储介质。
背景技术
在当前云计算、云服务大热的时代,公司业务和个人业务都在推行云服务。Open(开放式)Stack云计算管理平台是一个开源的云计算管理平台项目,是一系列软件开源项目的组合。OpenStack为私有云和公有云提供可扩展的弹性的云计算服务。云服务提供了虚拟机服务,业务运行中的网络数据的快速转发奠定了云服务性能的基础。目前比较先进的方案是基于开放式虚拟网络(Open Virtual Network,OVN)控制器重新对开放式虚拟交换标准(Open vSwitch,OVS)流表进行规划,使OVS不仅仅提供二层转发,也提供三层转发。这样三层转发直接在OVS进程内就可以完成,提高了转发效率,减少了系统资源的消耗,并且OVN还具有先天分布式的优势。
在实际使用过程中,虚拟机跨节点之间的迁移是云服务常用的功能。客户希望迁移过程中可以实现业务不中断,即能够达到零丢包的效果。原生OpenStack方案中,可通过提前创建接口设备(网络转发由多种接口配合实现)来保障迁移之前就能提供数据转发,从而实现零丢包。但基于OVN方案的数据转发由流表实现,无法通过提前创建接口来实现零丢包,导致虚拟机热迁移功能无法实现业务不中断。
鉴于上述问题,如何实现虚拟机热迁移过程中业务不中断,是该领域技术人员亟待解决的问题。
发明内容
本申请的目的是提供一种虚拟机热迁移方法、装置、设备及非易失性可读存储介质,以实现虚拟机热迁移过程中业务不中断。
为解决上述技术问题,本申请提供一种虚拟机热迁移方法,包括:
基于开放式虚拟网络OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;
设置源节点的端口同时绑定源节点和目的节点;
生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;
当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。
可选地,设置源节点的端口同时绑定源节点和目的节点包括:
通过计算组织控制器nova和组件服务器neutron-server更改端口的绑定关系,以将端口同时绑定至源节点和目的节点;
通过neutron-server下发绑定关系至ovn北向数据库,以修改ovn北向数据库中逻辑转换端口logical_switch_port表中端口的绑定关系;
通过ovn-northd获取ovn北向数据库中的绑定关系,并更新ovn南向数据库中端口绑定port_binding表中端口的绑定关系。
可选地,生成绑定后的源节点对应的流表包括:
通过其余各节点的开放式虚拟网络控制器ovn-controller获取ovn南向数据库中的绑定关系;
根据绑定关系和开放式虚拟交换标准OVS生成流表。
可选地,当端口接收到流量时,由源节点对流量进行处理包括:
当端口接收到流量时,通过端口将流量传输至源节点和目的节点;
通过源节点将流量转发至虚拟机的网卡,以对流量中的报文进行处理。
可选地,在虚拟机迁移结束之后,还包括:
通过nova和neutron-server删除端口与源节点的绑定关系;
删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系;
删除源节点的流表。
可选地,删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系包括:
通过neutron-server下发删除端口与源节点的绑定关系的信息至ovn北向数据库,以删除ovn北向数据库中logical_switch_port表中端口与源节点的绑定关系;
通过ovn-northd获取ovn北向数据库中的删除的绑定关系,并删除ovn南向数据库中port_binding表中端口与源节点的绑定关系。
可选地,在删除源节点的流表之后,还包括:
当端口再次接收到流量时,由目的节点对流量进行处理。
可选地,当端口再次接收到流量时,由目的节点对流量进行处理包括:
当端口再次接收到流量时,通过端口将流量传输至目的节点;
通过目的节点将流量转发至虚拟机的网卡,以对流量中的报文进行处理。
可选地,在删除源节点的流表之后,还包括:
通过nova删除源节点的端口。
可选地,在通过nova删除源节点的端口之后,还包括:
删除源节点的虚拟机的资源。
可选地,在虚拟机迁移结束之后,还包括:
输出虚拟机迁移完成的提示信息。
可选地,在虚拟机迁移结束之后,还包括:
生成虚拟机的迁移日志,以记录虚拟机的迁移过程。
可选地,通过流表送到端口的流量被同时送到源节点和目的节点。
可选地,在通过nova和neutron-server更改端口的绑定关系,以将端口同时绑定至源节点和目的节点之后,方法还包括:记录端口同时绑定源节点和目的节点,并分别标记源节点为在线active,将目的节点标记为inactive非在线。
可选地,通过nova和neutron-server删除端口与源节点的绑定关系包括:nova通知neutron-server删除端口与源节点的绑定关系,neutron-server删除端口与源节点的绑定关系。
可选地,通过nova和neutron-server删除端口与源节点的绑定关系包括:将端口与源节点的绑定关系的删除结果同步更新到ovn北向数据库和ovn南向数据库中,使得ovn北向数据库和ovn南向数据库删除端口与源节点的绑定关系。
可选地,在删除源节点的流表之后,方法还包括:当端口再次接收到流量、且源节点收到流量中的报文时,源节点对报文丢弃。
为解决上述技术问题,本申请还提供一种虚拟机热迁移装置,包括:
迁移模块,被设置为基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;
绑定模块,被设置为设置源节点的端口同时绑定源节点和目的节点;
生成模块,被设置为生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;
处理模块,被设置为当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移 结束。
为解决上述技术问题,本申请还提供一种虚拟机热迁移设备,包括:
存储器,被设置为存储计算机程序;
处理器,被设置为执行计算机程序时实现上述的虚拟机热迁移方法的步骤。
为解决上述技术问题,本申请还提供一种非易失性可读存储介质,非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述的虚拟机热迁移方法的步骤。
本申请所提供的虚拟机热迁移方法,通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案在使用OpenStack开源项目OVN的网络环境中,不改变原有流量架构设计的基础上,修改和扩充原有表项的属性;可以通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包,提升产品的实用性及业务稳定性保障。
此外,本申请实施例还提供了一种虚拟机热迁移装置、设备及非易失性可读存储介质,效果同上。
附图说明
为了更清楚地说明本申请实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种虚拟机热迁移方法的流程图;
图2为本申请实施例提供的一种虚拟机热迁移装置的示意图;
图3为本申请实施例提供的一种虚拟机热迁移设备的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例, 都属于本申请保护范围。
本申请的核心是提供一种虚拟机热迁移方法、装置、设备及非易失性可读存储介质。
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和可选的实施方式对本申请作详细说明。
OVS是一款开源的“虚拟交换机”,控制协议方面它不但支持OpenFlow(一种网络通信协议)的所有特性,而且扩展了部分OpenFlow的功能。其中,OpenFlow是一种网络通信协议,属于数据链路层,能够控制网上交换器或路由器的转发平面(forwarding plane),借此改变网络数据包所走的网络路径。然而长期以来,OVS一直缺乏一个统一的网络模型,于是OVN诞生。OVN旨在为OVS提供一个控制平面,通过一个统一的网络模型为容器、虚拟机提供相同的网络服务。
OVN提供的是一个轻量级控制器,提供了比OVS更高层的抽象。OVN的轻量级不但体现在OVN本身的代码少、模型简单,而且它的流表设计(Pipeline)也容易理解。OVN是一系列守护程序,它们将虚拟网络配置转换为OpenFlow,并将其安装到OVS中。因此,目前比较先进的三层转发方案是基于OVN控制器重新对OVS流表进行规划,使OVS不仅仅提供二层转发,也提供三层转发,这样三层转发直接在OVS进程内就可以完成,提高了转发效率,减少了系统资源的消耗,并且OVN还具有先天分布式的优势。
在云服务实际使用过程中,虚拟机跨节点之间的迁移是云服务常用的功能。客户希望迁移过程中可以实现业务不中断,即能够达到零丢包的效果。原生OpenStack方案中,可通过提前创建接口设备(网络转发由多种接口配合实现)来保障迁移之前就能提供数据转发,从而实现零丢包。但基于OVN方案的数据转发由流表实现,无法通过提前创建接口来实现零丢包,导致虚拟机热迁移功能无法实现业务不中断。因此本申请实施例提供一种虚拟机热迁移的方法,能够实现迁移过程中业务不中断。图1为本申请实施例提供的一种虚拟机热迁移方法的流程图。如图1所示,方法包括:
S10:基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移。
在可选的实施中,首先基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移。可以理解的是,虚拟机迁移前位于源节点,虚拟机迁移后位于目的节点,迁移过程中主要复制虚拟机的内存数据到目的节点,并在目的节点中构建新的虚拟机。源节点和目的节点均为OVN分布式网络环境中的节点(chassis),可以为虚拟环境中的物理节点,可作为计算节点,也可作为网络节点,还可即为网络节点又为计算节点;同时节点需要部署ovn-controller(控制器)以及OVS相关的进程。
S11:设置源节点的端口同时绑定源节点和目的节点。
可选地,设置源节点的端口(port)同时绑定源节点和目的节点。端口port是指交换机的网口;对于硬件交换机来说,port是网卡接口组;对于软交换机来说,port是插入到网桥上的接口。在OVN分布式网络环境中,各节点均绑定一个端口,以用于通过端口访问对应节点。而在本实施例中将源节点的端口同时绑定源节点和目的节点,使对源节点的流量访问能够同时访问到目的节点。
作为一种可选的实施例,设置源节点的端口同时绑定源节点和目的节点,可以通过nova及neutron-server实现。nova是OpenStack云计算管理平台的计算组织控制器,用于管理OpenStack云中实例的生命周期的所有活动,是管理计算资源、网络认证所需的可扩展性平台。而neutron是OpenStack项目中负责提供网络服务的组件,它基于软件定义网络的思想,实现了网络虚拟化下的资源管理。neutron的设计目标是实现“网络即服务(Networking as a Service)”,在设计上遵循了基于软件定义网络(Software Defined Network,SDN)实现网络虚拟化的原则,在实现上充分利用了Linux系统上的各种网络相关的技术;neutron-server是其提供服务的一个进程。
可选地,通过nova响应虚拟机热迁移的动作,通知neutron-server进行更新,更新源节点的端口的绑定关系,同时绑定端口至源节点和目的节点;记录该端口同时绑定源节点和目的节点,并分别标记两个节点为active(在线)和inactive(非在线)。neutron-server下发绑定关系至ovn北向数据库,以修改ovn北向数据库中logical_switch_port表中端口的绑定关系。此时ovn-northd(Open Virtual Networking Northbound Daemon,开放的虚拟网络北向守护程序)感知到并获取ovn北向数据库中的更新后的绑定关系,更新ovn南向数据库中port_binding(端口绑定)表中端口的绑定关系。
需要注意的是,ovn北向数据库和ovn南向数据库是使用ovs-db的轻量级数据库。ovn-northd用于连接其上方的ovn北向数据库和下方的ovn南向数据库;它将传统网络概念中的逻辑网络配置(取自ovn北向数据库)转换为其下方ovn南向数据库中的逻辑数据路径流。通过ovn-northd使得ovn北向数据库中的绑定关系的更新同步到ovn南向数据库中,从而使得所有其余节点上的ovn-controller都感知到此端口绑定了两个节点。
此外,ovn-controller是一个在集群中的每个Hypervisor(又称虚拟机监视器(virtual machine monitor,VMM),是用来建立与执行虚拟机器的软件、固件或硬件)上的OVN agent(代理),北向连接ovn南向数据库。它将南向数据库中的逻辑流转换为OpenFlow for Open vSwitch(支持开放式虚拟交换标准的网络通信协议)。它还处理某些 流量,例如动态主机配置协议(Dynamic Host Configuration Protocol,DHCP)和域名系统(Domain Name System,DNS)。
S12:生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点。
可选地,生成绑定后的源节点对应的流表。流表即转发流表,由于端口绑定有两个节点(源节点和目的节点),因此所有通过转发流表送到此端口的流量同时送到源节点和目的节点。
可以理解的是,由于其余节点上的ovn-controller都通过ovn南向数据库中的port_binding表感知到此端口绑定了两个节点,因此可以通过其余各节点的ovn-controller获取ovn南向数据库中的绑定关系,根据绑定关系和OVS生成流表,以用于通过流表实现对源节点和目的节点的访问。
S13:当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。
在虚拟机热迁移过程中,当端口接收到流量时,由源节点对流量进行处理直至虚拟机迁移结束。
可以理解的是,由于虚拟机热迁移结束前,源节点中的虚拟机正常工作,而目的节点中的虚拟机未构建完成,因此作为一种可选的实施例,当端口接收到流量时,通过端口将流量传输至源节点和目的节点;源节点根据流表将流量转发至虚拟机的网卡,以对流量中的报文进行处理。由于目的节点中的虚拟机还在构建中,不具有应答报文的功能,因此不对报文进行处理。
本实施例中,通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案在使用OpenStack开源项目OVN的网络环境中,不改变原有流量架构设计的基础上,修改和扩充原有表项的属性;可以通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包,提升产品的实用性及业务稳定性保障。
在上述实施例的基础上,作为一种可选的实施例,在虚拟机迁移结束之后,还包括:
通过nova和neutron-server删除端口与源节点的绑定关系;
删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系;
删除源节点的流表。
可以理解的是,在通过nova迁移虚拟机完成后,由于目的节点上的虚拟机一直能收到报文,因此在虚拟机构建完成后能够直接提供服务,从而实现零丢包。此时虚拟机之前所在的源节点不再参与其他节点与虚拟机间的服务,因此作为一种可选的实施例,在迁移完成之后对源节点中的相关内容进行删除。
可选地,nova通知neutron-server删除端口与源节点的绑定关系,neutron-server删除端口与源节点的绑定关系,并同步更新到ovn北向数据库和ovn南向数据库中,从而使得ovn北向数据库和ovn南向数据库删除端口与源节点的绑定关系。最终,所有节点的ovn-cotroller均删除此端口与源节点的绑定关系,此端口的源节点删除对应的流表。
可选地,将端口与源节点的绑定关系的删除结果同步更新到ovn北向数据库和ovn南向数据库中,端口与源节点的绑定关系的删除结果可以但不限于包括需要删除的端口与源节点的绑定关系的标识,或者,将已删除的端口与源节点的绑定关系的删除结果等等,使得ovn北向数据库和ovn南向数据库删除端口与源节点的绑定关系。
为实现删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系,作为一种可选的实施例,可以通过neutron-server下发删除端口与源节点的绑定关系的信息至ovn北向数据库,以删除ovn北向数据库中logical_switch_port表中端口与源节点的绑定关系。通过ovn-northd获取ovn北向数据库中的删除的绑定关系,并删除ovn南向数据库中port_binding表中端口与源节点的绑定关系,最终实现了数据库中端口与源节点的绑定关系的删除。
在上述实施例的基础上,作为一种可选的实施例,在删除源节点的流表之后,还包括:
当端口再次接收到流量时,由目的节点对流量进行处理。
在可选的实施中,由于虚拟机迁移完成之后删除了端口与源节点的绑定关系,并删除了源节点对应的流表,则当端口再次接收到流量时,由目的节点对流量进行处理。
可选地,当端口再次接收到流量时,通过端口将流量传输至目的节点;通过目的节点将流量转发至虚拟机的网卡,以对流量中的报文进行处理。而源节点即使收到对应的报文(比如广播),由于源节点没有了此端口的流表,故认为不是送到本节点的流量,对报文直接丢弃。
在上述实施例的基础上,作为一种可选的实施例,在删除源节点的流表之后,还包括:
通过nova删除源节点的端口。
在可选的实施中,为更加节省分布式资源,作为一种可选的实施例,在删除源节点的流 表之后,通过nova删除源节点上的端口。此外,删除源节点的虚拟机的资源,释放了源节点的存储空间,并最终实现了虚拟机的热迁移。
为更好地提升虚拟机热迁移的操作体验,作为一种可选的实施例,在虚拟机迁移结束之后,还包括:
输出虚拟机迁移完成的提示信息。
可以理解的是,在虚拟机迁移结束之后输出虚拟机迁移完成的提示信息,可使用户及时获知虚拟机迁移完成,以便于后续对虚拟机的相关操作或访问。
此外,在输出提示信息后还可生成虚拟机的迁移日志,以记录虚拟机的迁移过程。用户可通过迁移日志了解到整个虚拟机的迁移过程,以对迁移进行回溯或审计,提高了虚拟机热迁移的安全性。
在上述实施例中,对于虚拟机热迁移方法进行了详细描述,本申请还提供虚拟机热迁移装置对应的实施例。
图2为本申请实施例提供的一种虚拟机热迁移装置的示意图。如图2所示,虚拟机热迁移装置包括:
迁移模块10,被设置为基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移。
绑定模块11,被设置为设置源节点的端口同时绑定源节点和目的节点。
生成模块12,被设置为生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点。
处理模块13,被设置为当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。
作为一种可选的实施例,设置源节点的端口同时绑定源节点和目的节点包括:
通过nova和neutron-server更改端口的绑定关系,以将端口同时绑定至源节点和目的节点;
通过neutron-server下发绑定关系至ovn北向数据库,以修改ovn北向数据库中logical_switch_port表中端口的绑定关系;
通过ovn-northd获取ovn北向数据库中的绑定关系,并更新ovn南向数据库中port_binding表中端口的绑定关系。
作为一种可选的实施例,生成绑定后的源节点对应的流表包括:
通过其余各节点的ovn-controller获取ovn南向数据库中的绑定关系;
根据绑定关系和OVS生成流表。
作为一种可选的实施例,当端口接收到流量时,由源节点对流量进行处理包括:
当端口接收到流量时,通过端口将流量传输至源节点和目的节点;
通过源节点将流量转发至虚拟机的网卡,以对流量中的报文进行处理。
作为一种可选的实施例,在虚拟机迁移结束之后,还包括:
通过nova和neutron-server删除端口与源节点的绑定关系;
删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系;
删除源节点的流表。
作为一种可选的实施例,删除ovn北向数据库和ovn南向数据库中的端口与源节点的绑定关系包括:
通过neutron-server下发删除端口与源节点的绑定关系的信息至ovn北向数据库,以删除ovn北向数据库中logical_switch_port表中端口与源节点的绑定关系;
通过ovn-northd获取ovn北向数据库中的删除的绑定关系,并删除ovn南向数据库中port_binding表中端口与源节点的绑定关系。
作为一种可选的实施例,在删除源节点的流表之后,还包括:
当端口再次接收到流量时,由目的节点对流量进行处理。
作为一种可选的实施例,当端口再次接收到流量时,由目的节点对流量进行处理包括:
当端口再次接收到流量时,通过端口将流量传输至目的节点;
通过目的节点将流量转发至虚拟机的网卡,以对流量中的报文进行处理。
作为一种可选的实施例,在删除源节点的流表之后,还包括:
通过nova删除源节点的端口。
作为一种可选的实施例,在通过nova删除源节点的端口之后,还包括:
删除源节点的虚拟机的资源。
作为一种可选的实施例,在虚拟机迁移结束之后,还包括:
输出虚拟机迁移完成的提示信息。
作为一种可选的实施例,在虚拟机迁移结束之后,还包括:
生成虚拟机的迁移日志,以记录虚拟机的迁移过程。
本实施例中,虚拟机热迁移装置包括迁移模块、绑定模块、生成模块和处理模块。通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口 的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案在使用OpenStack开源项目OVN的网络环境中,不改变原有流量架构设计的基础上,修改和扩充原有表项的属性;通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包,提升产品的实用性及业务稳定性保障。
图3为本申请实施例提供的一种虚拟机热迁移设备的示意图。如图3所示,虚拟机热迁移设备包括:
存储器20,被设置为存储计算机程序。
处理器21,被设置为执行计算机程序时实现如上述实施例中所提到的虚拟机热迁移方法的步骤。
本实施例提供的虚拟机热迁移设备可以包括但不限于智能手机、平板电脑、笔记本电脑或台式电脑等。
其中,处理器21可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器21可以采用数字信号处理器(Digital Signal Processor,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器21也可以包括主处理器和协处理器,主处理器是被设置为对在唤醒状态下的数据进行处理的处理器,也称中央处理器(Central Processing Unit,CPU);协处理器是被设置为对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器21可以在集成有图形处理器(Graphics Processing Unit,GPU),GPU被设置为负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器21还可以包括人工智能(Artificial Intelligence,AI)处理器,该AI处理器被设置为处理有关机器学习的计算操作。
存储器20可以包括一个或多个非易失性可读存储介质,该非易失性可读存储介质可以是非暂态的。存储器20还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。本实施例中,存储器20至少被设置为存储以下计算机程序201,其中,该计算机程序被处理器21加载并执行之后,能够实现前述任一实施例公开的虚拟机热迁移方法的相关步骤。另外,存储器20所存储的资源还可以包括操作系统202和数据203等,存储方式可以是短暂存储或者永久存储。其中,操作系统202可以包括Windows、Unix、Linux等。数据203可以包括但不限于虚拟机热迁移方法涉及到的数据。
在一些实施例中,虚拟机热迁移设备还可包括有显示屏22、输入输出接口23、通信接口24、电源25以及通信总线26。
本领域技术人员可以理解,图3中示出的结构并不构成对虚拟机热迁移设备的限定,可以包括比图示更多或更少的组件。
本实施例中,虚拟机热迁移设备包括存储器和处理器。存储器被设置为存储计算机程序,处理器被设置为执行计算机程序时实现如上述实施例中所提到的虚拟机热迁移方法的步骤。通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案在使用OpenStack开源项目OVN的网络环境中,不改变原有流量架构设计的基础上,修改和扩充原有表项的属性;可以通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包,提升产品的实用性及业务稳定性保障。
最后,本申请还提供一种非易失性可读存储介质对应的实施例。非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述方法实施例中记载的步骤。
可以理解的是,如果上述实施例中的方法以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个非易失性可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个非易失性可读存储介质中,执行本申请各个实施例方法的全部或部分步骤。而前述的非易失性可读存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的非易失性可读存储介质。
本实施例中,非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述方法实施例中记载的步骤。通过基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;设置源节点的端口同时绑定源节点和目的节点;生成绑定后的源节点对应的流表,以用于通过流表访问绑定端口的源节点和目的节点;当端口接收到流量时,由源节点对流量进行处理,直至虚拟机迁移结束。由此可知,上述方案在使用OpenStack开源项目OVN的网络环境中,不改变原有流量架构设计的基础上,修改和扩充原有表项的属性;可以通过设置源节点的端口同时绑定源节点和目的节点,允许一个端口绑定两个节点;送往 此端口的流量报文能够同时送到两个节点。目的节点提前收到流量报文且具备流表提供的转发功能,保证在迁移过程中没有报文丢失的情况,从而实现热迁移零丢包,提升产品的实用性及业务稳定性保障。
以上对本申请所提供的一种虚拟机热迁移方法、装置、设备及非易失性可读存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括上述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (20)

  1. 一种虚拟机热迁移方法,其特征在于,包括:
    基于开放式虚拟网络OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;
    设置所述源节点的端口同时绑定所述源节点和所述目的节点;
    生成绑定后的所述源节点对应的流表,以用于通过所述流表访问绑定所述端口的所述源节点和所述目的节点;
    当所述端口接收到流量时,由所述源节点对所述流量进行处理,直至所述虚拟机迁移结束。
  2. 根据权利要求1所述的虚拟机热迁移方法,其特征在于,所述设置所述源节点的端口同时绑定所述源节点和所述目的节点包括:
    通过计算组织控制器nova和组件服务器neutron-server更改所述端口的绑定关系,以将所述端口同时绑定至所述源节点和所述目的节点;
    通过所述neutron-server下发所述绑定关系至ovn北向数据库,以修改所述ovn北向数据库中逻辑转换端口logical_switch_port表中所述端口的所述绑定关系;
    通过开放的虚拟网络北向守护程序ovn-northd获取所述ovn北向数据库中的所述绑定关系,并更新ovn南向数据库中端口绑定port_binding表中所述端口的所述绑定关系。
  3. 根据权利要求2所述的虚拟机热迁移方法,其特征在于,所述生成绑定后的所述源节点对应的流表包括:
    通过其余各节点的开放式虚拟网络控制器ovn-controller获取所述ovn南向数据库中的所述绑定关系;
    根据所述绑定关系和开放式虚拟交换标准OVS生成所述流表。
  4. 根据权利要求1所述的虚拟机热迁移方法,其特征在于,所述当所述端口接收到流量时,由所述源节点对所述流量进行处理包括:
    当所述端口接收到流量时,通过所述端口将所述流量传输至所述源节点和所述目的节点;
    通过所述源节点将所述流量转发至所述虚拟机的网卡,以对所述流量中的报文进行处理。
  5. 根据权利要求2所述的虚拟机热迁移方法,其特征在于,在所述虚拟机迁移结束 之后,还包括:
    通过所述nova和所述neutron-server删除所述端口与所述源节点的所述绑定关系;
    删除所述ovn北向数据库和所述ovn南向数据库中的所述端口与所述源节点的所述绑定关系;
    删除所述源节点的所述流表。
  6. 根据权利要求5所述的虚拟机热迁移方法,其特征在于,所述删除所述ovn北向数据库和所述ovn南向数据库中的所述端口与所述源节点的所述绑定关系包括:
    通过所述neutron-server下发删除所述端口与所述源节点的所述绑定关系的信息至所述ovn北向数据库,以删除所述ovn北向数据库中所述logical_switch_port表中所述端口与所述源节点的所述绑定关系;
    通过ovn-northd获取所述ovn北向数据库中的删除的所述绑定关系,并删除所述ovn南向数据库中所述port_binding表中所述端口与所述源节点的所述绑定关系。
  7. 根据权利要求5所述的虚拟机热迁移方法,其特征在于,在删除所述源节点的所述流表之后,还包括:
    当所述端口再次接收到所述流量时,由所述目的节点对所述流量进行处理。
  8. 根据权利要求7所述的虚拟机热迁移方法,其特征在于,所述当所述端口再次接收到所述流量时,由所述目的节点对所述流量进行处理包括:
    当所述端口再次接收到所述流量时,通过所述端口将所述流量传输至所述目的节点;
    通过所述目的节点将所述流量转发至所述虚拟机的网卡,以对所述流量中的报文进行处理。
  9. 根据权利要求5所述的虚拟机热迁移方法,其特征在于,在删除所述源节点的所述流表之后,还包括:
    通过所述nova删除所述源节点的所述端口。
  10. 根据权利要求9所述的虚拟机热迁移方法,其特征在于,在所述通过所述nova删除所述源节点的所述端口之后,还包括:
    删除所述源节点的所述虚拟机的资源。
  11. 根据权利要求1至10任意一项所述的虚拟机热迁移方法,其特征在于,在所述虚拟机迁移结束之后,还包括:
    输出所述虚拟机迁移完成的提示信息。
  12. 根据权利要求11所述的虚拟机热迁移方法,其特征在于,在所述虚拟机迁移结 束之后,还包括:
    生成所述虚拟机的迁移日志,以记录所述虚拟机的迁移过程。
  13. 根据权利要求1所述的虚拟机热迁移方法,其特征在于,通过所述流表送到所述端口的流量被同时送到所述源节点和所述目的节点。
  14. 根据权利要求2所述的虚拟机热迁移方法,其特征在于,在所述通过nova和neutron-server更改所述端口的绑定关系,以将所述端口同时绑定至所述源节点和所述目的节点之后,所述方法还包括:
    记录所述端口同时绑定所述源节点和所述目的节点,并分别标记所述源节点为在线,将所述目的节点标记为非在线。
  15. 根据权利要求5所述的虚拟机热迁移方法,其特征在于,所述通过所述nova和所述neutron-server删除所述端口与所述源节点的所述绑定关系包括:
    所述nova通知所述neutron-server删除所述端口与所述源节点的绑定关系,所述neutron-server删除所述端口与所述源节点的绑定关系。
  16. 根据权利要求15所述的虚拟机热迁移方法,其特征在于,所述通过nova和neutron-server删除端口与源节点的绑定关系包括:
    将所述端口与所述源节点的绑定关系的删除结果同步更新到所述ovn北向数据库和所述ovn南向数据库中,使得所述ovn北向数据库和所述ovn南向数据库删除所述端口与所述源节点的绑定关系。
  17. 根据权利要求7所述的虚拟机热迁移方法,其特征在于,在删除所述源节点的所述流表之后,所述方法还包括:
    当所述端口再次接收到所述流量、且所述源节点收到所述流量中的报文时,所述源节点对所述报文丢弃。
  18. 一种虚拟机热迁移装置,其特征在于,包括:
    迁移模块,被设置为基于OVN分布式网络环境启动位于源节点的虚拟机向目的节点的迁移;
    绑定模块,被设置为设置所述源节点的端口同时绑定所述源节点和所述目的节点;
    生成模块,被设置为生成绑定后的所述源节点对应的流表,以用于通过所述流表访问绑定所述端口的所述源节点和所述目的节点;
    处理模块,被设置为当所述端口接收到流量时,由所述源节点对所述流量进行处理,直至所述虚拟机迁移结束。
  19. 一种虚拟机热迁移设备,其特征在于,包括:
    存储器,被设置为存储计算机程序;
    处理器,被设置为执行所述计算机程序时实现如权利要求1至17任一项所述的虚拟机热迁移方法的步骤。
  20. 一种非易失性可读存储介质,其特征在于,所述非易失性可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至17任一项所述的虚拟机热迁移方法的步骤。
PCT/CN2023/105551 2022-11-15 2023-07-03 虚拟机热迁移方法、装置、设备及非易失性可读存储介质 WO2024103800A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211422892.5A CN115499298B (zh) 2022-11-15 2022-11-15 一种虚拟机热迁移方法、装置、设备及介质
CN202211422892.5 2022-11-15

Publications (1)

Publication Number Publication Date
WO2024103800A1 true WO2024103800A1 (zh) 2024-05-23

Family

ID=85115730

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/105551 WO2024103800A1 (zh) 2022-11-15 2023-07-03 虚拟机热迁移方法、装置、设备及非易失性可读存储介质

Country Status (2)

Country Link
CN (1) CN115499298B (zh)
WO (1) WO2024103800A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118264540A (zh) * 2024-05-31 2024-06-28 济南浪潮数据技术有限公司 一种开放虚拟网络控制面容灾方法、装置、产品及介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499298B (zh) * 2022-11-15 2023-02-28 济南浪潮数据技术有限公司 一种虚拟机热迁移方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107465626A (zh) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 一种虚拟机热迁移方法及装置
WO2018131547A1 (ja) * 2017-01-16 2018-07-19 富士通株式会社 ポート切替プログラム、ポート切替方法、および情報処理装置
CN111221561A (zh) * 2020-01-14 2020-06-02 平安科技(深圳)有限公司 流表更新方法、装置、系统、计算机设备及存储介质
US20210334124A1 (en) * 2020-04-28 2021-10-28 International Business Machines Corporation Virtual machine live migration with seamless network connectivity
CN115499298A (zh) * 2022-11-15 2022-12-20 济南浪潮数据技术有限公司 一种虚拟机热迁移方法、装置、设备及介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103534994B (zh) * 2011-12-26 2017-08-25 华为技术有限公司 一种虚拟机迁移后实现通信的方法、设备和系统
WO2014032233A1 (zh) * 2012-08-29 2014-03-06 华为技术有限公司 虚拟机热迁移的系统和方法
CN107544841B (zh) * 2016-06-29 2022-12-02 中兴通讯股份有限公司 虚拟机热迁移方法和系统
CN108768895B (zh) * 2018-05-18 2021-02-23 华为技术有限公司 一种虚拟机迁移的方法及数据中心
CN111064649B (zh) * 2019-12-11 2022-02-15 锐捷网络股份有限公司 一种分层端口绑定实现方法、装置、控制设备及存储介质
CN114003334A (zh) * 2020-07-28 2022-02-01 中移(苏州)软件技术有限公司 虚拟机热迁移网络中断的优化方法、装置、设备、存储介质和系统
CN114064217B (zh) * 2021-11-29 2024-04-19 建信金融科技有限责任公司 一种基于OpenStack的节点虚拟机迁移方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107465626A (zh) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 一种虚拟机热迁移方法及装置
WO2018131547A1 (ja) * 2017-01-16 2018-07-19 富士通株式会社 ポート切替プログラム、ポート切替方法、および情報処理装置
CN111221561A (zh) * 2020-01-14 2020-06-02 平安科技(深圳)有限公司 流表更新方法、装置、系统、计算机设备及存储介质
US20210334124A1 (en) * 2020-04-28 2021-10-28 International Business Machines Corporation Virtual machine live migration with seamless network connectivity
CN115499298A (zh) * 2022-11-15 2022-12-20 济南浪潮数据技术有限公司 一种虚拟机热迁移方法、装置、设备及介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118264540A (zh) * 2024-05-31 2024-06-28 济南浪潮数据技术有限公司 一种开放虚拟网络控制面容灾方法、装置、产品及介质

Also Published As

Publication number Publication date
CN115499298B (zh) 2023-02-28
CN115499298A (zh) 2022-12-20

Similar Documents

Publication Publication Date Title
WO2024103800A1 (zh) 虚拟机热迁移方法、装置、设备及非易失性可读存储介质
CN107947961B (zh) 基于SDN的Kubernetes网络管理系统与方法
US10666609B2 (en) Management of domain name systems in a large-scale processing environment
WO2021017279A1 (zh) 基于Kubernetes和网络域的集群安全管理方法、装置及存储介质
Wood et al. CloudNet: dynamic pooling of cloud resources by live WAN migration of virtual machines
EP2725737B1 (en) Network policy configuration method, management device and network management centre device
CN103095834B (zh) 一种跨虚拟化数据中心的虚拟机在线迁移方法
CN112398687B (zh) 云计算网络的配置方法、云计算网络系统以及存储介质
US20130332577A1 (en) Multitenant server for virtual networks within datacenter
CN104199722A (zh) 一种虚拟计算机存储服务系统及其使用方法
WO2014101218A1 (zh) 一种计算存储融合的集群系统
CN106953848B (zh) 一种基于ForCES的软件定义网络实现方法
US11997015B2 (en) Route updating method and user cluster
WO2023056722A1 (zh) 一种分布式防火墙定义方法及系统
CN105359176B (zh) 更新先前递送的电子消息的接收者
WO2024088217A1 (zh) 私有网络的访问方法和系统
Han et al. ONVisor: Towards a scalable and flexible SDN‐based network virtualization platform on ONOS
CN110855488B (zh) 一种虚拟机接入方法及装置
EP4191907A1 (en) Vnf instantiation method and apparatus
CN114489931A (zh) 一种函数实例的容器创建方法及系统
CN104135379B (zh) 基于OpenFlow协议的端口控制方法及装置
CN115622878A (zh) k8s网桥插件实现方法、装置、电子设备和可读存储介质
CN114996053A (zh) 一种远程卷复制传输方法、系统、装置及存储介质
CN118264617B (zh) 一种重叠网络数据传输方法、系统、设备及存储介质
WO2024199358A1 (zh) 虚拟网络控制方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23890242

Country of ref document: EP

Kind code of ref document: A1