Thermal migration method, apparatus, medium, physical machine, and system
By synchronizing device interrupt status information and configuring interrupts before the virtual machine stops running, the problem of excessively long migration time of device interrupt status information during virtual machine hot migration is solved, resulting in shorter vCPU pause time and more efficient virtual machine migration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2026-03-27
AI Technical Summary
During virtual machine hot migration, excessively long migration time of device interrupt status information leads to excessively long vCPU pause time, affecting the service continuity of virtual machines.
Before the virtual machine stops running, the source physical machine continuously synchronizes the device interrupt status information to the destination physical machine and performs interrupt configuration processing at the destination. When the vCPU is paused, the device interrupt status information is compared to determine the interrupt vector whose masking status has changed and the corresponding configuration is performed.
This reduces the migration time of device interruption status information, lowers vCPU pause time, and improves the efficiency and service continuity of the virtual machine hot migration process.
Smart Images

Figure CN113296885B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to a live migration method, device, medium, physical machine and system. BACKGROUND
[0002] In a traditional virtual machine live migration scheme, in a migration stage of state information of a device used by a virtual machine, a virtual processor (vCPU) and the device used by the virtual machine need to be first paused, then the state information of the device is saved on a source physical machine, the state information of the device is sent to a destination physical machine, and after the state information of the device is restored on the destination physical machine, the virtual machine is started to run on the destination physical machine. Therefore, how fast the migration of the state information of the device is determines how long the vCPU needs to be paused, that is, the service interruption time of the live migration.
[0003] The interruption state information is part of the state information of the device, such as a disk, a network card and the like. The main part of the state information of the device in the migration is the migration of the interruption state information. When a virtual machine has many devices, and the interruptions triggered by the many devices are relatively many, after the vCPU on the source end stops running, the interruption state information of all the devices is sent to the destination physical machine, and the destination physical machine needs a long time to complete the loading of the interruption state information and the related interruption configuration, thereby prolonging the time of the pause of the vCPU in the live migration process, which will cause some application programs using the virtual machine to be paused for a long time in the live migration process of the virtual machine, and unable to provide services for users. SUMMARY
[0004] Embodiments of the present application provide a live migration method, device, medium, physical machine and system, to reduce the pause time of a vCPU in a live migration process of a virtual machine.
[0005] In a first aspect, embodiments of the present application provide a live migration method applied to a destination physical machine, and the method comprises the following steps.
[0006] Receiving first device interruption state information sent by a source physical machine during running of a virtual processor, the device interruption state information being interruption state information of a device used by a virtual machine in the source physical machine, and the virtual processor corresponding to the virtual machine;
[0007] Completing interruption configuration processing corresponding to the first device interruption state information;
[0008] Receiving second device interruption state information sent by the source physical machine when the virtual processor stops running;
[0009] comparing the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector whose mask state has changed, the device interrupt state information including a plurality of interrupt vectors generated by the device;
[0010] complete interrupt configuration processing corresponding to the first target interrupt vector. In a second aspect, an embodiment of the present application provides a live migration device located at a destination physical machine, the device comprising:
[0011] a receiving module configured to receive first device interrupt state information sent by a source physical machine during running of a virtual processor, the device interrupt state information being interrupt state information of a device used by a virtual machine in the source physical machine, the virtual processor corresponding to the virtual machine;
[0012] a configuration module configured to complete interrupt configuration processing corresponding to the first device interrupt state information;
[0013] The receiving module is further configured to receive second device interrupt state information sent by the source physical machine when the virtual processor stops running.
[0014] The configuration module is further configured to compare the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector whose mask state has changed, and complete interrupt configuration processing corresponding to the first target interrupt vector, the device interrupt state information including a plurality of interrupt vectors generated by the device.
[0015] In a third aspect, an embodiment of the present application provides a destination physical machine comprising a processor and a memory, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the live migration method in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a non-transitory machine readable storage medium, which stores executable code, and when the executable code is executed, at least the live migration method in the first aspect can be implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a live migration method applied to a source physical machine, the method comprising:
[0018] sending first device interrupt state information collected during running of a virtual processor to a destination physical machine, so that the destination physical machine completes interrupt configuration processing corresponding to the first device interrupt state information, wherein the device interrupt state information is interrupt state information of a device used by a virtual machine in the source physical machine, the virtual processor corresponding to the virtual machine;
[0019] The second device interrupt state information collected when the virtual processor stops running is sent to the destination physical machine, so that the destination physical machine compares the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector of which the masking state has changed, and completes interrupt configuration processing corresponding to the first target interrupt vector.
[0020] In a sixth aspect, an embodiment of the present application provides a live migration device located in a source physical machine, the device comprising:
[0021] The collecting module is configured to collect first device interrupt state information during running of the virtual processor, and collect second device interrupt state information when the virtual processor stops running; wherein the device interrupt state information is interrupt state information of a device used by a virtual machine in the source physical machine, the virtual processor corresponds to the virtual machine, and the device interrupt state information contains a plurality of interrupt vectors generated by the device;
[0022] The sending module is configured to send the first device interrupt state information collected during running of the virtual processor to the destination physical machine, so that the destination physical machine completes interrupt configuration processing corresponding to the first device interrupt state information; and send the second device interrupt state information collected when the virtual processor stops running to the destination physical machine, so that the destination physical machine compares the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector of which the masking state has changed, and completes interrupt configuration processing corresponding to the first target interrupt vector.
[0023] In a seventh aspect, an embodiment of the present application provides a source physical machine, comprising a processor and a memory; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the live migration method in the fifth aspect.
[0024] In an eighth aspect, an embodiment of the present application provides a non-transitory machine readable storage medium, and the non-transitory machine readable storage medium stores executable code, and when the executable code is executed, at least the live migration method in the fifth aspect can be implemented.
[0025] In a ninth aspect, an embodiment of the present application provides a live migration system, comprising a source physical machine and a destination physical machine, the source physical machine runs a virtual machine, and the virtual machine uses a virtual processor and a device;
[0026] The source physical machine is configured to send first device interrupt status information collected during the running of the virtual processor to the destination physical machine, and send second device interrupt status information collected when the virtual processor stops running to the destination physical machine, wherein the device interrupt status information includes a plurality of interrupt vectors generated by the device;
[0027] The destination physical machine is configured to complete interrupt configuration processing corresponding to the first device interrupt status information, and compare the second device interrupt status information with the first device interrupt status information to determine a target interrupt vector whose mask state has changed, and complete interrupt configuration processing corresponding to the target interrupt vector.
[0028] In the embodiment of the present application, when it is necessary to hot migrate a virtual machine from a source physical machine to a destination physical machine, the state information of a device used by the virtual machine (here, the interrupt status information is emphasized) is continuously migrated to the destination physical machine before the virtual machine stops running (i.e., the vCPU of the virtual machine is not paused). The destination physical machine completes interrupt configuration processing corresponding to the received device interrupt status information after receiving the device interrupt status information sent by the source physical machine during the running of the vCPU. Then, when the vCPU is in the pause phase at a certain time, the source physical machine sends device interrupt status information collected when the vCPU stops running to the destination physical machine, the destination physical machine compares the received device interrupt status information at this time with the last received device interrupt status information to determine a target interrupt vector whose mask state has changed (the device interrupt status information includes a plurality of interrupt vectors generated by the device), and completes interrupt configuration processing corresponding to the target interrupt vector.
[0029] Through the scheme provided by the embodiment of the present application, the source physical machine starts to continuously synchronize device interrupt status information to the destination physical machine when the vCPU is not in the pause phase, and the destination physical machine continuously synchronizes the device interrupt status information and completes interrupt configuration. Thus, most of the interrupt vectors in the device interrupt status information have completed corresponding interrupt configuration in the destination physical machine when the device state migration phase is entered, i.e., when the vCPU is in the pause phase, and the destination physical machine only needs to complete interrupt configuration for a small number of interrupt vectors whose mask state has changed at this time, without performing configuration for all interrupt vectors, thereby reducing the migration time length of the device interrupt status information, and reducing the pause time length of the vCPU. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments description. Obviously, the drawings described in the following embodiments are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0031] Figure 1 The flow chart of the hot migration method provided by an embodiment of the present application is shown in the figure;
[0032] Figure 2 The flow chart of the hot migration method provided by another embodiment of the present application is shown in the figure;
[0033] Figure 3 The schematic diagram of the hot migration system provided by an embodiment of the present application is shown in the figure;
[0034] Figure 4 The schematic diagram of the multi-round iteration sending process provided by an embodiment of the present application is shown in the figure;
[0035] Figure 5 The application schematic diagram of the hot migration method provided by an embodiment of the present application is shown in the figure;
[0036] Figure 6 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure;
[0037] Figure 7 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure; Figure 6 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure;
[0038] Figure 8 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure;
[0039] Figure 9 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure; Figure 8 The structural schematic diagram of the hot migration device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0040] In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the following will combine the drawings in the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0041] The hot migration method provided by the embodiment of the present application is applicable to a scenario of hot migration of a virtual machine in a source physical machine to a destination physical machine. In the hot migration process, device state information is involved, and most of the device state information is device interrupt state information. Therefore, in this document, only the hot migration of the device interrupt state information is emphasized, and the hot migration of other device state information is the same. In order to overcome the problem that in the traditional hot migration scheme, the destination physical machine needs to spend a long time to complete the related interrupt configuration processing after the vCPU is suspended, resulting in a long vCPU suspension time, the solution provided in the embodiment of the present application is provided. The specific implementation process of the solution is introduced below.
[0042] Figure 1 The flowchart of the hot migration method provided by the embodiment of the present application is shown in Figure 1 The method can include the following steps:
[0043] 101. The source physical machine collects first device interrupt state information during the running of a virtual processor. The device interrupt state information is the interrupt state information of a device used by a virtual machine in the source physical machine, and the virtual processor corresponds to the virtual machine.
[0044] 102. The source physical machine sends the first device interrupt state information to the destination physical machine.
[0045] 103. The destination physical machine completes the interrupt configuration processing corresponding to the first device interrupt state information.
[0046] 104. The source physical machine collects second device interrupt state information when the virtual processor stops running.
[0047] 105. The source physical machine sends the second device interrupt state information to the destination physical machine.
[0048] 106. The destination physical machine compares the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector with a changed masking state, and completes the interrupt configuration processing corresponding to the first target interrupt vector.
[0049] In actual application, the source physical machine and the destination physical machine can be a server in the cloud or a user terminal. A virtual machine is deployed in the source physical machine, and the processor used by the virtual machine is referred to as a virtual processor (vCPU). Through hot migration, the virtual machine in the source physical machine is migrated to the destination physical machine. Of course, in the hot migration process, various resources and configurations related to the running of the virtual machine also need to be migrated to the destination physical machine, so as to realize the effect that the running environment of the virtual machine in the destination physical machine is consistent with the running environment of the virtual machine in the source physical machine.
[0050] More than one virtual machine can be deployed on the source physical machine and the destination physical machine. The live migration process of each virtual machine is consistent.
[0051] During the running of the virtual machine, various devices are used, such as a network card, a disk, a keyboard, a mouse, a sound card, and the like.
[0052] These devices can be divided into pass-through devices and non-pass-through devices according to types. The pass-through device refers to a device supporting a device pass-through function. The device pass-through function allows a virtual machine (as a guest) to use a device of a source physical machine (as a host) in an exclusive manner, just like physically connecting the device to the virtual machine. The non-pass-through device, as the name implies, is a device other than the pass-through device among the devices used by the virtual machine.
[0053] In the conventional scheme, the live migration of the virtual machine needs to go through the following stages in sequence: migration of configuration information of the source physical machine, migration of memory, and migration of device state information. Since the main part of the device state information is device interrupt state information, the migration of the device state information is described as the migration of the device interrupt state information in this document.
[0054] As described above, in the conventional live migration scheme, when the live migration of the device interrupt state information is needed, the running of the vCPU of the virtual machine needs to be stopped first, so that no new device interrupt state information is generated, and then the interrupt state information of each device used by the virtual machine at the time when the vCPU is stopped is collected, the collected device interrupt state information is sent to the destination physical machine, and the destination physical machine completes the related interrupt configuration processing to realize the synchronization of the device interrupt state information with the source physical machine. Since the destination physical machine needs to process a large amount of device interrupt state information at this time, the time consumption will be very long, that is, a very long time is needed to complete the live migration of the device interrupt state information.
[0055] In this embodiment, the live migration of the device interrupt state information is divided into two stages: the stage before the vCPU is paused and the stage when the vCPU is paused.
[0056] In summary, the core idea of the embodiment of the present application to overcome the problem of too long suspension time of vCPU caused by too long migration time of device interrupt state information is that, when not entering the vCPU suspension stage, the source physical machine starts to continuously synchronize the device interrupt state information to the destination physical machine, and the destination physical machine continuously synchronizes and configures the device interrupt state information, so that, when entering the vCPU suspension stage (i.e. the device interrupt state information migration stage in the conventional scheme), most of the interrupt vectors in the device interrupt state information have completed the corresponding interrupt configuration in the destination physical machine, and the destination physical machine only needs to configure a small amount of interrupt vectors with changed masking state, instead of configuring all the interrupt vectors, thereby reducing the migration time of the device interrupt state information and the suspension time of the vCPU.
[0057] In actual application, a hot migration program, such as a qemu (quick emulator) program, can be started in the source physical machine and the destination physical machine to complete the hot migration of the virtual machine.
[0058] Specifically, when starting the hot migration of the virtual machine, the vCPU has not been suspended, i.e. the vCPU is still in a running state. At this time, the hot migration program in the source physical machine can collect the device interrupt state information generated during the running of the vCPU (for distinction, the device interrupt state information collected during the running of the vCPU is referred to as first device interrupt state information), and send the collected first device interrupt state information to the hot migration program in the destination physical machine. The hot migration program in the destination physical machine further completes the interrupt configuration processing corresponding to the received first device interrupt state information. In summary, the interrupt configuration processing includes: for the interrupt vectors in the masking state, performing interrupt disabling processing; and for the interrupt vectors in the unmasking state, performing interrupt enabling processing.
[0059] When the hot migration program in the source physical machine suspends the vCPU at a certain time, the hot migration program collects the device interrupt state information (referred to as second device interrupt state information) when the vCPU stops running, and sends the second device interrupt state information to the hot migration program in the destination physical machine. At this time, the hot migration program in the destination physical machine compares the second device interrupt state information with the first device interrupt state information, and can obtain the interrupt vectors with changed masking state (referred to as first target interrupt vectors), and only needs to perform corresponding interrupt configuration for the first target interrupt vectors, without the need to perform interrupt configuration processing for all the interrupt vectors in the second device state information, thereby saving time and reducing the time length of the vCPU in the suspended state.
[0060] Wherein, one device corresponding to the device interrupt state information contains a plurality of interrupt vectors, corresponding to the device can trigger a plurality of interrupts, for these interrupts, some devices support the way of sending interrupt MSI-X, such as disk and network card, do not support the device of MSI-X, then continue to send interrupt through IOAPIC, PIC and other devices, such as keyboard, mouse. Interrupt information contained in an interrupt vector may be different at different times. Each interrupt vector contains a variety of specific interrupt information, such as the interrupt vector control, delivery address (addr), containing data (data), etc. Among them, data such as interrupt vector number, priority, etc., vCPU according to the content of data to execute the corresponding interrupt service program. Addr indicates that the interrupt is delivered to those vCPU. Vector control = 0, indicating that the interrupt is in the unmask state, vector control = 1 indicates that the interrupt is in the mask state.
[0061] The following is an example of the first target interrupt vector, the interrupt vector corresponding to the interrupt off and interrupt enable process.
[0062] The first case: assuming that the first target interrupt vector is currently in the unmask state, that is, from the previous mask state to unmask state, at this time, the first target interrupt vector needs to be processed as follows:
[0063] Create interrupt remapping delivery mode and interrupt pass-through delivery mode corresponding to the first target interrupt vector;
[0064] Update the routing information corresponding to the first target interrupt vector in the interrupt routing table.
[0065] Wherein, interrupt remapping delivery mode is a user mode interrupt delivery mode (or interrupt delivery mode), corresponding to the non-pass-through interrupt delivery mode. The creation process is simply: create qemu_eventfd file descriptor, and associate the callback function with the file descriptor, the callback function is used to deliver the interrupt to the corresponding vCPU. Wherein, it is assumed that qemu-kvm (kernel virtual machine) architecture is used to create and manage virtual machines. In actual application, for the first target interrupt vector, the above file descriptor contains the relevant interrupt information contained in the first target interrupt vector, such as interrupt vector number, priority, data, etc.
[0066] The interrupt posting delivery mode is an irq bypass interrupt delivery mode, corresponding to the interrupt delivery mode of interrupt posting. The creation process is briefly described as follows: a file descriptor of the kvm_eventfd is created, and the following interrupt configuration information is written into the file descriptor through the VFIO interface: an IRTE table item of the IOMMU is allocated, the vfmsixtable entry is configured, and the posted interrupt descriptor of the vCPU is updated into the IOMMU IRTE in the kvm.
[0067] Finally, the interrupt routing table in the kvm is updated, that is, the delivery address corresponding to the first target interrupt vector is written into the interrupt routing table.
[0068] Through the above process, the interrupt enable configuration process of the first target interrupt vector is completed. It should be noted that the interrupt enable in this paper refers to the various resources used to prepare the interrupt to take effect, such as the update of the delivery routing table, the creation of the two delivery modes. In this way, after the virtual machine hot migration ends, the virtual machine in the destination physical machine can perform the interrupt enablement processing, and according to the various information configured in the interrupt enablement stage, the execution of the corresponding interrupt service program is triggered.
[0069] The second case: assuming that the first target interrupt vector is currently in a masked state, that is, it is switched from the previous unmasked state to the masked state, at this time, the first target interrupt vector needs to be processed as follows:
[0070] The interrupt posting delivery mode corresponding to the first target interrupt vector is cancelled;
[0071] The callback function of the interrupt remapping mode corresponding to the first target interrupt vector is updated, so that the callback function does not perform interrupt delivery processing on the first interrupt vector.
[0072] In actual application, the interrupt posting delivery mode is used by default in the two interrupt delivery modes corresponding to one interrupt vector. Based on this, when the first target interrupt vector is currently switched to the masking state, the interrupt delivery mode used by the corresponding device can be switched from the interrupt posting delivery mode to the interrupt remapping delivery mode through the VFIO interface, so that the processing of "canceling the interrupt posting delivery mode" can be realized. In addition to this, the interrupt closing processing only completes the switching of the delivery mode, and the callback function corresponding to the interrupt remapping delivery mode also needs to no longer perform the interrupt delivery processing, such as updating the callback function corresponding to the interrupt remapping delivery mode. The updated callback function will not perform the interrupt delivery processing on the first target interrupt vector.
[0073] In actual application, two sub-functions can be written in the callback function corresponding to the interrupt remapping delivery mode, one of which has the function of completing the interrupt delivery, and the other has the function of not performing the interrupt delivery processing, i.e., the "direct return" function. The trigger conditions corresponding to the two sub-functions are respectively that the corresponding interrupt vector is in the unmasking state and that the corresponding interrupt vector is in the masking state.
[0074] Through the above process, the interrupt closing configuration processing of the first target interrupt vector is completed. It should be noted that the interrupt closing corresponding to a certain interrupt vector in this paper means that the device stops sending the interrupt corresponding to the interrupt vector to the vCPU.
[0075] In actual application, in order to further improve the hot migration efficiency of the device interrupt state information and reduce the configuration processing time of the device interrupt state information of the destination physical machine, the source physical machine can iteratively synchronize the device interrupt state information at different times to the destination physical machine in a "multi-round iteration" manner or periodic transmission manner during the running of the vCPU. That is, the source physical machine completes the iterative delivery of the interrupt, and the destination physical machine iteratively completes the update configuration of the interrupt when the vCPU is not stopped.
[0076] In addition, as described above, in the virtual machine hot migration process, in addition to the migration of the device interrupt state information, the migration of the configuration information of the source physical machine and the memory migration are also involved. The process of the virtual machine hot migration will be described below with reference to the embodiment shown in Figure 2
[0077] Figure 2 The flowchart of the hot migration method provided by another embodiment of the present application is shown in Figure 2 As shown, the method can include the following steps:
[0078] 201, the source physical machine sends the configuration information of the source physical machine to the destination physical machine.
[0079] 202, the destination physical machine configures the destination physical machine according to the configuration information, so as to restore the running environment of the virtual machine in the destination physical machine.
[0080] 203, the source physical machine periodically collects memory dirty pages and device interrupt state information.
[0081] 204, the source physical machine sends the periodically collected memory dirty pages and the first device interrupt state information to the destination physical machine in sequence.
[0082] 205, the destination physical machine loads the memory dirty pages received in the current round into the memory, and loads the first device interrupt state information received in the current round into the corresponding device in the destination physical machine.
[0083] 206, the destination physical machine compares the first device interrupt state information received in the current round with the first device interrupt state information received in the previous round, to determine the second target interrupt vector whose shielding state changes, and completes the interrupt configuration processing corresponding to the second target interrupt vector.
[0084] 207, the source physical machine controls the virtual processor to stop running after collecting the first device interrupt information of the target round, and the change degree of the first device interrupt information collected in the target round and the first device interrupt information collected in the previous round meets the set condition.
[0085] 208, the source physical machine collects the second device interrupt state information when the virtual processor stops running.
[0086] 209, the source physical machine sends the second device interrupt state information to the destination physical machine.
[0087] 210, the destination physical machine compares the second device interrupt state information with the first device interrupt state information received in the last round to determine the first target interrupt vector whose shielding state changes, and completes the interrupt configuration processing corresponding to the first target interrupt vector.
[0088] In order to facilitate understanding of the scheme provided by the embodiment, the following Figure 3 , Figure 4 and Figure 5 are used for auxiliary description.
[0089] Figure 3 The schematic diagram of the live migration system provided by the embodiment of the present application is shown in the figure. Figure 3As shown, the system includes: a source physical machine and a destination physical machine. The source physical machine runs a virtual machine, and the virtual machine uses a virtual processor and devices. In the source physical machine and the destination physical machine, a program for performing virtual machine live migration is deployed, such as Figure 3 The source qemu program and the destination qemu program are shown in the figure. Of course, in actual applications, other programs can also be used to complete virtual machine live migration, and are not limited to qemu programs.
[0090] In order to complete the iterative transmission of device interrupt state information, as shown in Figure 3 In the source physical machine and the destination physical machine, a function module of interrupt iterator can also be provided.
[0091] When starting to perform virtual machine live migration, first, the migration of the configuration information of the source physical machine is performed. Specifically, the source qemu program can collect the configuration information of the source physical machine, and start Figure 3 The live migration main thread A shown in the figure, through which the configuration information of the source physical machine is sent to the live migration main thread B of the destination physical machine, and the destination qemu program receives the configuration information of the source physical machine through the live migration main thread B, and configures the destination physical machine according to the configuration information, so as to restore the running environment of the virtual machine in the destination physical machine.
[0092] Among them, the TCP connection can be established between the source physical machine and the destination physical machine in advance, and the interaction between the two can be realized through the TCP connection.
[0093] Among them, the configuration information of the source physical machine can include the configuration information of various hardware resources and software resources of the source physical machine, such as the number of CPUs, the size of memory capacity, the type and capacity of disk, the attribute information of each device simulated in the source physical machine, etc. In short, the configuration information reflects the running environment of the virtual machine, and sending the configuration information to the destination physical machine can restore the running environment of the virtual machine.
[0094] After completing the migration of the configuration information, the phase of iterative migration of memory migration and device interrupt state information is entered.
[0095] In the embodiment of the application, the mode of memory migration is not changed, that is, the memory migration can still use the iterative migration mode in the conventional scheme.
[0096] In brief, the iterative migration process of the memory is that, the dirty memory pages of the source physical machine are collected periodically, and after each round of collection, the dirty memory pages collected in the current round are sent to the target physical machine, and the target physical machine loads the received dirty memory pages into the memory. In actual application, a function module of memory iterator can be arranged in the source physical machine and the target physical machine respectively, and the source qemu program can trigger the memory iterator of the source physical machine to collect the dirty memory pages periodically, and the memory iterator of the target physical machine loads the received dirty memory pages into the memory.
[0097] In the embodiment, the collection of the dirty memory pages and the device interrupt state information is in an iterative manner, i.e. periodic collection. However, the collection periods of the two can be the same or different. Alternatively, the source physical machine can start the periodic collection of the dirty memory pages and the device interrupt state information simultaneously after the target physical machine completes the recovery of the running environment according to the configuration information. After the recovery of the running environment, the target physical machine can feed back confirmation information to the source physical machine to inform the source physical machine, so that the source physical machine can execute the next stage of processing.
[0098] Regardless of whether the collection period of the dirty memory pages is consistent with the collection period of the device interrupt state information, it can be understood that, when the source physical machine completes a round of collection of the dirty memory pages, the source physical machine sends the dirty memory pages collected in the current round to the target physical machine immediately; similarly, when the interrupt iterator in the source physical machine completes a round of collection of the device interrupt state information, the source physical machine sends the device interrupt state information collected in the current round to the target physical machine immediately.
[0099] In order to distinguish from the device interrupt state information collected when the vCPU stops running, the device interrupt state information collected before the vCPU stops running is called first device interrupt state information, and it can be understood that if N rounds of device interrupt state information are collected before the vCPU stops running, N first device interrupt state information will be obtained, and the N first device interrupt state information correspond to the device interrupt state information collected for a certain device at N collection time points respectively, and N is greater than 1.
[0100] Upon receiving the first device interrupt status information in the current round, the interrupt iterator in the destination physical machine first loads this information into the corresponding device. In practice, when the source physical machine sends the first device interrupt status information, it can include this information in a message consisting of a header and a body. The first device interrupt status information is filled in the body, and the header may contain the device identifier and interrupt type identifier corresponding to the first device interrupt status information. Thus, the destination physical machine can parse the header to determine which device the first device interrupt status information corresponds to and load it into that device.
[0101] Subsequently, the destination physical machine completes the interrupt configuration processing corresponding to the first device interrupt status information received in the current round. Specifically, the destination physical machine compares the first device interrupt status information received in the current round with the first device interrupt status information received in the previous round to determine the second target interrupt vector whose shielding state has changed, and completes the interrupt configuration processing corresponding to the second target interrupt vector. Specifically, if the shielding state change of the second target interrupt vector is a switch from an unshielded state to a shielded state, then interrupt disabling processing is required for the second target interrupt vector; conversely, if the shielding state change of the second target interrupt vector is a switch from a shielded state to an unshielded state, then interrupt enabling processing is required for the second target interrupt vector.
[0102] It should be noted that, as Figure 3 As shown, in the destination physical machine, two types of dispatcher modules can be deployed according to the interrupt vector configuration requirements: interrupt enable dispatcher and interrupt disable dispatcher. Since the configuration method for each type of interrupt may differ, corresponding interrupt configuration strategies can be pre-set for different types of interrupts. The function of the two dispatchers mentioned above is to determine the corresponding interrupt configuration strategy based on the interrupt type corresponding to the interrupt vector that needs to be processed, and then use that interrupt configuration strategy to perform the corresponding interrupt configuration.
[0103] For example, for the second target interrupt vector, assuming its corresponding interrupt type is MSI-X, its corresponding interrupt enable strategy is the interrupt enable process described above, and its corresponding interrupt disable strategy is the interrupt disable process described above.
[0104] In addition, it should be noted that in actual applications, for a certain device, it is assumed that the device can generate K kinds of interrupts, and the K interrupt vectors corresponding to the K kinds of interrupts are initialized to a mask state. Based on this, when the first round of collecting the first device interrupt state information of the device is performed, only the interrupt vectors corresponding to the unmasked state included in the first device interrupt state information need to be subjected to interrupt enable processing, and the interrupt vectors corresponding to the masked state included in the first device interrupt state information can be ignored. In other words, only the interrupt vectors whose masked state is changed need to be subjected to corresponding interrupt configuration processing, and the interrupt vectors whose masked state is not changed can be ignored.
[0105] The source physical machine collects the memory dirty pages and the first device interrupt state information round by round, and sends the memory dirty pages and the first device interrupt state information to the destination physical machine. The destination physical machine synchronously completes loading of the memory dirty pages and loading and interrupt configuration of the first device interrupt state information received round by round.
[0106] When a certain time is reached, the source physical machine controls the vCPU to stop running and enter a vCPU suspension stage.
[0107] Optionally, the time can be a time when the last round of memory dirty pages is sent. In a conventional live migration scheme, when the amount of data of the memory dirty pages to be sent in a certain round is less than a set threshold, it can be considered that the last round of memory dirty pages needs to be sent, and the vCPU enters the vCPU suspension stage when the last round of memory dirty pages is sent.
[0108] Alternatively, the time can also be a time when the first device interrupt information of a target round is collected during running of the vCPU. The change degree of the first device interrupt information of the target round and the first device interrupt information collected in the previous round meets a set condition. In simple terms, the first device interrupt state information is periodically collected round by round, and when it is found that the number of interrupt vectors whose masked state has changed is less than a set threshold, it is considered that the vCPU can enter the vCPU suspension stage.
[0109] When the vCPU enters the vCPU suspension stage, the source physical machine collects the interrupt state information of the device again, which is referred to as second device interrupt state information, and sends the second device interrupt state information to the destination physical machine.
[0110] The destination physical machine compares the second device state information with the first device interrupt state information of the same device received last time to determine a first target interrupt vector whose masked state has changed, and completes interrupt configuration processing corresponding to the first target interrupt vector. The interrupt configuration processing process is described in the foregoing embodiments, and will not be described herein.
[0111] In order to more clearly and intuitively understand Figure 3 the working process of the interrupt iterator in the source physical machine shown in the foregoing embodiments, the working process of the interrupt iterator in the source physical machine is described in combination withFigure 4 To illustrate the process of the interrupt iterator performing multiple rounds of iteration on the device interrupt status information.
[0112] As shown in Figure 4 , assuming that the iteration migration phase of the device interrupt status information is entered at time T0, and the collection period is T, then at time T0+T=T1, the device interrupt status information is collected, and the device interrupt status information collected at this time is transmitted to the destination physical device. In Figure 4 , the data at time T1 is the device interrupt status information collected at time T1, and the data at other times is the same.
[0113] Then, at time T1+T=T2, the device interrupt status information is collected, and the device interrupt status information collected at time T2 is transmitted to the destination physical device. At time T2+T=T3, the device interrupt status information is collected, and the device interrupt status information collected at time T3 is transmitted to the destination physical device.
[0114] Then, assuming that at time T3+T=T4, the device interrupt status information is collected, and the device interrupt status information collected at time T4 is compared with the device interrupt status information collected at time T3, it is found that the degree of change of the device interrupt status information collected at time T3 is very small, and it is determined that the vCPU needs to be stopped.
[0115] In Figure 4 , it is assumed that the interrupt type of the device is MSI-X, and the device interrupt status information corresponding to this type can be organized into an msix table, where each row corresponds to an interrupt vector.
[0116] It can be understood that in the case shown in Figure 4 , it is assumed that the device status information collected at time T2 has a large degree of change compared to the device interrupt status information collected at time T1 (for example, the masking state of many interrupt vectors has changed), and it is also assumed that the device status information collected at time T3 has a large degree of change compared to the device interrupt status information collected at time T2. It is also assumed that the number of collection rounds of the device interrupt status information performed by time T4 is greater than or equal to a set threshold.
[0117] In Figure 4 , it is assumed that the vCPU stopping operation is started at time T5, which is a short time after time T4 (because the comparison operation takes a little time), and the vCPU has been stopped at time T6 (because the operation of stopping the vCPU takes a little time). At this time, the device interrupt status information is collected at time T6 and transmitted to the destination physical machine.
[0118] Figure 4The device interrupt state information collected at T1, T2, T3 in the device corresponds to the plurality of first device interrupt state information in the foregoing, and the device interrupt state information collected at T6 corresponds to the second device interrupt state information in the foregoing.
[0119] In order to enable a more intuitive understanding of the hot migration process of the device interrupt state information provided in the embodiment, an exemplary description is made in combination with Figure 5
[0120] In the interrupt iteration process, the change of the mask state of the interrupt vector can be divided into the following three kinds: 1, the interrupt mask state is unchanged; 2, the interrupt mask state changes from a mask state to an unmask state; 3, the interrupt mask state changes from an unmask state to a mask state.
[0121] Case 1 is not described in detail, because the mask state is unchanged, so the interrupt iterator in the destination physical machine does not need to do additional processing, and only synchronizes data, and the following focuses on describing cases 2 and 3.
[0122] In Figure 5 The principle of the msix type of interrupt of a device with 8 interrupt vectors being accelerated by the interrupt iterator is described in the figure. The figure is divided into two parts. The upper half part schematically shows the change of the interrupt state of the device in the source physical machine, and the lower half part is the processing logic of the interrupt iterator in the destination physical machine. In Figure 5 In the figure, it is assumed that the 8 interrupt vectors that can be triggered by the device are organized into a table, denoted as an msix table. The 8 rows in the table are denoted as entry0, 1, 2, 3, 4, 5, 6, 7.
[0123] Firstly, in the first iteration round, i.e., the stage0 stage, the device enables 7 interrupt vectors, which are entry0, 1, 2, 3, 5, 6, 7, i.e., the 7 interrupt vectors are in an unmask state, and entry4 is in a mask state. The interrupt iterator in the source physical machine reads the msix table and other device interrupt state information of the device at the stage0 time, and sends a message containing the table to the destination physical machine. The interrupt iterator in the destination physical machine parses the message header to obtain the corresponding device identifier, loads the msix table and other device interrupt state information into the device, and then parses the msix table to identify the mask state of each interrupt vector. Among them, vector control = 0 indicates that the corresponding interrupt vector is in an unmask state, and vector control = 1 indicates that the corresponding interrupt vector is in a mask state.
[0124] As Figure 5 As shown in the middle and lower part, for the interrupt vectors with vector control = 0 in the msix table (such as the interrupt vectors corresponding to the 7 entries 0, 1, 2, 3, 4, 5, 6, 7 in the msix table), the interrupt emulation path is initialized for these interrupt vectors, and these interrupt vectors are enabled. For the interrupt vectors with vector control = 1, such as the interrupt vector corresponding to the entry 4, stage 0 is directly skipped. Because all the interrupt vectors are initialized to the mask state before stage 0, the mask state of the interrupt vector corresponding to the entry 4 does not change at stage 0, and stage 0 is directly skipped.
[0125] Suppose that in the second iteration, i.e., stage 1, the interrupt vectors corresponding to the entries 2 and 7 in the 8 interrupt vectors of the device change from the unmask state to the mask state, and the interrupt vector corresponding to the entry 4 changes from the mask state to the unmask state. The interrupt iterator in the source physical machine sends the device interrupt state information collected at this moment to the interrupt iterator in the destination physical machine. The interrupt iterator in the destination physical machine compares the device interrupt state information received at stage 1 with the device interrupt state information received at stage 0, and after finding the above difference, as shown in the middle and lower part, the interrupt vector corresponding to the entry 2 and 7 is configured to be disabled, and the interrupt vector corresponding to the entry 4 is configured to be enabled. Figure 5 As shown in the middle and lower part, the interrupt vector corresponding to the entry 2 and 7 is configured to be disabled, and the interrupt vector corresponding to the entry 4 is configured to be enabled.
[0126] In the above iteration migration process, it is assumed that the vCPU stops running at stage 1. If the traditional hot migration scheme is used, the destination physical machine needs to configure the interrupt enable for 6 interrupt vectors (the interrupt vectors corresponding to the 6 entries 0, 1, 3, 4, 5, and 6 in the unmask state). However, if the scheme provided in the embodiment of the present application is used, the destination physical machine only needs to configure the interrupt enable for 1 interrupt vector (the interrupt vector corresponding to the entry 4 which is switched from the mask state to the unmask state) and the interrupt disable for 2 interrupt vectors (the interrupt vectors corresponding to the entries 2 and 7 which are switched from the unmask state to the mask state).
[0127] In actual application, the mask state of the interrupt vector of the device changes rarely during the running of the virtual machine, so most of the interrupt vectors are enabled in the destination physical machine at stage 0, and the destination physical machine basically does not need to configure the interrupt enable for many interrupt vectors in the last migration stage after the vCPU stops running.
[0128] Therefore, the hot migration operation of the device interrupt state information is changed from being performed after the vCPU is suspended to being performed mostly when the vCPU is not suspended, and only a few or even zero operations are needed when the vCPU is suspended, so that the suspension time of the vCPU is greatly reduced.
[0129] In conclusion, the scheme provided by the embodiment of the present application can perform iterative hot migration of the interrupt state information of the device without suspending the vCPU, so that the mode of enabling interrupts for all interrupt vectors on the destination physical machine under the condition that the vCPU is suspended is changed to enabling interrupts for most of the device interrupt state information on the destination physical machine when the vCPU is not suspended, and finally only the interrupt vectors whose last two rounds of mask state change are enabled when the vCPU is suspended, so that the time for performing hot migration of the device interrupt state information when the vCPU is suspended is reduced, and the effect of accelerating migration of the device interrupt state information during virtual machine hot migration is achieved.
[0130] The above embodiments introduce the case that the source physical machine and the destination physical machine are two independent physical machines, and in fact, the source physical machine and the destination physical machine can also be the same physical machine, which is the local hot migration scheme, i.e., the hot upgrade scheme.
[0131] In the hot upgrade scheme, similarly, the function module of the "interrupt iterator" can also be provided in the physical machine, and the migration of the device interrupt state information is completed through the scheme introduced in the above embodiments to improve the migration efficiency of the device interrupt information and reduce the suspension time of the vCPU.
[0132] The hot migration device of one or more embodiments of the present application will be described in detail below. Those skilled in the art can understand that these hot migration devices can be configured by using commercially available hardware components through the steps taught by the present scheme.
[0133] Figure 6 The structure diagram of the hot migration device provided by an embodiment of the present application is shown in FIG. 1. The hot migration device is located in the destination physical machine. As shown in FIG. 1, the hot migration device comprises a receiving module 11 and a configuration module 12. Figure 6
[0134] The receiving module 11 is configured to receive the first device interrupt state information sent by the source physical machine during the running of the virtual processor, the device interrupt state information being the interrupt state information of a device used by a virtual machine in the source physical machine, and the virtual processor corresponding to the virtual machine.
[0135] The configuration module 12 is configured to complete the interrupt configuration processing corresponding to the first device interrupt state information.
[0136] The receiving module 11 is further configured to receive second device interrupt state information sent by the source physical machine when the virtual processor stops running.
[0137] The configuration module 12 is further configured to compare the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector whose masking state has changed, and complete the interrupt configuration processing corresponding to the first target interrupt vector, wherein the device interrupt state information contains a plurality of interrupt vectors generated by the device.
[0138] Optionally, the receiving module 11 is specifically configured to receive a plurality of first device interrupt state information sent by the source physical machine in sequence during the running of the virtual processor, and the source physical machine periodically collects device interrupt state information to obtain the plurality of first device interrupt state information in sequence. The configuration module 12 is specifically configured to compare the first device interrupt state information sent in the current round with the first device interrupt state information sent in the previous round to determine a second target interrupt vector whose masking state has changed, and complete the interrupt configuration processing corresponding to the second target interrupt vector.
[0139] Based on this, the configuration module 12 is specifically configured to compare the second device interrupt state information with the first device interrupt state information sent in the last round during the running of the virtual processor to determine a first target interrupt vector whose masking state has changed.
[0140] Optionally, the time when the virtual processor stops running is determined according to the time when the memory dirty page is sent in the last round, or the time when the first device interrupt information of the target round is collected, wherein the change degree of the first device interrupt information collected in the target round and the first device interrupt information collected in the previous round meets a set condition.
[0141] Optionally, the receiving module 11 is further configured to receive configuration information of the source physical machine. The configuration module 12 can be further configured to configure the destination physical machine according to the configuration information, so as to restore the running environment of the virtual machine in the destination physical machine.
[0142] Optionally, the apparatus further comprises a loading module configured to load the first device interrupt state information and the second device interrupt state information into the device in the destination physical machine in sequence.
[0143] Optionally, the change of the mask state of the first target interrupt vector comprises that the first target interrupt vector is switched from a mask state to an unmask state, and the configuration module 12 is specifically configured to: create an interrupt remapping delivery mode and an interrupt pass-through delivery mode corresponding to the first target interrupt vector; and update the routing information corresponding to the first target interrupt vector in the interrupt routing table.
[0144] Optionally, the change of the mask state of the first target interrupt vector comprises that the first target interrupt vector is switched from an unmask state to a mask state, and the configuration module 12 is specifically configured to: cancel the interrupt pass-through delivery mode corresponding to the first target interrupt vector; and update a callback function of the interrupt remapping mode corresponding to the first target interrupt vector, so that the callback function does not perform interrupt delivery processing on the first interrupt vector.
[0145] Figure 6 The hot migration apparatus can perform the steps performed by the destination physical machine in the foregoing embodiments. For parts not described in detail in the present embodiment, reference can be made to the related descriptions of the foregoing embodiments, which will not be described herein again.
[0146] In one possible design, the above Figure 6 The structure of the hot migration apparatus can be implemented as a physical machine, and specifically corresponds to a destination physical machine in a virtual machine hot migration scenario. As Figure 7 The destination physical machine includes: a memory 21 and a processor 22, wherein the memory 21 stores executable code, and when the executable code is executed by the processor 22, the processor 22 can implement the steps performed by the destination physical machine in the foregoing embodiments.
[0147] In addition, the destination physical machine can further be provided with a communication interface 23 for communicating with a source physical machine.
[0148] In addition, the destination physical machine can further be provided with a virtual machine, a hot migration program, various devices (such as a disk, a network card, a sound card, a mouse, a display card, etc.).
[0149] In addition, the present embodiment provides a non-transitory machine readable storage medium, which stores executable code, and when the executable code is executed, the steps performed by the destination physical machine in the foregoing embodiments can be implemented.
[0150] Figure 8 A structure diagram of a hot migration apparatus provided by an embodiment of the present application is shown, and the hot migration apparatus is located in a source physical machine. As Figure 8 The hot migration apparatus includes: an acquisition module 31 and a sending module 32.
[0151] The collecting module 31 is configured to collect first device interrupt state information during running of the virtual processor and collect second device interrupt state information when the virtual processor stops running, wherein the device interrupt state information is interrupt state information of a device used by a virtual machine in the source physical machine, the virtual processor corresponds to the virtual machine, and the device interrupt state information includes a plurality of interrupt vectors generated by the device.
[0152] The sending module 32 is configured to send the first device interrupt state information collected during running of the virtual processor to the target physical machine, so that the target physical machine completes interrupt configuration processing corresponding to the first device interrupt state information; and send the second device interrupt state information collected when the virtual processor stops running to the target physical machine, so that the target physical machine compares the second device interrupt state information with the first device interrupt state information to determine a first target interrupt vector in which a shielding state changes, and completes interrupt configuration processing corresponding to the first target interrupt vector.
[0153] Optionally, the collecting module 31 is specifically configured to periodically collect a plurality of first device interrupt state information during running of the virtual processor. The sending module 32 is specifically configured to send the plurality of first device interrupt state information periodically collected during running of the virtual processor to the target physical machine respectively, so that the target physical machine compares the first device interrupt state information of a current round of sending with the first device interrupt state information of a previous round of sending to determine a second target interrupt vector in which a shielding state changes, and completes interrupt configuration processing corresponding to the second target interrupt vector.
[0154] Optionally, the first target interrupt vector is an interrupt vector in which a shielding state changes, which is determined by the target physical machine by comparing the second device interrupt state information with the first device interrupt state information of the last round of sending during running of the virtual processor.
[0155] Optionally, the time when the virtual processor stops running is determined according to the following information: a time when a last round of sending memory dirty pages, or a time when first device interrupt information of a target round is collected, wherein a change degree of the first device interrupt information of the target round and first device interrupt information of a previous round meets a set condition.
[0156] Optionally, the sending module 32 is further configured to send configuration information of the source physical machine to the target physical machine, so that the target physical machine configures the target physical machine according to the configuration information, to restore a running environment of the virtual machine in the target physical machine.
[0157] Figure 8The hot migration apparatus shown can perform the steps performed by the source physical machine in the foregoing embodiments. The parts not described in detail in the present embodiment can refer to the relevant descriptions of the foregoing embodiments, which are not described here again.
[0158] In one possible design, the above Figure 8 The structure of the hot migration apparatus shown can be implemented as a physical machine, specifically corresponding to the source physical machine in the virtual machine hot migration scenario. As shown in the figure, Figure 9 The source physical machine includes a memory 41 and a processor 42. The memory 41 stores executable code. When the executable code is executed by the processor 42, the processor 42 can implement the steps performed by the source physical machine in the foregoing embodiments.
[0159] In addition, the source physical machine can be provided with a communication interface 43 for communication with the source physical machine.
[0160] In addition, the source physical machine can be provided with a virtual machine, a hot migration program, various devices (such as a disk, a network card, a sound card, a mouse, a display card, etc.).
[0161] In addition, the present embodiment provides a non-transitory machine-readable storage medium, which stores executable code. When the executable code is executed, the steps performed by the source physical machine in the foregoing embodiments can be implemented.
[0162] The device embodiments described above are only schematic, and each module described as a separate component can or can not be physically separated. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement without creative labor.
[0163] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of a general hardware platform if necessary, and of course can also be implemented by means of a combination of hardware and software. Based on such understanding, the above technical solutions can be embodied in the form of a computer program product, and the present application can be implemented in the form of a computer program product containing computer usable program code in one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.).
[0164] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A thermal migration method, characterized in that, Applied to the target physical machine, the method includes: The system receives multiple first device interrupt status information messages sequentially sent by the source physical machine during the operation of the virtual processor. The source physical machine periodically collects the device interrupt status information according to a set collection period to obtain the multiple first device interrupt status information messages sequentially. The device interrupt status information messages are the interrupt status information messages of the devices used by the virtual machines in the source physical machine. The virtual processor corresponds to the virtual machine. Compare the first device interrupt status information received in the current round with the first device interrupt status information received in the previous round to determine the second target interrupt vector whose shielding status has changed; complete the interrupt configuration processing corresponding to the second target interrupt vector; wherein, in response to the second target interrupt vector whose shielding status has changed being less than a set threshold, determine that the virtual processor has entered the virtual processor stop running phase from the virtual processor running phase; Receive the second device interrupt status information sent by the source physical machine when the virtual processor stops running; Compare the second device interrupt status information with the first device interrupt status information sent in the last round during the operation of the virtual processor to determine the first target interrupt vector whose masking status has changed. The device interrupt status information contains multiple interrupt vectors generated by the device. Complete the interrupt configuration processing corresponding to the first target interrupt vector.
2. The method according to claim 1, characterized in that, The virtual processor's stop time is determined based on the following information: the moment when dirty pages are sent in the last round, or the moment when the first device interrupt information of the target round is collected, wherein the degree of change between the first device interrupt information collected in the target round and the first device interrupt information collected in the previous round meets the set conditions.
3. The method according to claim 1, characterized in that, The method further includes: Receive the configuration information of the source physical machine; Configure the destination physical machine according to the configuration information to restore the virtual machine's operating environment on the destination physical machine.
4. The method according to claim 3, characterized in that, The method further includes: The first device interrupt status information and the second device interrupt status information are sequentially loaded into the device in the destination physical machine.
5. The method according to claim 1, characterized in that, The change in the shielding state of the first target interrupt vector includes: the first target interrupt vector switching from a shielded state to an unshielded state; The interrupt configuration process corresponding to the first target interrupt vector includes: The first target interrupt vector is processed as follows: Create an interrupt remapping delivery mode and an interrupt pass-through delivery mode corresponding to the first target interrupt vector; Update the routing information corresponding to the first target interrupt vector in the interrupt routing table.
6. The method according to claim 1, characterized in that, The change in the shielding state of the first target interrupt vector includes: the first target interrupt vector switching from an unshielded state to a shielded state; The interrupt configuration process corresponding to the first target interrupt vector includes: The first target interrupt vector is subjected to the following interrupt disabling process: Cancel the interrupt pass-through delivery mode corresponding to the first target interrupt vector; Update the callback function of the interrupt remapping mode corresponding to the first target interrupt vector so that the callback function does not perform interrupt delivery processing on the first target interrupt vector.
7. A thermal migration method, characterized in that, Applied to the source physical machine, the method includes: Multiple first device interrupt status information items, collected periodically according to a set collection cycle during the virtual processor's operation, are sent to the destination physical machine. The destination physical machine compares the first device interrupt status information sent in the current round with that sent in the previous round to determine the second target interrupt vector whose masking state has changed, and completes the interrupt configuration processing corresponding to the second target interrupt vector. Here, the device interrupt status information refers to the interrupt status information of the device used by the virtual machine in the source physical machine, and the virtual processor corresponds to the virtual machine. When the second target interrupt vector whose masking state has changed is less than a set threshold, it is determined that the virtual processor has entered a stopped operation phase from the running phase. The second device interrupt status information collected when the virtual processor stops running is sent to the destination physical machine, so that the destination physical machine compares the second device interrupt status information with the first device interrupt status information sent in the last round during the operation of the virtual processor to determine the first target interrupt vector whose masking status has changed, and completes the interrupt configuration processing corresponding to the first target interrupt vector. The device interrupt status information contains multiple interrupt vectors generated by the device.
8. The method according to claim 7, characterized in that, The virtual processor's stop time is determined based on the following information: the moment when dirty pages are sent in the last round, or the moment when the first device interrupt information of the target round is collected, wherein the degree of change between the first device interrupt information collected in the target round and the first device interrupt information collected in the previous round meets the set conditions.
9. The method according to claim 7, characterized in that, The method further includes: The configuration information of the source physical machine is sent to the destination physical machine so that the destination physical machine can configure itself according to the configuration information to restore the virtual machine's operating environment on the destination physical machine.
10. A thermal migration device, characterized in that, Located at the destination physical machine, the device includes: The receiving module is used to receive multiple first device interrupt status information sent sequentially by the source physical machine during the operation of the virtual processor. The source physical machine periodically collects the device interrupt status information according to a set collection period to obtain the multiple first device interrupt status information in sequence. The device interrupt status information is the interrupt status information of the device used by the virtual machine in the source physical machine. The virtual processor corresponds to the virtual machine. The configuration module is used to compare the first device interrupt status information sent in the current round with the first device interrupt status information sent in the previous round to determine the second target interrupt vector whose shielding status has changed, and to complete the interrupt configuration processing corresponding to the second target interrupt vector; wherein, in response to the second target interrupt vector whose shielding status has changed being less than a set threshold, it is determined that the virtual processor will enter the virtual processor stop running phase from the virtual processor running phase; The receiving module is also configured to: receive second device interrupt status information sent by the source physical machine when the virtual processor stops running; The configuration module is further configured to: compare the second device interrupt status information with the first device interrupt status information sent in the last round during the operation of the virtual processor to determine the first target interrupt vector whose masking status has changed, and complete the interrupt configuration processing corresponding to the first target interrupt vector. The device interrupt status information contains multiple interrupt vectors generated by the device.
11. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed, enables the hot migration method as described in any one of claims 1 to 7.
12. A destination physical machine, characterized in that, include: A processor and a memory; wherein the memory stores executable code that, when executed by the processor, causes the processor to perform the hot migration method as described in any one of claims 1 to 6.
13. A heat transfer device, characterized in that, Located at the source end physical machine, the device includes: The acquisition module is used to periodically acquire first device interrupt status information according to a set acquisition cycle during the operation of the virtual processor, and to acquire second device interrupt status information when the virtual processor stops running; wherein, the device interrupt status information is the interrupt status information of the device used by the virtual machine in the source physical machine, the virtual processor corresponds to the virtual machine, and the device interrupt status information contains multiple interrupt vectors generated by the device; The sending module is configured to send multiple first device interrupt status information collected periodically during the operation of the virtual processor to the destination physical machine, so that the destination physical machine compares the first device interrupt status information sent in the current round with the first device interrupt status information sent in the previous round to determine the second target interrupt vector whose shielding state has changed, and completes the interrupt configuration processing corresponding to the second target interrupt vector; wherein, in response to the second target interrupt vector whose shielding state has changed being less than a set threshold, it is determined that the virtual processor will enter the virtual processor stop operation phase from the virtual processor operation phase, and the second device interrupt status information collected during the virtual processor stop operation phase is sent to the destination physical machine, so that the destination physical machine compares the second device interrupt status information with the first device interrupt status information sent in the last round during the operation of the virtual processor to determine the first target interrupt vector whose shielding state has changed, and completes the interrupt configuration processing corresponding to the first target interrupt vector.
14. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed, enables the hot migration method as described in any one of claims 7 to 9.
15. A source-side physical machine, characterized in that, include: A processor and a memory; wherein the memory stores executable code that, when executed by the processor, causes the processor to perform the hot migration method as described in any one of claims 7 to 9.
16. A thermal migration system, characterized in that, It includes a source physical machine and a destination physical machine, wherein a virtual machine runs on the source physical machine, and the virtual processor and devices used by the virtual machine; The source physical machine is used to: periodically collect multiple first device interrupt status information during the operation of the virtual processor according to a set collection cycle and send them to the destination physical machine respectively, wherein, in response to the second target interrupt vector being less than a set threshold due to a change in the shielding state, it is determined that the virtual processor has entered the virtual processor stop operation phase from the virtual processor operation phase, and to send the second device interrupt status information collected during the virtual processor stop operation phase to the destination physical machine, wherein the device interrupt status information contains multiple interrupt vectors generated by the device; The target physical machine is used to: compare the first device interrupt status information sent in the current round with the first device interrupt status information sent in the previous round to determine the second target interrupt vector whose shielding status has changed, and complete the interrupt configuration processing corresponding to the second target interrupt vector; and compare the second device interrupt status information with the first device interrupt status information sent in the last round during the operation of the virtual processor to determine the target interrupt vector whose shielding status has changed, and complete the interrupt configuration processing corresponding to the target interrupt vector.
Citation Information
Patent Citations
Virtual machine total-system online migration method, device and system
CN103631633A