A hot switching method and device for virtualized equipment

By adding virtualization device hot switch module to the hypervisor, removing and migrating the configuration information and data queue status data of virtualization devices, the problem of low virtualization switching efficiency is solved and efficient virtualization device hot switch is achieved and service continuity.

CN114416294BActive Publication Date: 2024-12-13ALIBABA (CHINA) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111679774.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-12-13
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The existing virtualization device switching method requires a lot of time to process data migration during the virtual machine operation, which may cause the virtual machine to be suspended and the switching efficiency is low.

Method used

By adding a virtualization device hot switch module in the hypervisor, remove virtualization devices that communicate with the virtual machine in the physical device, mount a new virtualization device, and migrate its configuration information and data queue status data to New device, reconfigure new device to establish a communication connection with the virtual machine.

Benefits of technology

It realizes efficient switching of virtualized devices while the virtual machine is basically maintained in normal operation, improves the switching efficiency of virtual machines, and ensures that service is not interrupted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416294B_ABST
    Figure CN114416294B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and apparatus for hot switching of virtualized devices, the method comprising: removing the virtualized device currently in communication connection with the virtual machine in the physical device; mounting the new virtualized device to the device interface corresponding to the removed virtualized device; migrating the configuration information of the removed virtualized device and the state data of the data queue to the new virtualized device; configuring the new virtualized device to establish a communication connection with the virtual machine. The virtualized device can establish a communication connection with the virtual machine in the same operating state as the removed virtualized device, so as to achieve efficient completion of hot switching of the virtualized device while the virtual machine basically maintains normal operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a hot switching method for a virtualized device and a hot switching device for a virtualized device. Background Art

[0002] The Single Root I / O Virtualization (SR-IOV) protocol is an extension of the standard PCIe bus interconnection protocol. Its main goal is to present a single physical device as a physical function device (physical function, pf) and several virtualized devices (virtual function, vf) through the hardware virtualization of the I / O physical device itself. The Single Root I / O Virtualization protocol can serve a single-machine computer system that supports direct I / O virtualization. Each virtual machine (Virtual Machine, VM) running on the system can directly have an independent physical device or virtualized device.

[0003] Generally speaking, during the operation of a virtual machine, in order to ensure the normal operation of the virtual machine, the virtualization device connected to the virtual machine can be switched. However, the existing virtualization device switching method usually takes a lot of time to process data migration and may also require the virtual machine to suspend operation, resulting in low switching efficiency of the virtual machine. Summary of the invention

[0004] In view of the above problems, embodiments of the present application are proposed to provide a hot switching method for a virtualized device and a hot switching device for a virtualized device that overcome the above problems or at least partially solve the above problems.

[0005] In order to solve the above problems, an embodiment of the present application discloses a method for hot switching of a virtualized device, comprising:

[0006] Remove the virtualized device in the physical device that is currently communicating with the virtual machine;

[0007] Mount the new virtualized device to the device interface corresponding to the removed virtualized device;

[0008] Migrating the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device;

[0009] The new virtualized device is configured to establish a communication connection with the virtual machine.

[0010] Optionally, the step of removing the virtualized device in the physical device that is communicatively connected to the virtual machine includes:

[0011] Get the device identification number;

[0012] Based on the device identification number, searching for a virtualized device to be removed that is currently in communication connection with the virtual machine in a physical device;

[0013] Remove the virtualized device to be removed.

[0014] Optionally, the method comprises:

[0015] Based on the device identification number of the removed virtualized device, find the device interface corresponding to the removed virtualized device.

[0016] Optionally, the step of migrating the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device includes:

[0017] Obtain configuration information of the removed virtualized device and status data of the data queue from the virtualized device status storage module;

[0018] The preset physical function driver is called to migrate the configuration information of the removed virtualized device and the state data of the data queue to the new virtualized device.

[0019] Optionally, the method further comprises:

[0020] When the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored.

[0021] Optionally, when the virtual machine establishes a connection with the virtualized device in the physical device, the step of storing the configuration information and the device identification number of the virtualized device includes:

[0022] When the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored through the virtualized device state storage module.

[0023] Optionally, the method further comprises:

[0024] During the communication between the virtual machine and the virtualized device, the configuration information of the virtualized device is synchronously updated through the virtualized device state storage module, and the state data of the data queue is synchronously stored.

[0025] The embodiment of the present application also provides a hot switching device for a virtualized device, characterized in that it includes:

[0026] A removal module, used to remove the virtualized device currently in communication connection with the virtual machine in the physical device;

[0027] A mounting module, used to mount a new virtualized device to a device interface corresponding to the removed virtualized device;

[0028] A migration module, used to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device;

[0029] The reconfiguration module is used to configure the new virtualization device to establish a communication connection with the virtual machine.

[0030] Optionally, the removal module includes:

[0031] The identification acquisition submodule is used to obtain the device identification number;

[0032] A device search submodule, used for searching, based on the device identification number, a virtualized device to be removed that is currently in communication connection with the virtual machine in a physical device;

[0033] The removal submodule is used to remove the virtualized device to be removed.

[0034] Optionally, the device comprises:

[0035] The interface search module is used to search for a device interface corresponding to the removed virtualized device based on the device identification number of the removed virtualized device.

[0036] Optionally, the migration module includes:

[0037] A data acquisition submodule, used to acquire configuration information of the removed virtualized device and status data of the data queue from the virtualized device status storage module;

[0038] The migration submodule is used to call a preset physical function driver to migrate the configuration information of the removed virtualized device and the status data of the data queue to a new virtualized device.

[0039] Optionally, the device further comprises:

[0040] The configuration storage module is used to store the configuration information and device identification number of the virtualized device when the virtual machine establishes a connection with the virtualized device in the physical device.

[0041] Optionally, the configuration storage module includes:

[0042] The configuration storage submodule is used to store the configuration information and device identification number of the virtualized device through the virtualized device state storage module when the virtual machine establishes a connection with the virtualized device in the physical device.

[0043] Optionally, the device further comprises:

[0044] The synchronization module is used to synchronously update the configuration information of the virtualized device through the virtualized device state storage module during the communication between the virtual machine and the virtualized device, and synchronously store the state data of the data queue.

[0045] The present application also discloses an electronic device, including:

[0046] one or more processors; and

[0047] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to execute the method as described in any one of the embodiments of the present application.

[0048] The embodiments of the present application also disclose one or more machine-readable media on which instructions are stored, which, when executed by one or more processors, enable the processors to execute the method described in any one of the embodiments of the present application.

[0049] The embodiments of the present application include the following advantages:

[0050] Through the hot switching method of the virtualized device of the embodiment of the present application, the virtualized device currently in communication connection with the virtual machine in the physical device is removed, the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, and the configuration information of the removed virtualized device and the status data of the data queue are migrated to the new virtualized device, so that the new virtualized device can have the same operating state as the removed virtualized device. The new virtualized device is configured to establish a communication connection with the virtual machine, so that the virtualized device can establish a communication connection with the virtual machine in the same operating state as the removed virtualized device, so as to achieve efficient completion of the hot switching of the virtualized device while the virtual machine basically maintains normal operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of a device in an embodiment of the present application;

[0052] Figure 2 This is a flowchart of a hot switching method for a virtualized device according to an embodiment of the present application;

[0053] Figure 3 is a flowchart of another hot switching method embodiment of a virtualized device according to an embodiment of the present application;

[0054] Figure 4 is another schematic diagram of a device in an embodiment of the present application;

[0055] Figure 5 is another schematic diagram of a device in an embodiment of the present application;

[0056] Figure 6 It is a structural block diagram of an embodiment of a hot switching device of a virtualized device in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0058] In the embodiment of the present application, the I / O physical device can use the single root I / O virtualization (SR-IOV) protocol to virtualize itself into a physical function device (physical function, PF) and several virtualization devices (virtual function, VF), and connect the virtualization devices (VF) to the virtual machines running in the server one by one. Among them, the physical function device (PF) can also be called a physical function, and the virtualization device (VF) can also be called a virtual function.

[0059] The embodiment of the present application adds a virtualization device hot-swap module in the virtual machine management program (Hypervisor), and manages the initialization, hot-swap and state recovery of the virtualization device through the virtual machine hot-swap module. When hot-switching of the virtualization device is required, the new virtualization device is mounted to the device interface corresponding to the removed virtualization device, and the configuration information of the removed virtualization device and the state data of the data queue are migrated to the new virtualization device, and then the new virtualization device can be connected to the virtual machine for communication, so that the hot-switching of the virtualization device can be quickly realized, and the virtual machine can quickly switch to communicate with other virtualization devices while basically maintaining normal operation.

[0060] As an example of this application, Figure 1 This is a schematic diagram of a device in an embodiment of the present application. It includes a server and a physical device. Multiple virtual machines can be run in the server. Through the I / O device virtualization technology, virtualized device 1, virtualized device 2, and virtualized device 3 can be run in the physical device. Each virtual machine in the server can be connected to a virtualized device respectively, so that each virtual machine can have an independent I / O device.

[0061] Reference Figure 2 , shows a flowchart of a hot switching method for a virtualized device according to an embodiment of the present application, which may specifically include the following steps:

[0062] Step 201, removing the virtualized device currently communicating with the virtual machine in the physical device;

[0063] Specifically, in order to achieve efficient hot switching of virtualized devices, a virtualized device hot switching module can be added to a hypervisor. The virtualized device hot switching module can be used to manage initialization, hot switching, and state recovery of virtualized devices.

[0064] When hot switching of a virtual machine is required, the virtualization device hot switching module may first remove the virtualization device currently communicating with the virtual machine in the physical device, so as to subsequently switch the virtualization device communicating with the virtual machine to another device.

[0065] Step 202, mounting the new virtualized device to the device interface corresponding to the removed virtualized device;

[0066] Specifically, the physical device can provide a device interface such as a PCIe (Peripheral Component Interconnect Express, PCIe) interface. The virtual machine can connect to the virtualized device through the device interface. In order to ensure that the virtual machine will not cause service interruption due to the switching of the virtualized device, the virtualized device hot-swap module can mount the new virtualized device to the device interface corresponding to the removed virtualized device, so that the virtual machine can continue to run in the original state without interrupting the service to adjust its own configuration.

[0067] Step 203, migrating the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device;

[0068] After the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, the new virtualized device needs to be further configured to the same state as the removed virtualized device. In order to achieve rapid migration of virtualized devices, the virtualized device hot-swap module can pre-store the configuration information of the virtualized device and the status data of the data queue. By storing the configuration information of the virtualized device and the status data of the data queue, the current operating state of the virtualized device can be quickly restored during the hot migration process.

[0069] As a specific example of the present application, the configuration information of the virtualized device may include interrupt configuration status (MSI-X), direct memory access (DMA) mapping configuration, base address register (BAR) space mapping configuration, and configuration space, etc.

[0070] The data queue (virtqueue) may be an actual data link for data exchange. The status data of the data queue may include the base address of the data queue, the currently available id value (last_avail_idx), the currently used id value (last_used_idx), and the like.

[0071] Therefore, after the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, the virtualized device hot switch module can obtain the configuration information of the removed virtualized device and the status data of the data queue, and migrate them to the new virtualized device, so that the new virtualized device can have the same operating status as the removed virtualized device.

[0072] Step 204: configure the new virtualized device to establish a communication connection with the virtual machine.

[0073] After the configuration information of the removed virtualized device and the state data of the data queue have been migrated to the new virtualized device, and the new virtualized device has the same state as the removed virtualized device, in order to enable the new virtualized device to establish a communication connection with the virtual machine normally, the new virtualized device is reconfigured so that the virtualized device can establish a communication connection with the virtual machine in the same running state as the removed virtualized device. For the virtual machine, it does not need to be adjusted, but can continue to run in the original way, thereby realizing the hot migration of virtualized devices without the perception of the virtual machine, and the migration efficiency is high.

[0074] In a specific implementation, the virtualization device hot-swap module can simulate BIOS operations, initialize new virtualization devices, reconfigure functions of virtualization devices such as MSIX interrupt functions, etc., so that other devices associated with physical devices such as CPUs can provide services for the new virtualization devices, so that the new virtualization devices can operate normally, so that the virtual machines can communicate normally with the new virtualization devices, and so that the new virtualization devices can establish a communication connection with the virtual machines.

[0075] Through the hot switching method of the virtualized device of the embodiment of the present application, the virtualized device currently in communication connection with the virtual machine in the physical device is removed, the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, and the configuration information of the removed virtualized device and the status data of the data queue are migrated to the new virtualized device, so that the new virtualized device can have the same operating state as the removed virtualized device. The new virtualized device is configured to establish a communication connection with the virtual machine, so that the virtualized device can establish a communication connection with the virtual machine in the same operating state as the removed virtualized device, so as to achieve efficient completion of the hot switching of the virtualized device while the virtual machine basically maintains normal operation.

[0076] Reference Figure 3 , shows a flowchart of a hot switching method for a virtualized device according to an embodiment of the present application, which may specifically include the following steps:

[0077] Step 301, remove the virtualized device currently communicating with the virtual machine in the physical device;

[0078] Specifically, in order to achieve efficient hot switching of virtualized devices, a virtualized device hot switching module can be added to a hypervisor. The virtualized device hot switching module can be used to manage initialization, hot switching, and state recovery of virtualized devices.

[0079] When hot switching of a virtual machine is required, the virtualization device hot switching module may first remove the virtualization device currently communicating with the virtual machine in the physical device, so as to subsequently switch the virtualization device communicating with the virtual machine to another device.

[0080] In one embodiment of the present application, the step of removing the virtualized device in the physical device that is communicatively connected to the virtual machine includes:

[0081] S11, obtaining a device identification number;

[0082] In the virtualization device hot switching module, the correspondence between the virtual machine and the virtualization device can be stored. Specifically, the virtualization device hot switching module can store the correspondence between the virtual machine and the device identification number of the virtualization device. Therefore, when it is necessary to hot switch the virtualization device for the virtual machine, the device identification number corresponding to the virtual machine can be found to determine the virtualization device corresponding to the virtual machine.

[0083] S12, based on the device identification number, searching for a virtualized device to be removed that is currently in communication connection with the virtual machine in a physical device;

[0084] After the device identification number is obtained, the virtualized device to be removed that is currently in communication connection with the virtual machine can be searched in the physical device based on the device identification number, so as to further process the virtualized device to be removed.

[0085] S13: Remove the virtualized device to be removed.

[0086] After the virtualized device to be removed is found, the virtualized device to be removed can be removed so that the virtualized device hot-swap module can perform subsequent hot-swap processing.

[0087] In one embodiment of the present application, the method further includes:

[0088] S21, when the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored.

[0089] Specifically, when a virtual device in a physical device is allocated to a virtual machine and a connection is established between the virtual machine and the virtual device, the virtual device hot-swap module may request to store configuration information of the virtual device to back up the running state of the virtual device.

[0090] At the same time, in order to record the correspondence between the virtual machine and the virtualized device, the device identification number of the virtualized device can be further recorded, so that when processing hot switching later, the virtualized device corresponding to the virtual machine can be quickly determined based on the device identification number corresponding to the virtual machine.

[0091] In a specific implementation, the virtualization device hot-swap module can take over the initialization of the virtualization device and be responsible for providing the corresponding virtualization host to the virtual machine based on the device identification number of the virtualization host. Therefore, when the virtualization device is provided to the virtual machine through the virtualization host migration module so that the virtual machine and the virtualization device are connected, the virtualization host migration module can store the configuration information and device identification number of the virtualization device.

[0092] In one embodiment of the present application, when the virtual machine establishes a connection with the virtualized device in the physical device, the step of storing the configuration information and the device identification number of the virtualized device includes:

[0093] S31, when the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored through the virtualized device state storage module.

[0094] In order to achieve rapid migration of virtualized devices, a virtualized device state storage module can be set in the server's virtual machine management program. The virtualized device state storage module can be used to synchronously obtain the configuration information of the virtualized device and the state data of the data queue. By obtaining the configuration information of the virtualized device and the state data of the data queue, the current operating state of the virtualized device can be synchronized.

[0095] Thus, when the virtual machine establishes a connection with the virtualized device in the physical device, it can request to store the initial configuration information of the virtualized device through the virtualized device state storage module, so as to back up the running state of the virtualized device from the time when the virtual machine establishes a connection with the virtualized device in the physical device. At the same time, it can also request the virtualized device state storage module to store the device identification number of the virtualized device, so as to record the corresponding relationship between the virtual machine and the virtualized device.

[0096] In a specific implementation, when the virtualized device is provided to the virtual machine through the virtualization host migration module so that the virtual machine establishes a connection with the virtualized device, the virtualization host migration module can store the configuration information and device identification number of the virtualized device, and send the configuration information and device identification number of the virtualized device to the virtualization device status storage module for storage.

[0097] In one embodiment of the present application, the method further includes:

[0098] S41, during the communication between the virtual machine and the virtualized device, synchronously updating the configuration information of the virtualized device through the virtualized device state storage module, and synchronously storing the state data of the data queue.

[0099] Specifically, during the communication between the virtual machine and the virtualized device, the configuration information of the virtualized device can be synchronously updated in real time through the virtualized device status storage module, and the status data of the data queue can be synchronously stored in real time, so that when the virtualized device fails, the virtualized device can be restored to the latest state in time, so that the virtual machine can continue to operate normally.

[0100] In a specific implementation, a physical function driver may be provided in the server. The physical function driver may be used to manage physical devices, create virtualized devices in physical devices, set up virtual machines to communicate with virtualized devices, configure virtualized devices, and other functions.

[0101] Therefore, the virtualized device state storage module can obtain the configuration information of the virtualized device and the state data of the data queue in real time through the physical function driver, and realize the synchronous update of the configuration information of the virtualized device and the state data of the data queue.

[0102] Step 302, mounting the new virtualized device to the device interface corresponding to the removed virtualized device;

[0103] Specifically, the physical device can provide a device interface such as a PCIe (Peripheral Component Interconnect Express, PCIe) interface. The virtual machine can connect to the virtualized device through the device interface. In order to ensure that the virtual machine will not cause service interruption due to the switching of the virtualized device, the virtualized device hot-swap module can mount the new virtualized device to the device interface corresponding to the removed virtualized device, so that the virtual machine can continue to run in the original state without interrupting the service to adjust its own configuration.

[0104] In one embodiment of the present application, the method includes:

[0105] S21, searching for a device interface corresponding to the removed virtualized device based on the device identification number of the removed virtualized device.

[0106] Specifically, the virtualization host migration module can store the device interface information of the virtualization device by storing the configuration information of the virtualization device. In the case where it is necessary to determine the device interface corresponding to the removed virtualization device, the virtualization host migration module can search for the configuration information of the removed virtualization device based on the device identification number, and obtain the device interface information of the virtualization device therefrom. In this way, the virtualization host migration module can efficiently mount the new virtualization device to the device interface corresponding to the removed virtualization device.

[0107] Step 303, obtaining configuration information of the removed virtualized device and status data of the data queue from the virtualized device status storage module;

[0108] In a specific implementation, after the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, it is necessary to further configure the new virtualized device to the same state as the removed virtualized device. In order to achieve rapid migration of virtualized devices, the configuration information of the removed virtualized device and the status data of the data queue can be obtained from the virtualized device state storage module. By obtaining the configuration information of the virtualized device and the status data of the data queue, the current running state of the synchronized virtualized device can be achieved.

[0109] Step 304: call a preset physical function driver to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device.

[0110] After obtaining the configuration information of the removed virtualized device and the status data of the data queue from the virtualized device status storage module, the virtualized device hot switch module can call the preset physical function driver to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device, so that the new virtualized device can have the same operating status as the removed virtualized device.

[0111] In a specific implementation, there may be some idle virtualized devices in the virtualized devices of the physical device. Therefore, in order to quickly perform hot switching of virtualized devices, an idle virtualized device can be found as a new virtualized device. A new virtualized device can also be created by a physical function driver. Thereafter, the configuration information of the new virtualized device and the state data of the data queue can be set to be the same as those of the removed virtualized device, thereby completing the migration of the configuration information of the removed virtualized device and the state data of the data queue.

[0112] Step 305: configure the new virtualization device to establish a communication connection with the virtual machine.

[0113] After the configuration information of the removed virtualized device and the state data of the data queue have been migrated to the new virtualized device, and the new virtualized device has the same state as the removed virtualized device, in order to enable the new virtualized device to establish a communication connection with the virtual machine normally, the new virtualized device is reconfigured so that the virtualized device can establish a communication connection with the virtual machine in the same running state as the removed virtualized device. For the virtual machine, it does not need to be adjusted, but can continue to run in the original way, thereby realizing the hot migration of virtualized devices without the perception of the virtual machine, and the migration efficiency is high.

[0114] In a specific implementation, the virtualization device hot-swap module can simulate BIOS operations, initialize new virtualization devices, reconfigure functions of virtualization devices such as MSIX interrupt functions, etc., so that other devices associated with physical devices such as CPUs can provide services for the new virtualization devices, so that the new virtualization devices can operate normally, so that the virtual machines can communicate normally with the new virtualization devices, and so that the new virtualization devices can establish a communication connection with the virtual machines.

[0115] Through the hot switching method of the virtualized device of the embodiment of the present application, the virtualized device currently in communication connection with the virtual machine in the physical device is removed, the new virtualized device is mounted to the device interface corresponding to the removed virtualized device, and the configuration information of the removed virtualized device and the status data of the data queue are migrated to the new virtualized device, so that the new virtualized device can have the same operating state as the removed virtualized device. The new virtualized device is configured to establish a communication connection with the virtual machine, so that the virtualized device can establish a communication connection with the virtual machine in the same operating state as the removed virtualized device, so as to achieve efficient completion of the hot switching of the virtualized device while the virtual machine basically maintains normal operation.

[0116] As a specific example of this application, Figure 4 A schematic diagram of a device for this application.

[0117] When establishing a communication connection between the virtual machine and the virtualized device 1 through the virtualized device hot-swap module, the virtualized device hot-swap module can obtain the configuration information and device identification number of the virtualized device 1. The virtualized device hot-swap module can store the configuration information exception of the virtualized device 1 from the device identification number to the virtualized device status storage module. Thereafter, during the communication process between the virtual machine and the virtualized device, the virtualized device status storage module can obtain the configuration information of the virtualized device and the status information of the data queue in real time through the physical function driver, and store them synchronously, thereby realizing the real-time storage of the configuration information of the virtualized device and the status information of the data queue.

[0118] As a specific example of this application, Figure 5 This is another device schematic diagram of the present application.

[0119] When it is necessary to hot-swap the virtualized device corresponding to the virtual machine, the virtualized device hot-swap module can remove the virtualized device 1 currently communicating with the virtual machine in the physical device, and mount the new virtualized device 2 to the device interface corresponding to the removed virtualized device 1. Afterwards, the virtualized device hot-swap module obtains the configuration information of the removed virtualized device and the status data of the data queue from the virtualized device status storage module, and calls the preset physical function driver to migrate the configuration information of the removed virtualized device 1 and the status data of the data queue to the new virtualized device 2, so that the new virtualized device can have the same operating status as the removed virtualized device. Thereafter, the new virtualized device 2 is configured to establish a communication connection with the virtual machine, so as to efficiently complete the hot-swap of the virtualized device while the virtual machine basically maintains normal operation.

[0120] Through the hot switching method of virtualized devices provided in the embodiment of the present application, when a virtual machine detects a virtualized device failure in a physical device, the virtualized device hot switching module calls the virtualized device status storage module to obtain the configuration information of the removed virtualized device and the status data of the data queue, and calls the preset physical function driver to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device, so that the new virtualized device can have the same operating status as the removed virtualized device, and then the virtual machine is hot migrated to communicate with the new virtualized device, so that the virtual machine can continue to process the service that was originally being processed, ensuring that the service of the virtual machine will not be interrupted, thereby achieving efficient recovery of the virtualized device.

[0121] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0122] Reference Figure 6 , shows a structural block diagram of another embodiment of a hot switching device of a virtualized device according to an embodiment of the present application, which may specifically include the following modules:

[0123] Removal module 601, used to remove the virtualized device currently in communication connection with the virtual machine in the physical device;

[0124] The mounting module 602 is used to mount the new virtualized device to the device interface corresponding to the removed virtualized device;

[0125] A migration module 603, configured to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device;

[0126] The reconfiguration module 604 is used to configure the new virtualized device to establish a communication connection with the virtual machine.

[0127] Optionally, the removal module includes:

[0128] The identification acquisition submodule is used to obtain the device identification number;

[0129] A device search submodule, used for searching, based on the device identification number, a virtualized device to be removed that is currently in communication connection with the virtual machine in a physical device;

[0130] The removal submodule is used to remove the virtualized device to be removed.

[0131] Optionally, the device comprises:

[0132] The interface search module is used to search for a device interface corresponding to the removed virtualized device based on the device identification number of the removed virtualized device.

[0133] Optionally, the migration module includes:

[0134] A data acquisition submodule, used to acquire configuration information of the removed virtualized device and status data of the data queue from the virtualized device status storage module;

[0135] The migration submodule is used to call a preset physical function driver to migrate the configuration information of the removed virtualized device and the status data of the data queue to a new virtualized device.

[0136] Optionally, the device further comprises:

[0137] The configuration storage module is used to store the configuration information and device identification number of the virtualized device when the virtual machine establishes a connection with the virtualized device in the physical device.

[0138] Optionally, the configuration storage module includes:

[0139] The configuration storage submodule is used to store the configuration information and device identification number of the virtualized device through the virtualized device state storage module when the virtual machine establishes a connection with the virtualized device in the physical device.

[0140] Optionally, the device further comprises:

[0141] The synchronization module is used to synchronously update the configuration information of the virtualized device through the virtualized device state storage module during the communication between the virtual machine and the virtualized device, and synchronously store the state data of the data queue.

[0142] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0143] The present application also provides an electronic device, including:

[0144] one or more processors; and

[0145] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to execute the method described in the embodiments of the present application.

[0146] The embodiments of the present application also provide one or more machine-readable media on which instructions are stored, which, when executed by one or more processors, enable the processors to execute the methods described in the embodiments of the present application.

[0147] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0148] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0149] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0150] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0152] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0153] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0154] The hot switching method for a virtualized device and a hot switching device for a virtualized device provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A hot switching method for a virtualized device, characterized in that: The method comprises: Remove the virtualized device in the physical device that is currently communicating with the virtual machine; Mount the new virtualized device to the device interface corresponding to the removed virtualized device; Migrating the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device; The new virtualized device is configured to establish a communication connection with the virtual machine.

2. The method according to claim 1, characterized in that The step of removing the virtualized device in the physical device that is in communication connection with the virtual machine includes: Get the device identification number; Based on the device identification number, searching for a virtualized device to be removed that is currently in communication connection with the virtual machine in a physical device; Remove the virtualized device to be removed.

3. The method according to claim 1, characterized in that The method comprises: Based on the device identification number of the removed virtualized device, find the device interface corresponding to the removed virtualized device.

4. The method according to claim 1, characterized in that: The step of migrating the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device includes: Obtain configuration information of the removed virtualized device and status data of the data queue from the virtualized device status storage module; The preset physical function driver is called to migrate the configuration information of the removed virtualized device and the state data of the data queue to the new virtualized device.

5. The method according to claim 1, characterized in that: The method further comprises: When the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored.

6. The method according to claim 5, characterized in that The step of storing the configuration information and the device identification number of the virtualized device when the virtual machine establishes a connection with the virtualized device in the physical device includes: When the virtual machine establishes a connection with the virtualized device in the physical device, the configuration information and the device identification number of the virtualized device are stored through the virtualized device state storage module.

7. The method according to claim 1, characterized in that The method further comprises: During the communication between the virtual machine and the virtualized device, the configuration information of the virtualized device is synchronously updated through the virtualized device state storage module, and the state data of the data queue is synchronously stored.

8. A hot switching device for a virtualized device, characterized in that: include: A removal module, used to remove the virtualized device currently in communication connection with the virtual machine in the physical device; A mounting module, used to mount a new virtualized device to a device interface corresponding to the removed virtualized device; A migration module, used to migrate the configuration information of the removed virtualized device and the status data of the data queue to the new virtualized device; The reconfiguration module is used to configure the new virtualization device to establish a communication connection with the virtual machine.

9. An electronic device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the electronic device to perform the method as claimed in any one of claims 1-7.

10. One or more machine-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Virtual machine migration method and device

    CN109739618A

  • Desktop switching method based on intelligent desktop virtualization IDV architecture

    CN111367609A

  • OVS-based virtual machine thermal migration method and system

    CN112130958A

  • Operating Systems in a Layerd Virtual Workspace

    US20110061045A1

  • Method, Device, and System for Migrating Configuration Information During Live Migration of Virtual Machine

    US20140130044A1