Virtual-machine state switching method and apparatus, and device cluster and readable storage medium

By creating a second virtual machine in the cloud management platform and configuring its message exchange mechanism, online switching of virtual machine states was achieved, solving the business interruption problem that required shutting down virtual machines in existing technologies, and improving switching efficiency and performance.

WO2026066083A1PCT designated stage Publication Date: 2026-04-02HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Existing technologies require shutting down the virtual machine when switching virtual machine states, which leads to service interruption. It is impossible to achieve the transition from kernel mode to user mode or unloaded mode without shutting down the virtual machine.

Method used

After receiving the switching request, the cloud management platform creates a second virtual machine and configures its message exchange mechanism, then hot-migrates the first virtual machine to the second virtual machine, realizing online switching of data packet processing methods and ensuring that the state switch is completed without shutting down the virtual machine.

Benefits of technology

This reduced losses caused by business interruptions and improved the efficiency and performance of virtual machine state switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025092524_02042026_PF_FP_ABST
    Figure CN2025092524_02042026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are a virtual-machine state switching method and apparatus, and a device cluster and a readable storage medium, which relate to the technical field of virtualization. The method comprises: during the processing of virtual-machine state switching, after having received a switching request of a first virtual machine, creating a second virtual machine in a host machine that runs the first virtual machine, and on the basis of a second state indicated by the switching request, configuring a message exchange mechanism of the second virtual machine; and live-migrating the first virtual machine to the configured second virtual machine, so as to implement online switching of a message exchange mechanism in the first virtual machine. In this way, a data packet processing method between a first virtual machine and a client is switched without shutting down the first virtual machine. Thus, losses caused by service interruptions are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Virtual machine state switching method and device, equipment cluster and readable storage medium

[0001] The present application claims priority to the Chinese patent application No. 202411375373.7, filed on September 29, 2024, and entitled "Virtual machine state switching method, device, equipment cluster and readable storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of virtualization technology, and more particularly, to a virtual machine state switching method, device, equipment cluster and readable storage medium. BACKGROUND

[0003] Virtualization technology is a computer resource management technology. In a virtualization system, physical resources such as computing (central processing unit (CPU) + memory), network and storage can be abstracted and divided into multiple virtual entities, so that multiple operating systems can share physical resources. For example, in a cloud platform scenario, computing, storage and network services provided to tenants are provided in a virtualized manner.

[0004] In virtualization technology, data paths can be divided into kernel mode forwarding, user mode forwarding and offload mode forwarding according to different functional modules for sending and receiving messages in a virtual machine. The kernel mode forwarding is to implement the sending and receiving of messages in the kernel space. The user mode forwarding is to implement the sending and receiving of messages in the user space. The offload mode forwarding is to implement the sending and receiving of messages by an intelligent network card.

[0005] The kernel mode is difficult to add new functions, while the user mode / offload mode as the mainstream technology form can continue to evolve and has better performance. Therefore, it is necessary to implement the conversion from the kernel mode to the user mode / offload mode. Currently, to convert the kernel mode to the user mode / offload mode, the virtual machine needs to be stopped, which will cause business interruption and loss. Therefore, how to implement the conversion between the kernel mode and the user mode / offload mode without stopping the virtual machine has become a technical problem to be solved. SUMMARY

[0006] The present application provides a virtual machine state switching method, device, equipment cluster and readable storage medium to implement the conversion between the kernel mode and the user mode / offload mode without stopping the virtual machine.

[0007] In a first aspect, the application provides a virtual machine state switching method. When a switching request of a first virtual machine is received by a cloud management platform, a second virtual machine is created in a first computing node running the first virtual machine, a message exchange mechanism of the second virtual machine is configured based on a second state indicated by the switching request, and the first virtual machine is hot migrated to the configured second virtual machine. The data packets between the cloud management platform and the client are processed by the configured second virtual machine.

[0008] Based on the first aspect, the second virtual machine is created in the host running the first virtual machine, and the message exchange mechanism of the second virtual machine is configured based on the second state indicated by the switching request. The first virtual machine is hot migrated to the configured second virtual machine, and the online switching of the message exchange mechanism in the first virtual machine is realized. In this way, the processing mode of the data packets between the cloud management platform and the client is switched without shutting down the first virtual machine, thereby reducing the loss caused by business interruption.

[0009] In an optional implementation, the second virtual machine includes a user space and a virtual network card. In the implementation of configuring the message exchange mechanism of the second virtual machine, the cloud management platform switches a first IO control channel of the second virtual machine to a second IO control channel, and switches a first transmission protocol of the second virtual machine to a second transmission protocol.

[0010] The second IO control channel is related to the second state, and is used to indicate an IO channel for managing the second virtual machine in the user space or the virtual network card.

[0011] The second transmission protocol is related to the second state, and is used to indicate forwarding of the data packets between the second virtual machine and the client in the user space or through the virtual network card.

[0012] Based on this optional implementation, the cloud management platform realizes the switching of the virtual machine at the control level and the data level according to the second state, ensures that the configured second virtual machine is adapted to the second state on the data path and the control path, and guarantees the running performance of the configured second virtual machine.

[0013] In an optional implementation, the second virtual machine includes a kernel space, a user space, and a virtual network card. In the implementation of configuring the message exchange mechanism of the second virtual machine, the cloud management platform switches a first transmission protocol of the second virtual machine to a second transmission protocol. The second transmission protocol is related to the second state.

[0014] Optionally, the second transmission protocol is used to indicate forwarding of the data packets between the second virtual machine and the client in the user space or through the virtual network card.

[0015] Optionally, the configured second virtual machine and the first virtual machine both manage the IO channel of the virtual machine in the kernel space, or the configured second virtual machine and the first virtual machine both manage the IO channel of the virtual machine in the user space.

[0016] Based on the optional implementation, in the implementation of the virtual machine state switching, the second virtual machine after the switching and the first virtual machine before the switching are consistent in the control level, only the data level switching is realized through the transmission protocol, the steps of the virtual machine state switching are simplified, and the efficiency of the virtual machine state switching is improved.

[0017] In an optional implementation, the second virtual machine includes a kernel space and a user space. In the implementation of the message exchange mechanism of the configured second virtual machine, the data packet of the kernel space is forwarded to the user space when the second state is the user state.

[0018] Optionally, the first port is arranged in the user space, and the second port is arranged in the kernel space. The cloud management platform forwards the packet to the first port based on the second port.

[0019] In this way, in the implementation of the virtual machine state switching, the data packet in the kernel space is forwarded to the user space, and the data packet is processed in the user space, so that the switching of the data transmission path can be realized without changing the IO control channel and the transmission protocol of the second virtual machine. The steps of the virtual machine state switching are simplified, and the efficiency of the virtual machine state switching is improved.

[0020] In an optional implementation, the first virtual machine and the second virtual machine have the same resources; the resources include: computing resources, storage resources, and virtual network cards.

[0021] In this way, the first virtual machine and the second virtual machine have the same resources in the same host, so that the virtual machine state switching can be realized without reissuing the virtual machine resources.

[0022] In an optional implementation, the second virtual machine includes a user space and a virtual network card. In the implementation of the configured second virtual machine processing the data packet between the cloud management platform and the client, the configured second virtual machine processes the data packet between the cloud management platform and the client in the user space when the second state is the user state. The configured second virtual machine processes the data packet between the cloud management platform and the client through the virtual network card when the second state is the offload state.

[0023] In this way, the data packet is processed in the user state or the virtual network card based on the second state, and the data transmission performance is improved.

[0024] In an alternative implementation, the hot migration of the first virtual machine to the configured second virtual machine is implemented as follows: in the case that the first virtual machine is executing a first task, migrating the state information of the first virtual machine to the configured second virtual machine. In the case that the online migration of the first virtual machine is successful, starting the configured second virtual machine, and executing the first task by the configured second virtual machine.

[0025] Based on the alternative implementation, in the process of virtual machine migration, the state information of the first virtual machine is migrated to the configured second virtual machine by hot migration without stopping the first virtual machine, and since the configured second virtual machine runs according to the second state, the virtual machine state switching can be realized without restarting the virtual machine. Moreover, since the first virtual machine and the second virtual machine run in the same host and have the same resources, the virtual machine state switching can be realized without re-allocating the virtual machine resources.

[0026] In a second aspect, the present application provides a virtual machine state switching device. The virtual machine state switching device is deployed in a cloud management platform; the cloud management platform includes a first computing node, and the first computing node is deployed with a first virtual machine; the device includes a communication module, a processing module, and a storage module.

[0027] The communication module is configured to acquire a switching request of the first virtual machine; the switching request is configured to indicate switching the first virtual machine from a first state to a second state, the first state is a kernel state, and the second state is a user state or an offload state; or, the first state is a user state, and the second state is an offload state.

[0028] The processing module is configured to, in response to the switching request, create a second virtual machine in the first computing node, configure a message exchange mechanism of the second virtual machine according to the second state to obtain a configured second virtual machine, and hot migrate the first virtual machine to the configured second virtual machine to process data packets between the cloud management platform and the client by the configured second virtual machine; the message exchange mechanism is configured to indicate a data packet processing manner between the cloud management platform and the client; and the configured second virtual machine runs according to the second state.

[0029] The storage module is configured to store data and instructions of the virtual machine state switching device in the process of processing the virtual machine state.

[0030] In a third aspect, the present application provides a virtual machine state switching system, including a client and a virtual machine state switching device.

[0031] The client is configured to send a switching request of a first virtual machine to the virtual machine state switching device.

[0032] The virtual machine state switching apparatus is configured to acquire a switching request of a first virtual machine, and execute the method provided in the first aspect or any of the optional implementation manners of the first aspect.

[0033] In a fourth aspect, the present application provides a computing device cluster comprising at least one computing device. Each computing device comprises a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the first aspect or any of the optional implementation manners of the first aspect.

[0034] In a fifth aspect, the present application provides a computer readable storage medium comprising computer program instructions, when the computer program instructions are executed by a computing device cluster, the computing device executes the method provided in the first aspect or any of the optional implementation manners of the first aspect.

[0035] In a sixth aspect, the present application provides a computer program product comprising instructions, when the instructions are executed by a computing device, the computing device cluster executes the method provided in the first aspect or any of the optional implementation manners of the first aspect.

[0036] The beneficial effects of the second aspect to the sixth aspect can refer to the description of the first aspect or any of the optional implementation manners of the first aspect, and will not be described here. On the basis of the implementation manners provided in the above aspects, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS

[0037] FIG. 1 is a forwarding schematic diagram of a virtual machine in different states;

[0038] FIG. 2 is a schematic diagram of a cloud service system provided by an embodiment of the present application;

[0039] FIG. 3 is a schematic diagram of a host structure provided by an embodiment of the present application;

[0040] FIG. 4 is a flowchart of a virtual machine state switching method provided by an embodiment of the present application;

[0041] FIG. 5A is a schematic diagram of virtual machine state switching provided by an embodiment of the present application;

[0042] FIG. 5B is a schematic diagram of virtual machine state switching provided by an embodiment of the present application;

[0043] FIG. 5C is a schematic diagram of virtual machine state switching provided by an embodiment of the present application;

[0044] FIG. 6 is a flowchart of a message exchange mechanism for configuring a virtual machine 2 provided by an embodiment of the present application;

[0045] FIG. 7 is a flow diagram illustrating a second example of a message exchange mechanism for configuring a virtual machine 2 according to an embodiment of the present application;

[0046] FIG. 8A is a diagram illustrating a first example of deploying an adaptation module according to an embodiment of the present application;

[0047] FIG. 8B is a diagram illustrating a second example of deploying an adaptation module according to an embodiment of the present application;

[0048] FIG. 8C is a diagram illustrating a third example of deploying an adaptation module according to an embodiment of the present application;

[0049] FIG. 9 is a flow diagram illustrating a virtual machine migration process according to an embodiment of the present application;

[0050] FIG. 10 is a flow diagram illustrating a second example of a virtual machine state switching method according to an embodiment of the present application;

[0051] FIG. 11 is a diagram illustrating a structure of a virtual machine state switching apparatus according to an embodiment of the present application;

[0052] FIG. 12 is a diagram illustrating a structure of a virtual machine state switching system according to an embodiment of the present application;

[0053] FIG. 13 is a diagram illustrating a structure of a computing device according to an embodiment of the present application;

[0054] FIG. 14 is a diagram illustrating a structure of a computing device cluster according to an embodiment of the present application;

[0055] FIG. 15 is a diagram illustrating a network connection between computing devices in a computing device cluster according to an embodiment of the present application. DETAILED DESCRIPTION

[0056] In the process of data transmission between the front end of a virtual machine and the back end of the virtual machine, the virtual machine state can be classified into kernel mode, user mode and offload mode according to different data transmission paths. During the running of the virtual machine, the virtual machine state can be switched, for example, from kernel mode to user mode, or from user mode to offload mode. However, the virtual machine state switching currently needs to stop the virtual machine.

[0057] The embodiments of the present application provide a virtual machine state switching method, which can realize the virtual machine state switching without stopping the virtual machine. Specifically, a cloud management platform receives a switching request of a first virtual machine, creates a second virtual machine in a host machine running the first virtual machine, and configures a message exchange mechanism of the second virtual machine based on a second state indicated by the switching request. The first virtual machine is migrated to the configured second virtual machine, and the online switching of the message exchange mechanism in the first virtual machine is realized. In this way, the virtual machine state switching is realized without stopping the first virtual machine.

[0058] To better understand the virtual machine switching method provided in this application, the implementation of the virtual machine switching method will be described below with reference to specific embodiments. First, the terms involved in the embodiments of this application will be introduced.

[0059] Virtualization is the process of virtualizing hardware resources (such as processors, memory, and network resources) in a computer device and sharing them among multiple virtual machines. A virtual computer is a general term for the runtime environment created through software virtualization in all types of virtualization devices. This concept includes virtual machines or containers.

[0060] In related technologies, virtualization can be achieved through high-performance virtualization technology (Kernel-based Virtual Machine, KVM) and open-source emulators and virtual machines (Quick Emulator, QEMU).

[0061] KVM is a built-in... KVM is an open-source virtualization technology. Specifically, it can be used to... It transforms into a virtual machine monitor, enabling the host computer to run multiple isolated virtual environments, namely virtual guests or virtual machines (VMs).

[0062] QEMU is a virtualization technology used to implement hardware virtualization, such as the virtualization of input / output (I / O) devices.

[0063] In the implementation of virtualization of I / O device by QEMU, the virtualized I / O device complies with the Virtual IO (VirtIO) standard. The VirtIO standard provides a simple, efficient, standardized and scalable virtual device interface for virtual environment and operating environment by defining control path and data path. The control path can also be referred to as control channel or I / O control channel. The control path can refer to the process of configuring and managing the virtualized I / O device, thereby being compatible with different devices and manufacturers. For example, the control establishes or deletes the data path between the front-end (Front-end) and the back-end (Back-end). The Front-end is located inside the virtual machine and is used to process the I / O request of the virtual machine application and forward the request to the Back-end. And receive the response sent by the Back-end and deliver the data to the corresponding application. For example, the Front-end is used to interact with the client corresponding to the virtual machine, receive the I / O request sent by the client, and send the processed data to the client. The Back-end is located on the host and directly interacts with the physical hardware on the host. The Back-end can be used to receive the I / O request sent by the Front-end and convert it into actual hardware operation; and process the hardware response and feed back the result to the Front-end.

[0064] The data path refers to the actual transmission process of data from one point to another point. For example, the data transmission process between the Front-end and the Back-end.

[0065] In the implementation of virtualization of I / O device by QEMU, the control path can be implemented according to the VirtIO Spec, and the data path can be implemented by bypassing QEMU, using kernel-level forwarding (vhost-net), user-level forwarding (vhost-user) and offload-level forwarding.

[0066] The kernel state can also be referred to as kernel space, which is the area where the kernel process and / or kernel thread are located, and is mainly responsible for running the system, hardware interaction, etc. In the kernel state, the CPU can access all data of the memory, including peripheral devices such as hard disk, network card, etc. At the same time, the CPU can also realize program switching.

[0067] The user state can also be referred to as user space, which is the area where the user process and / or kernel thread are located, and is mainly used to execute user programs. In the user state, the virtual machine can only access the memory in a limited manner, and is not allowed to access the peripheral device, and the ability to occupy the CPU is deprived, for example, the program running in the user state cannot directly access the operating system kernel data structure and program.

[0068] VirtIO Spec is used to indicate the standard for building control path and data path between Front-end and Back-end.

[0069] vhost-net can be referred to as kernel state forwarding. The vhost-net refers to the implementation of data forwarding through the back-end provided by KVM. In the kernel state forwarding implementation, as shown in the (a) of FIG. 1, a QEMU process is run in the user space of the virtual machine, and a virtual network device and a virtio device are created in the user space through the QEMU process. In the kernel space of the virtual machine, a vhost-net component and a TAP component are deployed.

[0070] The virtual network device refers to a network connection component used by QEMU to simulate the virtual machine, and is used to implement the communication between the front-end and the back-end of the virtual machine.

[0071] The virtio device is used to define a set of driver interfaces, so that the client operating system can use the interfaces to communicate with the virtual hardware of the virtual machine.

[0072] The vhost-net component is used to implement the sending and receiving of data packets.

[0073] The TAP component can refer to a virtual Ethernet interface in the kernel space. The TAP component is used to connect the network communication between the virtual machine and the host machine or other virtual machines.

[0074] As shown in the (a) of FIG. 1, in the case of kernel state forwarding, the data transmission path is established between the virtual network device and the vhost-net component through the ring at the data layer. The vhost-net component establishes the data path with the physical network card of the host machine through the TAP component, thereby establishing the data path among the virtual network device, the vhost-net component and the physical network card.

[0075] In the case of kernel state forwarding, the control channel is established between the virtual network device and the virtio device at the control layer. The virtio device establishes the control channel with the vhost-net component through the virtio driver, thereby forming the control path of the virtual network device, the virtio device and the vhost-net component.

[0076] In the kernel mode forwarding implementation, the data packet reaches the physical network card of the host computer, and the physical network card delivers the data packet to the kernel of the host computer. The vhost-net component in the kernel space of the virtual machine processes the data packet and places the data packet in the shared memory area. The user space program reads the data packet from the shared memory area through the vhost-user component, and the data packet is delivered to the user space. The user space program processes the data packet, generates a processing result, and writes the processing result back to the vhost-user component. The vhost-user component writes the processing result into the shared memory area. The vhost-net component sends the processing result in the shared memory space to the physical network card.

[0077] In the process in which the user space program reads the data packet from the shared memory area through the vhost-user component, context switching from the kernel mode to the user mode is involved. In the process in which the user space program writes the processing result back to the vhost-user component, context switching from the user mode to the kernel mode is involved. In the process in which the vhost-net component sends the processing result in the shared memory space to the physical network card, context switching from the kernel mode to the user mode is involved.

[0078] In the processes in which the vhost-net component places the data packet in the shared memory area, the vhost-user component reads the data packet from the shared memory area, the user space program writes the processing result back to the vhost-user component, the vhost-user component writes the processing result into the shared memory area, and the vhost-net component sends the processing result in the shared memory space to the physical network card, multiple copying of data is involved.

[0079] Moreover, when the data packet reaches the vhost-net component, the vhost-net component triggers a soft interrupt to process the data packet. This increases the overhead. The soft interrupt can also be referred to as a software interrupt or a soft interrupt handler.

[0080] The vhost-user can be referred to as user mode forwarding. The vhost-user refers to implementing data forwarding through the backend provided by the dpdk. In the user mode forwarding implementation, as shown in (b) of FIG. 1, a data forwarding component (wSwitch datapath) is run in the user space, and the vhost-user component is arranged in the data forwarding component (wSwitch datapath). The vhost-user component interacts with the physical network card of the host computer through the dpdk.

[0081] The data forwarding component is used for data packet processing, forwarding decision determination, network processing, etc. The dpdk directly interacts with the physical network card to accelerate the processing of network data packets.

[0082] In the case of user state forwarding, a control channel is established between the virtual network device and the virtio device at the control level. The virtio device establishes a control channel with the vhost-user component through the virtio user state drive (vhost-user setup), forming a control path of the virtual network device-virtio device-vhost-user component.

[0083] In the case of user state forwarding, a control channel is established between the virtual network device and the virtio device at the control level. The virtio device establishes a control channel with the vhost-user component through the virtio user state drive (vhost-user setup), forming a control path of the virtual network device-virtio device-vhost-user component.

[0084] In the implementation of user state forwarding, after the physical network card receives the data packet, it is directly transmitted to the vhost-user component. The user space program reads the data packet through the vhost-user component and processes it. After generating the processing result, the user space program transmits the processing result to the physical network card through the vhost-user component. The entire data path does not pass through the kernel space.

[0085] The data path can also include offload state forwarding. Vdpa is a backend provided by the smart network card offload. Compared with the user state forwarding shown in (b) of FIG. 1, in the implementation of offload state forwarding, as shown in (c) of FIG. 1, a smart network card is provided in the host computer. The data forwarding component includes a vhost-user component, a Vdpa framework component, and a Vdpa device. A virtual network card is deployed in the kernel space. The virtual network card interacts with the smart network card.

[0086] In the implementation of offload state forwarding, a control channel is established between the virtual network device and the virtio device at the control level. The virtio device establishes a control channel with the vhost-user component through the virtio user state drive (vhost-user setup). The vhost-user component establishes a control channel with the virtual network card through the Vdpa framework component and the Vdpa device. Thus, a control path of the virtual network device-virtio device-vhost-user component-Vdpa framework component-Vdpa device-virtual network card is formed.

[0087] In the implementation of offload forwarding, a data transmission channel is established between the virtual network device and the virtual network card at the data layer through a ring, forming a data path among the virtual network device, the virtual network card and the intelligent network card.

[0088] In the implementation of offload forwarding, after the intelligent network card receives the data packet, the data packet is directly transmitted to the virtual network card. The virtual network card sends the data packet to the user space program. The user space program processes the data packet, and after generating the processing result, the user space program transmits the processing result to the intelligent network card through the virtual network card. The entire data path does not pass through the kernel space, and the data packet transmission is directly implemented through the virtual network card.

[0089] As can be seen from the above FIG. 1, the kernel state forwarding is to process the transmission and reception of the packet in the kernel space, involving multiple context switches between the kernel state and the user state, and multiple copying of the packet, and the data transmission performance is low. Moreover, it is difficult to add new functions to the kernel state, while the user state / offload state as the mainstream technology form can continue to evolve and has better performance.

[0090] To realize the running performance of the virtual machine and the data forwarding efficiency, it is necessary to switch the kernel state to the user state / offload state. However, at present, to switch the kernel state to the user state / offload state, the virtual machine needs to be stopped, which will cause business interruption and loss.

[0091] Therefore, to realize the switching between the kernel state and the user state / offload state without stopping the virtual machine, the embodiment of the present application provides a virtual machine state switching method. The virtual machine state switching method provided by the embodiment of the present application can be applied to a cloud platform or a cloud platform. The cloud platform can also be referred to as a cloud management platform, a cloud computing platform, a cloud business platform or a cloud application platform, etc. In the case of being applied to a cloud platform, the cloud platform can switch the state of the virtual machine deployed in the cloud platform according to the state switching request sent by the client corresponding to the cloud platform. In the case of being applied to a cloud platform, the server or the computing device switches the state of the virtual machine deployed in the server or the computing device according to the state request input by the user.

[0092] For example, the implementation of the virtual machine state switching method applied to the cloud platform is introduced below. Correspondingly, the implementation of the virtual machine state switching method applied to the cloud platform can refer to the implementation of the cloud platform.

[0093] As shown in FIG. 2, FIG. 2 is a system architecture diagram of a cloud service system provided by the embodiment of the present application. The cloud service system shown includes a cloud data center 10, a cloud service platform 30 and a client 20.

[0094] In a first optional implementation, the client 20 can be a computer running an application, which can be a physical machine or a virtual machine. For example, if the computer running the application is a physical computing device, the physical computing device can be a host or a terminal (Terminal). The terminal can also be referred to as a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, a desktop computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form of the client 20.

[0095] In a second optional implementation, the client 20 can be an application, such as a cloud computer application. Alternatively, the client 20 can be a web client. The client 20 runs on a terminal device. The terminal device includes, but is not limited to, a mobile phone terminal, a tablet computer, a personal computer, a notebook computer, etc.

[0096] It should be noted that the above two implementations are only different implementations of the client 20. In actual applications, the client 20 can also have other implementations, for example, the client 20 can be a software module running on any one or more hosts in the computing cluster 110. The present application does not limit this.

[0097] In an optional implementation, a cloud platform is deployed in the cloud data center 10. The cloud platform can be the cloud management platform 120 shown in FIG. 2.

[0098] In some embodiments, the cloud management platform 120 can be independently deployed in an instance of the cloud data center 10. Alternatively, the cloud management platform 120 can be distributedly deployed in multiple instances of the cloud data center 10.

[0099] The instance can refer to a virtual machine, a container, a bare metal server, a physical server, etc. that includes a CPU, a memory, an operating system, a network, a disk, etc.

[0100] As shown in FIG. 2, the cloud management platform 120 is abstracted by a cloud service provider into a cloud service provided to users at the cloud service platform 30. After a user purchases the cloud service at the cloud service platform 30 through the client 20 (which can be pre-recharged and then settled according to the use of the final resources), the cloud environment provides the cloud service to the user by using the cloud management platform 120 deployed at the cloud data center 10. When using the cloud service, the user can determine the tasks to be executed and upload data to the cloud environment through an application program interface (API) or a graphical user interface (GUI) in the client 20. The cloud management platform 120 in the cloud environment receives the task information and data of the user, performs data processing and executes corresponding tasks, and obtains the processing result. The cloud management platform 120 stores the execution result of the task or the state information in the memory during the execution of the task to the user through the API or the GUI. The tasks include, but are not limited to, AI model training tasks, AI recognition tasks, content generation tasks, cloud desktop login, data analysis services, etc. The present application does not limit this.

[0101] In an optional implementation, the cloud management platform 120 is associated with a computing cluster 110. The computing cluster 110 refers to a collection of computers connected by a local area network or the Internet, which is usually used to execute large tasks (also referred to as jobs). Here, the job usually refers to a large task that needs to be processed in parallel by a large number of computing resources. The nature and number of jobs are not limited in the present embodiment. One job can include multiple computing tasks, which can be assigned to multiple computing resources for execution. Most tasks are executed concurrently or in parallel, while some tasks need to rely on the data generated by other tasks. Each computing device in the computing cluster 110 uses the same hardware and the same operating system; different hardware and different operating systems can also be used in the host of the computing cluster 110 according to business needs. Since the tasks deployed by using the computing cluster 110 can be executed concurrently, the overall performance can be improved.

[0102] As shown in FIG. 2, the computing cluster 110 includes multiple hosts, such as the host 111 and the host 113 shown in FIG. 2. Each host can provide computing resources to the cloud management platform 120. Taking one host as an example, it can include multiple processors or processor cores, and each processor or processor core can be a computing resource. Therefore, one physical host can provide multiple computing resources. For example, the physical host can be a server.

[0103] The computing cluster 110 can process multiple types of jobs of the cloud management platform 120. The present application does not limit the number of tasks and the number of tasks that can be executed in parallel.

[0104] In the system architecture of FIG. 2, a job can be submitted from the client 20 to the cloud management platform 120 through the network to the cloud service platform 30. The cloud management platform 120 issues the job to the computing cluster 110. In the case that the job is submitted from the cloud management platform 120 to the computing cluster 110, the cloud management platform 120 can be used to manage all the hosts in the computing cluster 110 to complete one or more tasks included in the job, such as scheduling the computing resources or storage resources among the hosts.

[0105] One or more virtual machines can be run in the computing cluster 110. As shown in FIG. 2, the virtual machine 1 is run in the host 111. The virtual machine 3 is run in the host 113.

[0106] In an optional implementation, the host can run the virtual machine through a virtualization layer. For example, as shown in FIG. 3, a host is taken as an example, the host 111 includes a hardware layer 03, a host layer 02 and a virtualization layer 01. The virtualization layer 01 includes the virtual machine 011 and 012. The number of virtual machines can be more or less, and here only two are taken as an example. The hardware layer 03 includes a processor system 031, a memory 034, a communication interface 032 and an interrupt controller 033.

[0107] The virtual machine (VM) is simulated on the computer device through the virtualization software. The virtual machine (the virtual machine 011 and the virtual machine 012 in FIG. 3) can install a guest operating system (guest OS) (the guest operating system 015 and the guest operating system 016 in FIG. 3), and the guest operating system runs one or more application programs (the application program 013 and the application program 014 in FIG. 3). The virtual machine can also access the network resources. For the application program running in the virtual machine, it is like working in a real computer.

[0108] Virtual processor (e.g., virtual processor 017 and virtual processor 018 in FIG. 3): under virtualization technology, a processing unit (e.g., virtual CPU (vCPU)) that is provided to a virtual computer in a shared or sliced manner. A virtual computer can have one or more virtual processors serving it, and when there are multiple virtual processors, usually one of them is the primary virtual processor and the others are secondary virtual processors. Virtual memory and other virtual hardware resources contained by a virtual machine are not shown in FIG. 3. A virtual processor is virtualized by virtualization software, and its running is actually implemented by a host computer's processor or physical core reading and running a software program, for example, a physical core reads a software program and runs the software program in a specific mode (e.g., non-Root mode of x86) of hardware-assisted virtualization of the physical core to implement a virtual processor. Multiple virtual processors of a virtual machine can be located on different physical cores. It should be noted that the vCPU mentioned in various embodiments of the present application is an optional specific implementation of a virtual processor. The "vCPU" mentioned in various embodiments can be replaced by "virtual processor" for understanding.

[0109] The virtualization system includes two modes: host mode and guest mode. The host mode can also be referred to as a privileged level of the host, such as a user mode of the host or a kernel mode of the host. The guest mode can also be referred to as a privileged level of the VM, such as a user mode of the VM or a kernel mode of the VM. When a physical processor enters the guest mode, it is called a trap in. The process of the trap in can also be understood as the physical processor switching from running the host to running the virtual machine. When the physical processor exits the guest mode, it is called a trap out. The process of the trap out can also be understood as the physical processor switching from running the virtual machine to running the host. After the trap out, the physical processor will temporarily not execute the code of the virtual processor, so at this time it can be understood that the virtual processor is not running. When the physical processor runs the virtual machine, it runs a virtual processor of the virtual machine. A virtual machine can have multiple virtual processors. A physical processor runs only one virtual processor of the virtual machine at a time. Multiple virtual processors belonging to the same virtual machine can be run on the physical processor in a time-sharing manner, such as running vCPU1 of virtual machine 1 on physical processor 1 first, and then running vCPU2 of the virtual machine 1 on the physical processor 1 after the physical processor 1 finishes running the vCPU1. Multiple vCPUs belonging to the same virtual machine can also be run on different physical processors. At a time, different vCPUs can be run on different physical processors, such as running vCPU1 of virtual machine 1 on physical processor 1 and running vCPU2 of virtual machine 1 on physical processor 2. The host layer 02 serves as a management layer to manage and allocate hardware resources, and provides various virtual hardware resources for the virtual machine, such as virtual processors (virtual processor 017, virtual processor 018), virtual memory, virtual disk, virtual network card, etc. The host layer 02 can also implement scheduling and isolation of the virtual machine, etc.

[0110] In some implementations, the host layer 02 can include a host operating system 022 and a virtual monitoring device, such as a virtual machine monitor 021 (VMM). The virtual machine monitor 021 can be deployed inside the host operating system 022 or outside the host operating system 022. In other virtualization architectures, the virtual monitoring device can also be referred to as a hypervisor or other types of virtual monitoring devices. The host layer 02 can also be referred to as a virtualization platform. Sometimes the host layer can also be referred to as a host. The privileged levels of the host include a user mode and a kernel mode.

[0111] Hardware layer 03: hardware platform on which the virtualization environment runs. The hardware layer can include various hardware, as shown in FIG. 3, the hardware layer 03 can include a processor system 031 and a memory 034, and can also include a communication interface 032, such as a network interface card (NIC); can also include an interrupt controller 033, an input / output (I / O) device, etc. The processor system 031 can include one or more processors, such as the processor 1 and the processor 2 listed in FIG. 3. Each processor can include multiple physical cores, and the processor can also include multiple registers, such as general-purpose registers, floating-point registers, etc.

[0112] The processor system 031 can include multiple processors, such as the processor 1 and the processor 2 in FIG. 3. The processor 1 and the processor 2 in FIG. 3 are both physical processors, such as a source physical processor and a target physical processor. Each physical processor can be understood as a physical core. The processor system 031 can specifically be a multi-core processor including a source physical processor and a target physical processor. A virtual processor and a physical core can be in a binding relationship, that is, a virtual processor is fixed on a certain physical core for running and cannot be scheduled to run on other physical cores, and the virtual processor is a bound core; a virtual processor can be scheduled to run on different physical cores as needed, and the virtual processor is an unbound core.

[0113] The interrupt controller 033 is arranged between the hardware triggering the interrupt request and the processor, and is mainly used to collect interrupt requests generated by various hardware and send them to the processor according to certain priority or other rules. For example, an advanced programmable interrupt controller (APIC).

[0114] An interruption refers to pausing the current program instructions to execute an interruption service program. An interruption can include a virtual interruption and a physical interruption. The virtual interruption refers to an interruption notified by a hardware device in a computer device, a host, a clock of the virtual machine, or a virtual central processing unit (vCPU) of the virtual machine to the virtual machine (VM). The hardware device generating the virtual interruption can be a disk, a network card, a sound card, a mouse, a hard disk, etc. in the computer device. The physical interruption refers to an interruption notified by a hardware device to a physical processor. The physical interruption is processed by the host, and the virtual interruption is processed by the virtual machine.

[0115] An interrupt service routine (ISR), also referred to as an interrupt handling function, is a program used to handle an interrupt request. When a processor receives an interrupt request, it temporarily stops the execution of the current program and executes the interrupt service routine corresponding to the interrupt request.

[0116] The storage space (or address space) provided by the memory 034 is divided for use by the virtual machine and the host computer. A host physical address (HPA) refers to a physical address space available to the local host (or host computer); a host virtual address (HVA) is a virtual address space available to the local host. A guest physical address (GPA) is a physical address space available to the guest operating system of the virtual machine; a guest virtual address (GVA) is a virtual address space available to the guest operating system of the virtual machine.

[0117] The host computer 111 can be a physical device, such as a server or a terminal device. The terminal device can be a handheld device with wireless connection functionality, or another processing device connected to a wireless modem. For example, it can be a mobile phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), a wearable device, and an e-book reader, etc.; it can also be a portable, pocket-sized, handheld, built-in computer, or vehicle-mounted mobile device.

[0118] It should be noted that the division and naming of the modules in the virtual machine structure provided in the above-described FIG. 3 are illustrative. In actual applications, the virtual machine has more or fewer modules than FIG. 3, which is not limited by the present application.

[0119] The virtual machine or the host computer in the above-described host computer 111 can execute a job issued by the cloud management platform 120, and during the execution of the job, the cloud management platform 120 executes the virtual machine state switching method provided in the embodiments of the present application to switch the state of the virtual machine without shutting down the virtual machine.

[0120] The virtual state switching method provided in the embodiments of the present application can be applied to the cloud service platform 30 shown in FIG. 2, or the cloud management platform 120, or the host 111 in the computing cluster 110 shown in FIG. 3. In the following, the virtual state switching method is taken as an example applied to the cloud management platform 120, and the virtual machine state switching method provided in the embodiments of the present application is introduced in combination with FIG. 4 to FIG. 10.

[0121] For example, the cloud management platform 120 includes the host 111, in an optional manner, the host 111 can be referred to as a first computing node, or a host computer, or other names, which are not limited in the present application.

[0122] The host 111 is deployed with a virtual machine 1, which runs in a kernel mode or a user mode. In the case that the cloud management platform 120 receives a switching request for the virtual machine 1, the virtual machine state switching method provided in the embodiments of the present application is executed, and the cloud management platform 120 switches the state of the virtual machine 1 to the user mode or the offload mode without shutting down the virtual machine 1.

[0123] In a first optional example, the virtual machine 1 runs in the kernel mode, and the cloud management platform 120 switches the state of the virtual machine 1 from the kernel mode to the user mode. Alternatively, the cloud management platform 120 can switch the state of the virtual machine 1 from the kernel mode to the offload mode.

[0124] In a second optional example, the virtual machine 1 runs in the user mode, and the cloud management platform 120 switches the state of the virtual machine 1 from the user mode to the offload mode.

[0125] It should be noted that the above two optional examples are only different implementation manners of the virtual machine state switching, and other implementation manners can also be used in actual applications, for example, the cloud management platform 120 can switch the state of the virtual machine 1 from the user mode to the kernel mode. For another example, the cloud management platform 120 can switch the state of the virtual machine 1 from the offload mode to the kernel mode. The present application is not limited in this regard.

[0126] As shown in FIG. 4, FIG. 4 is a flowchart of the virtual machine state switching method provided in the embodiments of the present application, in an optional implementation manner, the virtual machine 1 can be the virtual machine 011 or 012 in the above-mentioned FIG. 3. Alternatively, the virtual machine 1 can also be the virtual machine running on any host in the above-mentioned FIG. 2. In some optional manners, the virtual machine 1 can be referred to as a first virtual machine, a source virtual machine, or other names; the virtual machine 2 can be referred to as a second virtual machine, a destination virtual machine, or other names, which are not limited in the present application. Please refer to FIG. 4, the virtual machine state switching method provided in the embodiments of the present application includes steps S410 to S440.

[0127] S410, the cloud management platform 120 acquires a switching request of the virtual machine 1.

[0128] In an optional implementation, the switching request can be triggered by a user through the client 20 to the cloud management platform 120. For example, the client 20 displays a virtual machine state interface, and the client 20 sends the switching request to the cloud management platform 120 in response to a first operation input by the user through the virtual machine state interface.

[0129] For example, the switching request is used to indicate switching the virtual machine 1 from the first state to the second state.

[0130] The first state is a current state of the virtual machine 1, and the second state is a target state indicated by the switching request.

[0131] The first state and the second state are exemplified below in three examples.

[0132] In the first example, the first state is the kernel state, and the second state is the user state.

[0133] In the second example, the first state is the kernel state, and the second state is the offload state.

[0134] In the third example, the first state is the user state, and the second state is the offload state.

[0135] It should be noted that the above three examples are only examples of different first states and second states. In actual applications, the first state and the second state can also have other examples, for example, the first state is the user state, and the second state is the kernel state. For another example, the first state is the offload state, and the second state is the user state. For another example, the first state is the offload state, and the second state is the kernel state. The present application does not limit this.

[0136] In the first optional implementation, the switching request carries a virtual machine identifier field and a state identifier field.

[0137] The virtual machine identifier field is used to indicate a virtual machine that needs to perform state switching. It should be noted that the present application does not limit the specific form of the virtual machine identifier field. For example, the virtual machine identifier field can be the name of the virtual machine. For another example, the virtual machine identifier field can be the serial number 6FA3FE56-CD0D-4E2E-AAEB-1BC6E6D9H of the virtual machine.

[0138] The state identifier field is used to indicate the second state. After obtaining the switching request, the cloud management platform 120 obtains the state identifier field by analyzing the switching request. According to the correspondence between the identifier field and the state, the cloud management platform 120 determines the state corresponding to the state identifier field as the second state. The correspondence between the identifier field and the state is used to indicate the correspondence between the state identifier field and the corresponding virtual machine state.

[0139] It should be noted that the embodiments of the present application do not limit the specific content of the state identifier field. For example, in the case where the state identifier field carried by the switching request is "X2", the second state indicated by the switching request is the user state. For another example, in the case where the state identifier field carried by the switching request is "X2", the second state indicated by the switching request is the offload state.

[0140] In the second optional implementation, the switching request carries an identifier field of the virtual machine.

[0141] After obtaining the switching request, the service platform obtains the identifier field of the virtual machine by analyzing the switching request. Based on the first state of the virtual machine 1 indicated by the identifier field of the virtual machine, the cloud management platform 120 determines the second state.

[0142] In the first example, in the case where the first state of the virtual machine 1 is the user state, the cloud management platform 120 determines the second state as the offload state.

[0143] In the second example, in the case where the first state of the virtual machine 1 is the offload state, the cloud management platform 120 determines the second state according to the performance parameter of the virtual machine 1.

[0144] The performance parameter includes at least one of a network bandwidth, a CPU usage rate, and a memory occupancy rate.

[0145] For example, in the case where the performance parameter of the virtual machine 1 meets a first condition, the second state is determined as the user state.

[0146] For another example, in the case where the performance parameter of the virtual machine 1 meets a second condition, the second state is determined as the offload state.

[0147] The first condition can be that the performance parameter of the virtual machine 1 matches a preset reference performance parameter. The second condition can be that the performance parameter of the virtual machine 1 does not match the preset reference performance parameter.

[0148] The preset reference performance parameter includes at least one of a reference network bandwidth, a reference CPU usage rate, and a reference memory occupancy rate.

[0149] It should be noted that the above two embodiments are only different implementation manners of determining the second state when the switching request contains different contents. In actual application, there can be other implementation manners. For example, after receiving the switching request, the cloud management platform 120 sends the first state of the virtual machine 1 to the client 20. The client 20 receives the state selection operation input by the user based on the displayed first state, and returns the state selection operation to the cloud management platform 120. The cloud management platform 120 determines the second state based on the state selection operation. The present application does not limit this.

[0150] S420, the cloud management platform 120 creates the virtual machine 2 in the host 111 in response to the switching request.

[0151] In an optional implementation manner, the virtual machine 2 and the virtual machine 1 have the same resource configuration. The resources include computing resources, storage resources, virtual network cards, etc. Alternatively, the virtual machine 2 and the virtual machine 1 have different resource configurations. The embodiments of the present application do not limit this.

[0152] For example, taking the case that the virtual machine 2 and the virtual machine 1 have the same resource configuration as an example, there are multiple implementation manners of creating the virtual machine 2 in the host 111, for example:

[0153] In the first implementation manner, the cloud management platform 120 can refer to the resource configuration of the virtual machine 1 to create the virtual machine 2 in the host 111.

[0154] For example, the cloud management platform 120 can refer to the resource configuration of the virtual machine to create the virtual machine 2 in the host 111 through KVM and QEMU technologies.

[0155] In the second implementation manner, the cloud management platform 120 can pre-create multiple candidate virtual machines 2 in the host 111, and different candidate virtual machines 2 correspond to different resource configurations. After the cloud management platform 120 responds to the switching request, the cloud management platform 120 selects the virtual machine 2 with the highest similarity to the resource configuration of the virtual machine 1 from the multiple candidate virtual machines. In this way, the rapid creation of the virtual machine 2 is realized.

[0156] In the third implementation manner, the cloud management platform 120 pre-creates an initial virtual machine 2 in the host 111. After the cloud management platform 120 responds to the switching request, the cloud management platform 120 modifies the resource configuration of the initial virtual machine 2 according to the resource configuration of the virtual machine 1 to form the virtual machine 2 with the same resource configuration as the virtual machine 1. In this way, the rapid creation of the virtual machine 2 is realized through the modification of the resource configuration.

[0157] It should be noted that the above three implementation manners are only different implementation manners of creating the virtual machine 2, and in actual application, other implementation manners can also be used, for example, the virtual machine 2 is created in the host 111 through a mirror file. The embodiment of the present application does not limit this.

[0158] S430, the cloud management platform 120 configures the message exchange mechanism of the virtual machine 2 according to the second state, and obtains the configured virtual machine 2.

[0159] In an optional implementation manner, the message exchange mechanism can refer to a data packet processing manner between the cloud management platform 120 and the client 20.

[0160] In an optional implementation manner, the data packet processing manner includes processing the data packet in a kernel space of the virtual machine, processing the data packet in a user space, or processing the data packet through a virtual network card.

[0161] In an optional implementation manner, the message exchange mechanism is related to the second state.

[0162] In a first example, the second state is a user state, and the message exchange mechanism is used to indicate that the data packet is processed in the user space.

[0163] In a second example, the second state is an offload state, and the message exchange mechanism is used to indicate that the data packet is processed through the virtual network card.

[0164] In a third example, the second state is a kernel state, and the message exchange mechanism is used to indicate that the data packet is processed in the kernel space.

[0165] It should be noted that the above three examples are only different implementation manners of the message exchange mechanism in different cases of the second state, and in other embodiments, the message exchange mechanism can also have other implementation manners, which are not limited by the present application.

[0166] In an implementation manner, the message exchange mechanism includes the above-mentioned data path and control path. Correspondingly, the message exchange mechanism of the virtual machine 2 at least includes the following two implementation manners:

[0167] The first implementation manner is that the cloud management platform 120 configures the data path and the control path of the virtual machine 2 according to the second state. Specifically, the implementation manner of configuring the data path and the control path of the virtual machine 2 can refer to the implementation provided in the following FIG. 6. The present application does not expand the description here.

[0168] The second implementation manner is that the cloud management platform 120 configures the data path of the virtual machine 2 according to the second state. Specifically, the implementation manner of configuring the data path of the virtual machine 2 can refer to the implementation provided in the following FIG. 7. The present application does not expand the description here.

[0169] It should be noted that the above two implementation manners are only different implementation manners of the message exchange mechanism for configuring the virtual machine 2. In actual application, there can be other implementation manners, for example, the cloud management platform 120 configures the control path of the virtual machine 2 according to the second state. The present application does not limit this.

[0170] In an optional implementation manner, the configured second virtual machine runs according to the second state.

[0171] S440, the cloud management platform 120 hot-migrates the virtual machine 1 to the configured virtual machine 2, and the cloud management platform 120 processes the data message between the cloud management platform 120 and the client through the configured virtual machine 2.

[0172] In an optional implementation manner, the hot-migration refers to that, during the running of the original virtual machine, the original virtual machine processes the task running on the destination virtual machine. For example, during the service execution of the virtual machine 1, the service running on the virtual machine 1 is migrated to the configured virtual machine 2, and the configured virtual machine 2 executes the service on the virtual machine 1. Since the configured virtual machine 2 runs according to the second state, the virtual machine state switching can be realized without interrupting the service.

[0173] Next, examples of the migration of the virtual machine 1 are described with the second state being the user state or the second state being the offload state as examples.

[0174] In the first example, the first state is the kernel state, and the second state is the offload state. The cloud management platform 120 migrates the virtual machine 1 running in the kernel state to the virtual machine 2 running in the offload state. As shown in FIG. 5A, the cloud management platform 120 migrates the virtual machine 1 shown in (a) of FIG. 5A to the virtual machine 2 shown in (b) of FIG. 5A. Wherein, (a) of FIG. 5A is that the virtual machine 1 processes the data message in the kernel space, and (b) of FIG. 5A is that the virtual machine 2 processes the data message through the virtual network card.

[0175] In the second example, the first state is the user state, and the second state is the offload state. The cloud management platform 120 migrates the virtual machine 1 running in the user state to the virtual machine 2 running in the offload state. As shown in FIG. 5B, the cloud management platform 120 migrates the virtual machine 1 shown in (a) of FIG. 5B to the virtual machine 2 shown in (b) of FIG. 5B. Wherein, (a) of FIG. 5B is that the virtual machine 1 processes the data message in the user space, and (b) of FIG. 5B is that the virtual machine 2 processes the data message through the virtual network card.

[0176] In the third example, the first state is the kernel state, and the second state is the user state. The cloud management platform 120 migrates the virtual machine 1 running in the kernel state to the virtual machine 2 running in the user state. As shown in FIG. 5C, the cloud management platform 120 migrates the virtual machine 1 shown in (a) of FIG. 5C to the virtual machine 2 shown in (b) of FIG. 5C. In (a) of FIG. 5C, the virtual machine 1 processes data packets in the kernel space, and in (b) of FIG. 5C, the virtual machine 2 processes data packets in the user space.

[0177] It should be noted that the above three examples are only feasible ways of implementing the virtual machine migration process in different cases of the second state. In actual applications, there can be other implementation manners, which are not limited by the present application.

[0178] In an optional implementation manner, the cloud management platform 120 can refer to the embodiment provided in FIG. 9 to hot migrate the virtual machine 1 to the configured virtual machine 2.

[0179] Based on the embodiment provided in FIG. 4, the cloud management platform 120 receives the switching request for the virtual machine 1, creates the virtual machine 2 in the host running the virtual machine 1, and configures the message exchange mechanism of the virtual machine 2 based on the second state indicated by the switching request. Then, the cloud management platform 120 hot migrates the virtual machine 1 to the configured virtual machine 2, and implements the online switching of the message exchange mechanism in the virtual machine. In this way, the data packet processing manner between the cloud platform and the client 20 is switched without shutting down the virtual machine 1, thereby reducing the loss caused by the service interruption.

[0180] In an optional implementation manner, the cloud management platform 120 has at least the following two implementation manners of configuring the message exchange mechanism of the virtual machine 2 when performing the process in the above step S430.

[0181] In a first implementation manner, the cloud management platform 120 configures the control path and the data transmission path between the front end and the back end in the virtual machine 2 according to the second state. The cloud management platform 120 converts the control path of the virtual machine 2 into the control path corresponding to the second state, and converts the data transmission path of the virtual machine 2 into the data transmission path corresponding to the second state.

[0182] It can be understood that in the first implementation manner, the control path and the data transmission path of the virtual machine 2 are different from those of the virtual machine 1.

[0183] In a second implementation manner, the cloud management platform 120 configures the data transmission path of the virtual machine 2 according to the second state. The cloud management platform 120 converts the data transmission path of the virtual machine 2 into the data transmission path corresponding to the second state.

[0184] It can be understood that in the second implementation, the control path of the virtual machine 2 is the same as that of the virtual machine 1.

[0185] For example, the first state of the virtual machine 1 is the kernel state, and the virtual machine 1 and the virtual machine 2 both manage the IO channel of the virtual machine in the kernel space.

[0186] For another example, the first state of the virtual machine 1 is the user state, and the virtual machine 1 and the virtual machine 2 both manage the IO channel of the virtual machine in the user space.

[0187] For another example, the first state of the virtual machine 1 is the offload state, and the virtual machine 1 and the virtual machine 2 both manage the IO channel of the virtual machine through the virtual network card.

[0188] It should be noted that the above two implementation modes are only different implementation modes of the message exchange mechanism of the virtual machine 2, and other implementation modes can also be used in actual application. The present application does not limit this.

[0189] The two implementation modes of the message exchange mechanism of the virtual machine 2 configured by the cloud management platform 120 will be introduced below with reference to FIGS. 6 to 8C respectively.

[0190] For example, the first implementation mode of the message exchange mechanism of the virtual machine 2 configured by the cloud management platform 120 is taken as an example to introduce the implementation mode of the message exchange mechanism of the virtual machine 2 provided by the present application.

[0191] As shown in FIG. 6, FIG. 6 is a flowchart of the message exchange mechanism of the virtual machine 2 provided by the present application. The message exchange mechanism of the virtual machine 2 shown in the flowchart includes steps S431A to S433A.

[0192] S431A, the cloud management platform 120 determines a second IO control channel and a second transmission protocol matched with the second state according to the second state.

[0193] In an optional implementation mode, the second IO control channel can refer to the control path of the virtual machine 2 when the virtual machine 2 is running according to the second state.

[0194] In an optional implementation mode, the cloud management platform 120 can determine the second IO control channel matched with the second state according to the correspondence between the state and the IO control channel.

[0195] The correspondence between the state and the IO control channel is used to indicate the second IO control channel corresponding to the second state under different conditions.

[0196] Three examples are provided below to illustrate the second IO control channel under different second states.

[0197] In the first example, the second state is the kernel state, the second IO control channel can indicate that the IO channel of the virtual machine 2 is managed in the kernel space of the virtual machine 2, and the second transmission protocol can indicate that the data packets between the virtual machine 2 and the client 20 are forwarded in the kernel space of the virtual machine 2.

[0198] In the second example, the second state is the user state, the second IO control channel can indicate that the IO channel of the virtual machine 2 is managed in the user space of the virtual machine 2, and the second transmission protocol can indicate that the data packets between the virtual machine 2 and the client 20 are forwarded in the user space of the virtual machine 2.

[0199] In the third example, the second state is the offload state, the second IO control channel can indicate that the IO channel of the virtual machine 2 is managed in the virtual network card of the virtual machine 2, and the second transmission protocol can indicate that the data packets between the virtual machine 2 and the client 20 are forwarded through the virtual network card of the virtual machine 2.

[0200] It should be noted that the above three examples are only exemplary descriptions of the second IO control channel in different second states, and do not constitute a limitation on the virtual machine state switching method provided by the embodiments of the present application. In actual applications, there can be other examples, which are not limited by the present application.

[0201] In an optional implementation, the IO channel can refer to an input channel / output channel between the front end and the back end of the virtual machine.

[0202] In an optional implementation, the IO channel of the virtual machine 2 can be managed by a driver. In other embodiments, the driver can also be referred to as a driver module, a driver unit, a driver program, etc., which are not limited by the present application.

[0203] For example, the following will be described by taking the second state as the kernel state, the user state and the offload state respectively, and the IO channel of the virtual machine 2 is managed by the driver.

[0204] In the first example, the second state is the kernel state, the virtio driver can be loaded by the cloud management platform 120 in the kernel space of the virtual machine 2, and the management of the IO channel of the virtual machine 2 is realized by the virtio driver.

[0205] In the second example, the second state is the user state, and the virtio user state driver is run as a user space application in the user space of the virtual machine 2. The application in the user space manages the IO channel of the virtual machine 2 through the virtio user state driver.

[0206] In the third example, the second state is the offload state, the cloud management platform 120 deploys a hardware accelerator (VDPA) in the virtual machine 2, the virtual machine 2 offloads the processing function of the data packet to the virtual network card of the virtual machine 2 through the hardware accelerator (VDPA), and offloads the virtio function to the hardware accelerator (VDPA). In the implementation of managing the IO channel of the virtual machine 2, the application of the virtual machine 2 loads the VDPA driver, and manages the IO channel of the virtual machine 2 through the VDPA driver.

[0207] It should be noted that the above three examples are only different implementations of managing the IO channel of the virtual machine 2, and in actual application, there can be other implementations, for example, in the case of the second state being the offload state, the VDPA driver can be loaded in the user space. The present application does not limit this.

[0208] Next, taking the virtio driver as an example, the specific content of managing the IO channel of the virtual machine 2 is introduced, and the specific content of managing the IO channel of the virtual machine 2 under the virtio user state driver and the VDPA driver can refer to the specific content of managing the IO channel of the virtual machine 2 under the virtio driver.

[0209] In an optional implementation, managing the IO channel of the virtual machine 2 includes but is not limited to: initializing the virtio device of the virtual machine 2, configuring the virtio device of the virtual machine 2, managing the message queue between the front end and the back end of the virtual machine 2, and managing the state of the virtio device of the virtual machine 2.

[0210] Among them, initializing the virtio device of the virtual machine 2 includes: initializing the virtio device through the virtio driver, and setting the shared memory area.

[0211] Configuring the virtio device of the virtual machine 2 includes: the virtio driver interacts with the management program through the configuration space in the shared memory area, and sets the parameters of the virtio device.

[0212] Managing the message queue between the front end and the back end of the virtual machine 2 includes: the virtio driver writes the command sent by the front end into the command queue in the shared area. And in the case that the virtio driver detects that the command is in the completion state, the virtio driver notifies the front end of the virtual machine 2.

[0213] Managing the state of the virtio device of the virtual machine 2 includes: state change of the virtio device, state writing to the shared memory area, updating the state of the virtio device, etc.

[0214] In an optional implementation, the second transmission protocol is used to indicate a data path of the virtual machine 2 when the virtual machine 2 is running in the second state.

[0215] In an optional implementation, the cloud management platform 120 can also determine the second transmission protocol matching the second state according to the correspondence between the state and the protocol, similar to the determination of the second IO control channel.

[0216] The correspondence between the state and the protocol is used to indicate the second transmission protocol corresponding to the virtual machine in different second states.

[0217] The following provides three examples to illustrate the second transmission protocol in different second states.

[0218] In the first example, the second state is the kernel state, and the second transmission protocol can indicate that the data packet between the virtual machine 2 and the client 20 is forwarded in the kernel space of the virtual machine 2.

[0219] In the second example, the second state is the user state, and the second transmission protocol can indicate that the data packet between the virtual machine 2 and the client 20 is forwarded in the user space of the virtual machine 2.

[0220] In the third example, the second state is the offload state, and the second transmission protocol can indicate that the data packet between the virtual machine 2 and the client 20 is forwarded through the virtual network card of the virtual machine 2.

[0221] It should be noted that the above three examples are only exemplary descriptions of the second transmission protocol in different second states, and do not constitute a limitation on the virtual machine state switching method provided by the embodiments of the present application. In actual applications, there can be other examples, and the present application does not limit this.

[0222] S432A, the cloud management platform 120 switches the first IO control channel of the virtual machine 2 to the second IO control channel.

[0223] In an optional implementation, the first IO control channel can refer to the initial IO control channel of the virtual machine 2.

[0224] In an optional manner, the first IO control channel of the virtual machine 2 is the same as the IO control channel of the virtual machine 1. That is, the first IO control channel of the virtual machine 2 is related to the first state of the virtual machine 1.

[0225] In an optional implementation, after determining the second IO control channel, the cloud management platform 120 can configure a corresponding driver in the virtual machine 2 according to the second IO control channel, and unload the driver under the first IO channel from the virtual machine 2, thereby switching the first IO channel of the virtual machine 2 to the second IO control channel.

[0226] S433A, the cloud management platform 120 switches the first transmission protocol of the virtual machine 2 to the second transmission protocol.

[0227] In an optional implementation, the first transmission protocol can refer to the initial transmission protocol of the virtual machine 2.

[0228] In an optional manner, the first transmission protocol of the virtual machine 2 is the same as the transmission protocol of the virtual machine 1. That is, the first transmission protocol of the virtual machine 2 is related to the first state of the virtual machine 1.

[0229] In an optional implementation, the implementation of switching the first transmission protocol of the virtual machine 2 to the second transmission protocol includes: the cloud management platform 120 switches the first transmission protocol of the virtual machine 2 to the second transmission protocol according to the second state by adjusting the configuration information, the feature information and the virtual ring of the first transmission protocol.

[0230] The configuration information is used to indicate the basic parameters of the interaction between the front end and the back end of the virtual machine, which includes but is not limited to: the type, version, queue number, queue size, terminal mode of the virtual device, etc.

[0231] The feature information is used to indicate the function list supported by the virtual machine, which includes the performance optimization characteristics, additional function providing characteristics or device specific functions. For example, allowing multiple small data packets to be merged into one large packet to reduce the interrupt frequency. Or allow a single data packet to span multiple memory areas to improve data transmission efficiency.

[0232] The virtual ring is used to realize the transmission of data between the front end and the back end of the virtual machine.

[0233] Based on the embodiment provided in FIG. 6, according to the second state, the cloud management platform 120 realizes the switching of the virtual machine 2 at the control level and the data level, ensures that the configured virtual machine 2 is adapted to the second state on the data path and the control path, and guarantees the running performance of the configured virtual machine 2.

[0234] Exemplarily, the implementation of the message exchange mechanism for configuring the virtual machine 2 provided in the embodiments of the present application is introduced below taking the second implementation of the message exchange mechanism for configuring the virtual machine 2 as an example.

[0235] In the first optional implementation, the second state is the kernel state, the user state or the offload state, and the cloud management platform 120 converts the data transmission path of the virtual machine 2 to the data transmission path corresponding to the second state by converting the transmission protocol of the virtual machine 2.

[0236] In the second optional implementation, the first state is the kernel state, and the second state is the user state. The cloud management platform 120 forwards the message data in the kernel space to the user space, processes the data message in the user space, and implements the conversion of the data transmission path of the virtual machine 2.

[0237] It should be noted that the above two implementation manners are only different implementation manners of the cloud management platform 120 for implementing the conversion of the data transmission path of the virtual machine 2. In actual application, other implementation manners can also be used, which are not limited by the embodiments of the present application.

[0238] For the first optional implementation of converting the data transmission path of the virtual machine 2, the implementation manner of the message exchange mechanism of the virtual machine 2 provided by the embodiments of the present application will be introduced below in combination with FIG. 7.

[0239] Compared with the flow of the message exchange mechanism of the virtual machine 2 provided by FIG. 6, in the flow of the message exchange mechanism of the virtual machine 2 provided by FIG. 7, the cloud management platform 120 does not convert the IO control channel of the virtual machine 2. That is, in the embodiment provided by FIG. 7, the virtual machine 1 and the configured virtual machine 2 have the same IO control channel.

[0240] For example, the first state is the kernel state, and the virtual machine 1 and the configured virtual machine 2 both manage the IO channel of the virtual machine in the kernel space.

[0241] For another example, the first state is the user state, and the virtual machine 1 and the configured virtual machine 2 both manage the IO channel of the virtual machine in the user space.

[0242] As shown in FIG. 7, FIG. 7 is a second flow diagram of the message exchange mechanism of the virtual machine 2 provided by the embodiments of the present application. The flow of the message exchange mechanism of the virtual machine 2 shown includes steps S431B to S432B.

[0243] S431B, the cloud management platform 120 determines a second transmission protocol matched with the second state according to the second state.

[0244] In an optional implementation, the cloud management platform 120 can determine the second transmission protocol matched with the second state by referring to the above S431A. The embodiments of the present application do not repeat the description here.

[0245] S432B, the cloud management platform 120 switches the first transmission protocol of the virtual machine 2 to the second transmission protocol.

[0246] In an optional implementation, the cloud management platform 120 can switch the first transmission protocol of the virtual machine 2 to the second transmission protocol by referring to the above step S433A, and the embodiments of the present application do not repeat the description here.

[0247] Based on the embodiments provided in FIG. 7, in the implementation of the virtual machine state switching, it is ensured that the virtual machine 2 after the switching is consistent with the virtual machine 1 before the switching in the control layer, and only the data layer switching is implemented through the transmission protocol, thereby simplifying the steps of the virtual machine state switching and improving the efficiency of the virtual machine state switching.

[0248] For the second optional implementation of the conversion of the data transmission path of the virtual machine 2, the implementation of the message exchange mechanism of the virtual machine 2 provided in the embodiments of the present application is introduced as follows.

[0249] Compared with the flow of the message exchange mechanism of the virtual machine 2 provided in FIG. 7, in the second optional implementation of the conversion of the data transmission path of the virtual machine 2, the cloud management platform 120 does not convert the IO control channel and the transmission protocol of the virtual machine 2 in the case that the first state is the kernel state and the second state is the user state. That is, in the second optional implementation of the conversion of the data transmission path of the virtual machine 2, the virtual machine 1 and the configured virtual machine 2 have the same IO control channel, and the configured virtual machine 2 also receives the data packet in the kernel space. However, unlike the data transmission path of the virtual machine 1, the configured virtual machine 2 forwards the data packet received in the kernel space to the user space, and processes and forwards the data packet in the user space.

[0250] In this way, in the implementation of the virtual machine state switching, by forwarding the data packet in the kernel space to the user space and processing the data packet in the user space, the switching of the data transmission path can be implemented without changing the IO control channel and the transmission protocol of the virtual machine 2. The steps of the virtual machine state switching are simplified, and the efficiency of the virtual machine state switching is improved.

[0251] In an optional implementation, in order to improve the configuration efficiency of the message exchange mechanism of the virtual machine 2, the cloud management platform 120 can deploy an adaptation module in the virtual machine 2 in the implementation of creating the virtual machine 2, and the configuration of the message exchange mechanism of the virtual machine 2 is implemented through the adaptation module. In other embodiments, the adaptation module can also be referred to as an adaptation program, an adaptation unit, an adaptation layer, etc., which is not limited in the present application.

[0252] The adaptation module can be used to configure the control path and the data transmission path between the front end and the back end in the virtual machine 2. Or the adaptation module can also be used to configure the data transmission path of the virtual machine 2.

[0253] In an optional implementation, the adaptation module has at least the following two implementation modes:

[0254] In the first implementation, the adaptation module can be deployed in the user space in the virtual machine. The virtual machine configures the control path and the data transmission path between the front end and the back end in the virtual machine by invoking the adaptation module. For example, the virtual machine switches the first IO control channel of the virtual machine 2 to the second IO control channel and switches the first transmission protocol of the virtual machine 2 to the second transmission protocol by invoking the adaptation module.

[0255] In the second implementation, the adaptation module can also be deployed in the kernel space in the virtual machine. The data transmission path of the virtual machine is configured by invoking the adaptation module. For example, the first transmission protocol of the virtual machine 2 is switched to the second transmission protocol by invoking the adaptation module. Or, for another example, the datagram in the kernel space of the virtual machine 2 is forwarded to the user space by invoking the adaptation module.

[0256] It should be noted that the above two implementations are only different implementations of deploying the adaptation module, and other implementations can also be used to deploy the adaptation module in actual application. The present application does not limit this.

[0257] For the above two implementations of deploying the adaptation module, taking the first state as the kernel state as an example, the following will be illustrated by combining FIGS. 8A-8C.

[0258] For example, taking the adaptation module deployed in the user space in the virtual machine as an example, as shown in FIG. 8A, FIG. 8A is a schematic diagram one of deploying the adaptation module provided by the embodiment of the present application. The user space in the virtual machine 2 runs the QEMU process, and the QEMU process creates the virtual machine network device and the virtio device in the user space of the virtual machine 2. The control channel is established between the virtual machine network device and the virtio device. The adaptation module is deployed in the virtio device. The IO control channel switching and the transmission protocol switching are realized by invoking the adaptation module.

[0259] For the IO control channel, the following two examples are used to illustrate the configuration of the IO control channel.

[0260] In the first optional example, the second state is the user state, and the data forwarding component (wSwitch datapath) runs in the user space in the virtual machine 2. The virtio device forms the control channel between the virtual machine network device, the virtio device and the data forwarding component in the user space, that is, the second IO control channel, by the control channel between the adaptation module and the data forwarding component (wSwitch datapath) in the user space.

[0261] In a second optional example, the second state is the unloading state, and the virtio device forms a control channel with the virtual network card (VF) control channel through the adaptation module, so that a control channel between the virtual machine network device, the virtio device and the virtual network card, i.e., the second IO control channel, is formed based on the adaptation module.

[0262] The following two examples are used to illustrate the transmission protocol.

[0263] In a first optional example, the second state is the user state, and the virtual machine 2 establishes a data transmission channel between the data forwarding component and the virtual machine network device by calling the adaptation module, and the data forwarding component interacts with the physical network card of the host 111 through dpdk. In this way, a data path of the virtual machine network device-data forwarding component-physical network card is established, so that the virtual machine 2 realizes the forwarding of data packets through the data forwarding component in the user space.

[0264] In a second optional example, the second state is the unloading state, and the virtual machine 2 establishes a data transmission channel between the virtual network card and the virtual machine network device by calling the adaptation module. The virtual network card interacts with the physical network card of the host 111. In this way, a data path of the virtual machine network device-virtual network card is established, so that the virtual machine 2 realizes the forwarding of data packets through the virtual network card.

[0265] Taking the second state as the user state as an example, as shown in FIG. 8A, the virtual machine 2 creates a virtio user state driver (vhost-user setup) in the user space through the adaptation module, configures and starts a data forwarding component (wSwitch datapath) in the user space through the virtio user state driver, and the data forwarding component interacts with the physical network card of the host 111 through dpdk. By calling the adaptation module to establish a data transmission channel between the data forwarding component and the virtual machine network device, the virtual machine 2 can forward data packets between the virtual machine 2 and the client 20 in the user space of the virtual machine 2.

[0266] For example, the virtual machine 2 directly transmits the packet received by the physical network card to the user space through the data forwarding component, processes the data packet in the user space, and the data forwarding component transmits the processed data packet to the virtual machine network device through the data transmission channel.

[0267] For another example, the data forwarding component receives the data packet issued by the virtual machine network device through the data transmission channel, and the data forwarding component directly transmits the data packet to be sent to the physical network card of the host 111 through dpdk, so as to realize the sending of the data packet.

[0268] Based on the embodiment provided in FIG. 8A, the cloud management platform 120 deploys the adaptation module in the user space of the virtual machine, and the virtual machine 2 implements the control path configuration and the data path configuration by calling the adaptation module, switches the first IO control channel of the virtual machine 2 to the second IO control channel, and switches the first transmission protocol of the virtual machine 2 to the second transmission protocol. The switching of the virtual machine 2 at the control level and the data level is implemented, and it is ensured that the configured virtual machine 2 is adapted to the second state on the data path and the control path, and the running performance of the configured virtual machine 2 is ensured.

[0269] For example, as shown in FIG. 8B, the adaptation module is deployed in the kernel space of the virtual machine, and the vhost-net component is also deployed in the kernel space of the virtual machine 2. The vhost-net component establishes a control channel between the virtio driver (vhost-net setup) and the virtio device, and forms a control channel between the virtual network device-virtio device-vhost-net component, that is, the first IO control channel. The adaptation module is deployed in the vhost-net component. The virtual machine 2 implements the switching of the transmission protocol by calling the adaptation module.

[0270] For example, as shown in FIG. 8B, the second state is the user state, and compared with the schematic diagram shown in FIG. 8A, in FIG. 8B, the virtio device does not establish a control channel with the data forwarding component (wSwitch datapath), but only establishes a data transmission channel between the data forwarding component and the virtual machine network device.

[0271] Based on the embodiment provided in FIG. 8B, the cloud management platform 120 deploys the adaptation module in the kernel space of the virtual machine, and the virtual machine 2 implements the data path configuration by calling the adaptation module, and switches the first transmission protocol of the virtual machine 2 to the second transmission protocol. It is ensured that the switched virtual machine 2 is consistent with the virtual machine 1 before the switching at the control level, and only the transmission protocol is used to implement the switching at the data level, so that the steps of the virtual machine state switching are simplified, and the efficiency of the virtual machine state switching is improved.

[0272] In an optional implementation, in the case that the adaptation module is deployed in the kernel space of the virtual machine, in addition to the implementation shown in FIG. 8B, a port can also be set in the kernel space, and the forwarding of the data packet is implemented through the port. As shown in FIG. 8C, FIG. 8C is a schematic diagram three of deploying an adaptation module provided in an embodiment of the present application. Compared with FIG. 8B, in the schematic diagram shown in FIG. 8C, a data transmission channel is established between the vhost-net component and the virtual network device in the case that the second state is the user space. The adaptation module includes an eXpress Data Path (XDP) framework and an XDP port. The data forwarding component (wSwitch datapath) is running in the user space, and the first port (not shown in FIG. 8C) is set in the data forwarding component. The XDP port is extended in the vhost-net component through the adaptation module, the vhost-net component establishes a connection with the first port through the XDP port, and the data transmission channel between the vhost-net component and the data forwarding component is implemented.

[0273] The first port can be an AF_XDP type port. The first port is used to receive the packet sent by the vhost-net component.

[0274] Since the data forwarding component interacts with the physical network card of the host 111 through the dpdk, and the data transmission channel is established between the vhost-net component and the virtual network device, the data transmission channel between the virtual network device, the vhost-net component, the data transmission channel and the physical network card is established through the adaptation module. Therefore, the data packet received by the vhost-net component in the kernel space is forwarded to the data forwarding component in the user space for processing, and the data path is converted relative to the data path of the virtual machine 1.

[0275] Based on the embodiment provided in FIG. 8C, the deployment of the adaptation module is implemented by deploying the port in the kernel space, which can simplify the deployment mode of the adaptation module. By extending the XDP port, the vhost-net component in the kernel state is connected with the data forwarding component in the user space, the data packet in the kernel space is forwarded to the user space, and the data packet is processed in the user space. The switching of the data transmission path can be implemented without changing the IO control channel and the transmission protocol of the virtual machine 2. The steps of the virtual machine state switching are simplified, and the efficiency of the virtual machine state switching is improved.

[0276] In an optional implementation, after the message exchange mechanism of the virtual machine 2 is configured, the virtual machine 1 is migrated to the configured virtual machine 2. The configured virtual machine 2 provides services to the client 20.

[0277] The implementation of hot migration of the virtual machine 1 to the configured virtual machine 2 will be introduced below in combination with FIG. 9.

[0278] As shown in FIG. 9, FIG. 9 is a schematic diagram of a virtual machine migration process provided by an embodiment of the present application, and the virtual machine migration process shown includes steps S441 to S442.

[0279] S441, in the case where the virtual machine 1 executes a first task, the cloud management platform 120 migrates the state information of the virtual machine 1 to the configured virtual machine 2.

[0280] In an optional implementation, the first task can refer to a task that the virtual machine 1 is currently running, including but not limited to an AI model training task, a cloud application service, a content generation service, a cloud desktop service, etc.

[0281] In an optional implementation, the state information of the virtual machine 1 includes but is not limited to the following: an operating system kernel state, a user space process state, a virtual device state, a virtual machine layer state, memory data, a network connection state, a file system state, etc.

[0282] The operating system kernel state includes: kernel code and data structure, process table, memory management, file system, network protocol stack, and device driver, etc. The kernel code can refer to the binary code of the operating system kernel of the virtual machine 1, which is used to implement the core function of the operating system. The process table can refer to the process table maintained by the kernel. The process table records the information of the running processes in the virtual machine 1, such as process identification, process state, etc. The memory management is used to manage the memory allocation and recovery of the virtual machine 1, which includes the page table, memory region descriptor, etc. in the virtual machine 1.

[0283] The user space process state includes: the code segment, data segment, heap and stack of the process in the user space, and the process state.

[0284] The virtual device state includes: the read-write state of the virtual disk, the configuration information of the virtual network interface, etc.

[0285] The virtual machine layer state includes: virtual memory mapping, mapping information of virtual machine devices, etc. The virtual memory mapping is used to indicate the mapping information of the virtual memory to the physical memory. The mapping information of the virtual device is used to indicate the mapping information of the virtual device to the physical device.

[0286] The memory data can refer to the data in the memory of the virtual machine 1, including the data of the operating system memory and the data of the user space process.

[0287] The network connection state includes: the state information of the network connection and the data in the sending and receiving buffer.

[0288] The file system status includes file permissions, timestamps, file cache data, and the like.

[0289] In an optional implementation, in the implementation of migrating the state information of the virtual machine 1 to the configured virtual machine 2, mainly includes two stages:

[0290] The first stage is an iterative pre-copy stage. After the migration of the virtual machine 1 is started, the virtual machine 1 is still running on the host 111, and the first task running in the virtual machine 1 is not interrupted. The cloud management platform 120 first copies the state information of the virtual machine 1 to the virtual machine 2, and iteratively copies the memory data of the virtual machine 1 in the process of executing the first task to the virtual machine 2. When the iteration reaches a situation that the memory to be responsible for is less than or equal to a preset threshold, the second stage is entered.

[0291] The second stage is a shutdown copy stage. The virtual machine 1 is shut down, the first task is interrupted, and the remaining memory data in the virtual machine 1 is copied to the virtual machine 2. When the memory data copying is completed, it is determined that the online migration of the virtual machine 1 is successful, and the following step S442 is executed.

[0292] The virtual machine 1 shutdown can mean that the virtual machine 1 is suspended, and the virtual network card in the virtual machine 1 is disabled.

[0293] It should be noted that in the embodiments of the present application, there are multiple migration modes of the state information of the virtual machine 1, for example, migration can be performed by snapshot mode. For example, migration is implemented by memory dump technology, which is not limited in the present application.

[0294] S442, in the case that the online migration of the virtual machine 1 is successful, the cloud management platform 120 starts the configured virtual machine 2, and the configured virtual machine 2 executes the first task.

[0295] In an optional implementation, the implementation of the cloud management platform 120 starting the configured virtual machine 2 includes: the cloud management platform 120 controls the configured virtual machine 2 to complete the recovery processing before running according to the state information of the virtual machine 1, and starts the configured virtual machine 2.

[0296] In an optional implementation, after the cloud management platform 120 starts the configured virtual machine 2, the configured virtual machine 2 can be provided as a new virtual machine 1 to the client 20 to provide cloud services.

[0297] Based on the embodiments provided in FIG. 9, during the migration of the virtual machine, the state information of the virtual machine 1 is migrated to the configured virtual machine 2 in a hot migration manner without stopping the virtual machine 1. Since the configured virtual machine runs according to the second state, the virtual machine state switching can be realized without restarting the virtual machine. Moreover, since the virtual machine 1 and the virtual machine 2 run in the host 111 and have the same resources, the virtual machine state switching can be realized without reissuing the virtual machine resources.

[0298] It should be noted that the above mainly introduces the technical solutions provided by the embodiments of the present application from the perspective that the cloud management platform 120 first configures the message exchange mechanism of the virtual machine 2, and then migrates the virtual machine 1 to the configured virtual machine 2. In another embodiment, the virtual machine 2 can be created in the host 111, and then the virtual machine 1 is migrated to the virtual machine 2. After the migration of the virtual machine 1 is completed, the message exchange mechanism of the virtual machine 2 is configured.

[0299] As shown in FIG. 10, FIG. 10 is a flowchart of a virtual machine state switching method provided by an embodiment of the present application. Compared with the virtual machine state switching method shown in FIG. 4, the virtual machine state switching method shown in FIG. 10 includes steps S450-S460 after step S420.

[0300] S450, the cloud management platform 120 hot-migrates the virtual machine 1 to the virtual machine 2.

[0301] In an optional implementation, the cloud management platform 120 can hot-migrate the virtual machine 1 to the virtual machine 2 by referring to the embodiments provided in FIG. 9. The present application does not repeat here.

[0302] S460, according to the second state, the cloud management platform 120 configures the message exchange mechanism of the virtual machine 2 to obtain the configured virtual machine 2, and processes the data packet between the cloud platform and the client 20 through the configured virtual machine 2.

[0303] In an optional implementation, after the migration of the virtual machine 1 is completed, the virtual machine 2 can be started. The cloud management platform 120 configures the message exchange mechanism of the virtual machine 2 to obtain the configured virtual machine 2 by referring to the embodiments provided in FIG. 6 to FIG. 8C. The present application does not repeat here.

[0304] Based on the embodiments provided in FIG. 10, in the virtual machine state switching process, the cloud management platform 120 creates a virtual machine 2 in the host machine running the virtual machine 1, and hot migrates the virtual machine 1 to the virtual machine 2, realizes the online switching of the message exchange mechanism in the virtual machine. And based on the second state indicated by the switching request, the message exchange mechanism of the virtual machine 2 is configured. In this way, the data packet processing mode between the cloud platform and the client 20 is switched without shutting down the virtual machine 1. Thus, the loss caused by business interruption is reduced.

[0305] The above mainly introduces the virtual machine state switching method provided by the embodiments of the application from the perspective of the interaction between the modules in the cloud management platform 120. It can be understood that the cloud management platform 120 includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art can easily realize that the algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or computer software. Whether a certain function is executed in hardware or computer software driven hardware depends on the specific application of the technical solution and the constraints of the design. Professionals use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0306] The embodiments of the present application can group the functional modules of the cloud management platform 120 according to the above method embodiments. For example, each functional module can be grouped according to each function, or two or more functional modules can be integrated into one processing module. The above integrated module can be realized in the form of hardware or software functional module. It should be noted that the grouping and naming of the modules in the embodiments of the present application are illustrative, and only a logical grouping, and another grouping method can be used in actual implementation.

[0307] For example, the cloud management platform 120 can also be deployed with a virtual machine state switching device 11. The virtual machine state switching device 11 can be used to implement the above virtual machine state switching method. As shown in FIG. 11, the virtual machine state switching device 11 includes a communication module 1101, a processing module 1102, and a storage module 1103.

[0308] The communication module 1101 is configured to obtain a switching request of a first virtual machine. The switching request is used to indicate switching the first virtual machine from a first state to a second state. The first state is the kernel state, and the second state is the user state or the offload state. Or, the first state is the user state, and the second state is the offload state. For example, the communication module 1101 can perform S410 in FIG. 4.

[0309] The storage module 1103 is configured to store executable program code, virtual machine state switching apparatus 11 data in the process of processing virtual machine state switching, and the like. For example, the storage module 1103 stores messages, performance parameters, and the like.

[0310] The processing module 1102 is configured to create a second virtual machine in the first computing node in response to the switching request. According to the second state, the message exchange mechanism of the second virtual machine is configured, and the configured second virtual machine is obtained. The first virtual machine is hot migrated to the configured second virtual machine, and the data message between the cloud platform and the client 20 is processed through the configured second virtual machine. The message exchange mechanism is used to indicate the data message processing mode between the cloud platform and the client 20; and the configured second virtual machine runs according to the second state. For example, the switching module 1103 can be used to execute S420-S440 in FIG. 4.

[0311] The communication module 1101, the processing module 1102, and the storage module 1103 can be implemented by software or hardware. For example, the implementation of the processing module 1102 is described below, and the implementation of the communication module 1101 and the storage module 1103 can be referred to the implementation of the processing module 1102.

[0312] As an example of a software functional unit, the processing module 1102 can be code running on a computing instance. The computing instance can include at least one of a physical host (computing device), a virtual machine, and a container, and further, the computing instance can be one or more. For example, the switching module 1103 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region, or can be distributed in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ), or can be distributed in different AZs, and each AZ includes one data center or multiple data centers with similar geographical locations. Generally, one region can include multiple AZs.

[0313] Similarly, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC), or can be distributed in multiple VPCs. Generally, one VPC is set in one region, and a communication gateway needs to be set in each VPC for cross-region communication between two VPCs in the same region and between VPCs in different regions, and the interconnection between VPCs is realized through the communication gateway.

[0314] As an example of a hardware functional unit, the processing module 1102 can include at least one computing device, such as a server or the like. Alternatively, the processing module 1102 can also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the like. The PLD can be implemented by a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0315] The plurality of computing devices included in the processing module 1102 can be distributed in the same region or in different regions. The plurality of computing devices included in the communication module 1101 can be distributed in the same AZ or in different AZs. Similarly, the plurality of computing devices included in the processing module 1102 can be distributed in the same VPC or in multiple VPCs. The plurality of computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0316] It should be noted that in other embodiments, the processing module 1102 can be configured to perform any step of the virtual machine state switching method. The communication module 1101 can be configured to perform any step of the virtual machine state switching method. The storage module 1103 can be configured to perform any step of the virtual machine state switching method. The communication module 1101, the processing module 1102, and the storage module 1103 can be configured to perform any step of the virtual machine state switching method. The steps implemented by the communication module 1101, the processing module 1102, and the storage module 1103 can be specified as needed. The communication module 1101, the processing module 1102, and the storage module 1103 implement different steps of the virtual machine state switching method to achieve the overall function of the virtual machine state switching device 11.

[0317] The embodiments of the present application also provide a virtual machine state switching system 12 provided with the virtual machine state switching device 11 of FIG. 11. As shown in FIG. 12, the virtual machine state switching system 12 includes the virtual machine state switching device 11 and the client 20.

[0318] The client 20 is configured to send a switching request of the first virtual machine to the virtual machine state switching apparatus 11.

[0319] The virtual machine state switching apparatus 11 is configured to acquire the switching request of the first virtual machine, create a second virtual machine in the first computing node in response to the switching request, configure a message exchange mechanism of the second virtual machine according to a second state indicated by the switching request, obtain the configured second virtual machine, and hot migrate the first virtual machine to the configured second virtual machine, and process data packets between the cloud platform and the client 20 through the configured second virtual machine.

[0320] Similar to the implementation of the switching module 1103, the virtual machine state switching apparatus 11 can also be implemented by software or by hardware. The implementation of the virtual machine state switching apparatus 11 can refer to the implementation of the processing module 1102.

[0321] The embodiments of the present application also provide a computing device for executing the virtual machine state switching method.

[0322] In an example, the computing device can include the virtual machine state switching apparatus 11 as shown in FIG. 11. The virtual machine state switching apparatus 11 includes a communication module 1101, a processing module 1102, and a storage module 1103.

[0323] In another example, as shown in FIG. 13, the computing device 13 includes a bus 132, a processor 134, a memory 136, and a communication interface 138. The processor 134, the memory 136, and the communication interface 138 communicate through the bus 132. The computing device 13 can be a server or a terminal device. It should be understood that the number of the processor 134 and the memory 136 in the computing device 13 is not limited.

[0324] The bus 132 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one line is used in FIG. 13, but it does not mean that there is only one bus or only one type of bus. The bus 132 can include a path for transmitting information between various components (for example, the memory 136, the processor 134, the communication interface 138) of the computing device 13.

[0325] The processor 134 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.

[0326] In the present application, the processor 134 can execute the virtual machine state switching method provided in the above-mentioned FIG. 4. For example, receiving the switching request for the virtual machine 1, creating the virtual machine 2 in the host machine running the virtual machine 1, and configuring the message exchange mechanism of the virtual machine 2 based on the second state indicated by the switching request. And hot migrating the virtual machine 1 to the configured virtual machine 2, realizing the online switching of the message exchange mechanism in the virtual machine.

[0327] The memory 136 can include a volatile memory, such as a random access memory (RAM) for example. The processor 134 can also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD) for example.

[0328] The memory 136 stores executable program codes, and the processor 134 executes the executable program codes to respectively implement the functions of the aforementioned communication module 1101, processing module 1102, and storage module 1103, thereby implementing the virtual machine state switching method. That is, the memory 136 has instructions for executing the virtual machine state switching method.

[0329] The communication interface 138 uses a transceiving module such as, but not limited to, a network interface card or a transceiver, to realize the communication between the computing device 13 and other devices or communication networks.

[0330] The virtual machine state switching method disclosed in the above-mentioned method embodiments can be applied in or implemented by the processor 134. The processor 134 can be an integrated circuit chip with signal processor capability.

[0331] In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 134 or the instruction in the form of software. The processor 134 described above can be a general-purpose processor, including a CPU, a network processor (NP), etc.; can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete electronic tubes or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 136, and the processor 134 reads the information in the memory 136 and combines the hardware to complete the steps of the above method.

[0332] In a possible implementation, the processor 134 can also be used to execute a virtual machine state switching method, and specific implementation can refer to the embodiments provided by the above-mentioned virtual machine state switching method. The embodiments of the present application will not be repeated here.

[0333] In the embodiments of the present application, the chip system can be composed of a chip, or can include a chip and other discrete devices.

[0334] The embodiments of the present application also provide a computing device cluster 14 for executing the above-mentioned virtual machine state switching method.

[0335] In an example, the computing device cluster 14 can include a virtual machine state switching apparatus 11 as shown in FIG. 11, which includes a communication module 1101, a processing module 1102 and a storage module 1103.

[0336] In another example, the computing device cluster 14 can include a virtual machine state switching system 12 as shown in FIG. 12, which includes a virtual machine state switching apparatus 11 and a client 20.

[0337] In another example, as shown in FIG. 14, the computing device cluster 14 includes at least one computing device 13 as shown in FIG. 13. The computing device 13 includes a bus 132, a processor 134, a memory 136 and a communication interface 138. The processor 134, the memory 136 and the communication interface 138 communicate through the bus 132. The computing device 13 can be a server or a terminal device.

[0338] In a possible implementation, one or more computing devices in the computing device cluster 14 can be connected through a network. Wherein, the network can be a wide area network or a local area network, etc. FIG. 15 shows a possible implementation. As shown in FIG. 15, two computing devices 13A and 13B are connected through a network. Specifically, the connection is made through a communication interface in each computing device and the network. In this kind of possible implementation, the memory 136 in the computing device 13A stores instructions for executing the functions of the communication module 1101. Meanwhile, the memory 136 in the computing device 13B stores instructions for executing the functions of the processing module 1102 and the storage module 1103.

[0339] The connection between the computing device cluster shown in FIG. 15 can be considered in the virtual machine state switching method provided in the present application. In the virtual machine state switching process, the message exchange mechanism configuration and the virtual machine live migration are involved, and a large amount of data needs to be processed. Therefore, it is considered that the functions implemented by the processing module 1102 and the storage module 1103 are executed by the computing device 13B, and the functions implemented by the communication module 1101 are executed by the computing device 13A.

[0340] It should be understood that the functions of the computing device 13A shown in FIG. 15 can also be completed by multiple computing devices 13. Similarly, the functions of the computing device 13B can also be completed by multiple computing devices 13.

[0341] The embodiments of the present application also provide a computer program product containing instructions. The computer program product can be a software or program product containing instructions, which can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to execute the virtual machine state switching method described above.

[0342] For example, when the computer program product is run on at least one computing device, the at least one computing device is caused to execute the virtual machine state switching method shown in FIG. 4.

[0343] The embodiments of the present application further provide a computer readable storage medium. All or part of the processes in the above method embodiments can be instructed by a computer program to relevant hardware to complete, the program can be stored in the above computer readable storage medium, and the program can include the processes of the above method embodiments when executed. The computer readable storage medium can be the terminal of any of the preceding embodiments, such as an internal storage unit including a data transmission end and / or a data receiving end, for example, a hard disk or a memory of the terminal. The above computer readable storage medium can also be an external storage device of the terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal. Further, the above computer readable storage medium can include both the internal storage unit and the external storage device of the terminal. The above computer readable storage medium is used to store the above computer program and other programs and data required by the terminal. The above computer readable storage medium can also be used to temporarily store data that has been output or will be output.

[0344] It should be noted that the terms "first" and "second" and the like in the specification, claims and drawings of the present application are used to distinguish different objects, and are not used to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.

[0345] It should be understood that in the present application, "at least one" means one or more, "multiple" means two or more, "at least two" means two or three and more, and "and / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases of only A, only B and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b and c can be single or multiple.

[0346] It should be understood that, in the embodiments of the present application, "B corresponding to A" means that B is associated with A. For example, B can be determined according to A. It should also be understood that determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information. In addition, "connection" appearing in the embodiments of the present application refers to various connection modes such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not make any limitation thereto.

[0347] "transmit / transmission" appearing in the embodiments of the present application means bidirectional transmission containing sending and / or receiving actions, without special instructions. Specifically, "transmit / transmission" in the embodiments of the present application contains sending of data, receiving of data, or sending of data and receiving of data. Or, data transmission here includes uplink and / or downlink data transmission. Data can include channels and / or signals, uplink data transmission is uplink channel and / or uplink signal transmission, and downlink data transmission is downlink channel and / or downlink signal transmission.

[0348] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of switching a virtual machine state, characterized by, The method is applied to a cloud management platform; The cloud management platform comprises a first computing node in which a first virtual machine is deployed; the method comprises: obtaining a switching request of the first virtual machine; wherein the switching request is used to indicate switching the first virtual machine from a first state to a second state, the first state is a kernel state, and the second state is a user state or an offload state; or the first state is a user state, and the second state is an offload state; in response to the switching request, creating a second virtual machine in the first computing node; configuring a message exchange mechanism of the second virtual machine according to the second state, to obtain a configured second virtual machine; the message exchange mechanism is used to indicate a data packet processing mode between the cloud management platform and a client; and the configured second virtual machine runs according to the second state; hot migrating the first virtual machine to the configured second virtual machine, and processing data packets between the cloud management platform and the client through the configured second virtual machine.

2. The method of claim 1, wherein, The second virtual machine comprises a user space and a virtual network card; and the configuring the message exchange mechanism of the second virtual machine according to the second state comprises: switching a first IO control channel of the second virtual machine to a second IO control channel, and switching a first transmission protocol of the second virtual machine to a second transmission protocol; wherein the second IO control channel is related to the second state; and the second IO control channel is used to indicate that an IO channel of the second virtual machine is managed in the user space or the virtual network card; the second transmission protocol is related to the second state; and the second transmission protocol is used to indicate that data packets between the second virtual machine and a client are forwarded in the user space or through the virtual network card.

3. The method of claim 1, wherein, The second virtual machine comprises a kernel space, a user space and a virtual network card; and the configuring the message exchange mechanism of the second virtual machine according to the second state comprises: switching a first transmission protocol of the second virtual machine to a second transmission protocol; and the second transmission protocol is related to the second state; wherein the second transmission protocol is used to indicate that data packets between the second virtual machine and a client are forwarded in the user space or through the virtual network card; the configured second virtual machine and the first virtual machine both manage an IO channel of a virtual machine in a kernel space, or the configured second virtual machine and the first virtual machine both manage an IO channel of a virtual machine in a user space.

4. The method of claim 1, wherein, The second virtual machine comprises a kernel space and a user space; and the configuring the message exchange mechanism of the second virtual machine according to the second state comprises: in a case where the second state is a user state, forwarding data packets of the kernel space to the user space.

5. The method according to any one of claims 1 to 4, characterized in that, The first virtual machine and the second virtual machine have the same resources; and the resources comprise computing resources, storage resources and virtual network cards.

6. The method according to any one of claims 1 to 5, characterized in that, The second virtual machine comprises a user space and a virtual network card; If the second state is the user state, the configured second virtual machine processes data messages between the cloud management platform and the client in the user space; If the second state is the offload state, the configured second virtual machine processes data messages between the cloud management platform and the client through the virtual network card.

7. The method according to any one of claims 1 to 6, characterized in that, The hot migration of the first virtual machine to the configured second virtual machine comprises: In the case that the first virtual machine executes a first task, migrating state information of the first virtual machine to the configured second virtual machine; In the case that the online migration of the first virtual machine succeeds, starting the configured second virtual machine to execute the first task.

8. A virtual machine state switching apparatus characterized by comprising: The virtual machine state switching device is deployed in a cloud management platform; The cloud management platform comprises a first computing node, and the first computing node is deployed with a first virtual machine; the device comprises: A communication module is configured to acquire a switching request of the first virtual machine; wherein the switching request is used to indicate switching the first virtual machine from a first state to a second state, the first state is a kernel state, and the second state is a user state or an offload state; or the first state is a user state, and the second state is an offload state; A processing module is configured to, in response to the switching request, create a second virtual machine in the first computing node, configure a message exchange mechanism of the second virtual machine according to the second state to obtain a configured second virtual machine, and hot migrate the first virtual machine to the configured second virtual machine to process data messages between the cloud management platform and the client through the configured second virtual machine; wherein the message exchange mechanism is used to indicate a data message processing mode between the cloud management platform and the client; and the configured second virtual machine operates according to the second state.

9. The apparatus of claim 8, wherein, The processing module, the second virtual machine comprises a user space and a virtual network card; the processing module is further configured to switch a first IO control channel of the second virtual machine to a second IO control channel, and switch a first transmission protocol of the second virtual machine to a second transmission protocol; The second IO control channel is related to the second state; the second IO control channel is used to indicate managing an IO channel of the second virtual machine in the user space or the virtual network card; The second transmission protocol is related to the second state; the second transmission protocol is used to indicate forwarding data messages between the second virtual machine and the client in the user space, or forwarding data messages between the second virtual machine and the client through the virtual network card.

10. The apparatus of claim 9, wherein, The processing module is further configured to manage the IO control channel of the second virtual machine.

11. The apparatus of claim 8, wherein, The second virtual machine comprises a kernel space, a user space and a virtual network card; the processing module is configured to switch a first transmission protocol of the second virtual machine to a second transmission protocol; the second transmission protocol is related to the second state. The second transmission protocol is used to indicate forwarding of data messages between the second virtual machine and a client in the user space or forwarding of the data messages between the second virtual machine and the client through the virtual network card. The configured second virtual machine and the first virtual machine manage IO channels of the virtual machine in the kernel space, or the configured second virtual machine and the first virtual machine manage IO channels of the virtual machine in the user space.

12. The apparatus of claim 8, wherein, The second virtual machine includes a kernel space and a user space. The processing module is configured to forward data messages of the kernel space to the user space when the second state is the user state.

13. The apparatus of any one of claims 8-12, wherein, The first virtual machine and the second virtual machine have the same resources, and the resources include computing resources, storage resources, and virtual network cards.

14. The apparatus of any one of claims 8-13, wherein, The second virtual machine includes a user space and a virtual network card. If the second state is a user state, the configured second virtual machine processes data messages between the cloud management platform and a client in the user space. If the second state is an offloading state, the configured second virtual machine processes data messages between the cloud management platform and a client through the virtual network card.

15. The apparatus of any one of claims 8-14, wherein, The processing module is further configured to: migrate state information of the first virtual machine to the configured second virtual machine when the first virtual machine executes a first task; start the configured second virtual machine to execute the first task when the first virtual machine is successfully online migrated.

16. A cluster of computing devices, characterized in that, The computing device cluster includes at least one computing device, and each computing device includes a processor and a memory. The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in any one of claims 1 to 7.

17. A computer readable storage medium characterized by: The computer program instructions, when executed by a computing device, cause the computing device to execute the method in any one of claims 1 to 7.

18. A computer program product comprising instructions, characterized in that, The instructions, when executed by a computing device, cause the computing device to execute the method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Direct device visiting model-based virtual machine migrating method and apparatus

    CN106569876A

  • Virtual machine migration method and device

    CN109739618A

  • Connectivity migration in a virtual execution system

    CN113874838A

  • Secure virtual machine state switching method and related equipment

    CN118467103A

Cited By

  • A method for processing bidirectional messages based on a unified user mode channel

    CN122179399A