QEMU Hot Upgrade via DPU Thread State Synchronization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing virtual machine hot upgrade methods result in significant downtime, affecting the performance of running virtual machines.
Innovation Solution
A method and device for hot upgrading virtual machines by creating a QEMU component with sub-threads corresponding to VCPU threads on a DPU, pausing and synchronizing state information to a new QEMU component without pausing VCPU threads, and processing IO requests through the new component.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the target QEMU component is paused to save and synchronize state information during hot upgrade, then the upgrade can be completed with state consistency, but the virtual machine experiences downtime
Solution Approach 1:
The patent segments the QEMU component into multiple independent sub-threads, each handling specific VCPU threads. This segmentation allows selective pausing of only the sub-threads involved in state synchronization while keeping other sub-threads active, thereby reducing overall downtime while maintaining state consistency for the upgraded components.
Solution Approach 2:
The patent performs preliminary actions by creating a new QEMU component before pausing the target component. The new component is pre-configured with the updated version, and state information is synchronized in advance. This preliminary preparation enables faster transition with minimal downtime when the switch occurs.
2Reliability
If all sub-threads in the target QEMU component are paused for state synchronization, then complete state consistency is achieved, but the upgrade duration increases
Solution Approach 1:
The patent divides the QEMU component into multiple sub-threads that can be managed independently. During hot upgrade, only the necessary sub-threads are paused for state synchronization, while other sub-threads continue to process IO requests. This selective approach achieves required state consistency without requiring complete pausing of all sub-threads, thereby reducing upgrade duration.
Solution Approach 2:
The patent applies partial action by synchronizing state information only for the specific sub-threads that need upgrading, rather than pausing and synchronizing all sub-threads. This partial synchronization approach achieves sufficient state consistency for the upgrade while minimizing the duration of the upgrade process.
3Ease of manufacture
If the QEMU component is stopped completely for version upgrade, then the upgrade process is simple, but the virtual machine cannot run during the upgrade
Solution Approach 1:
The patent performs preliminary action by creating and configuring the new QEMU component with the updated version before the hot upgrade begins. The new component is pre-prepared with all necessary configurations and dependencies, which simplifies the actual upgrade process to mainly involve state synchronization and switching, while maintaining virtual machine availability throughout.
Solution Approach 2:
The patent introduces a new QEMU component as an intermediary during the upgrade process. This intermediary component acts as a bridge, allowing the virtual machine to continue running on the new component while the old component is gradually phased out. This approach maintains simplicity by avoiding complex in-place modifications while ensuring continuous availability.
Data Source
AI summary
Embodiments of the present disclosure provide a method and device for hot upgrading a virtual machine, including: creating a QEMU component corresponding to an individual virtual machine on a DPU, where sub-threads in the QEMU component are in a one-to-one correspondence with VCPU threads on a physical machine, and are configured to receive and process an IO request sent by the VCPU thread; creating a new QEMU component corresponding to a target virtual machine on the DPU in response to a hot upgrade instruction for a target QEMU component corresponding to the target virtual machine; pausing the target QEMU component on the DPU, saving state information of each sub-thread in the target QEMU component, and synchronizing state information of each sub-thread to the new QEMU component; and receiving and processing, through the new QEMU component, the IO request sent by the VCPU thread.


