Virtual Machine Load Detection Using Guest Mode Occupation Duration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for detecting the load of a virtual machine with exclusive threads are unable to perform out-of-band detection due to the absence of halt instructions, which are typically used for shared threads.
Innovation Solution
A method that involves acquiring a virtual processor thread corresponding to a target virtual machine with an exclusive thread, measuring the first occupation duration of this thread in guest mode within a detection period, and calculating the running load of the virtual machine based on the proportion of this occupation duration.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If out-of-band detection is performed by detecting halt instructions, then virtual machine load detection is simple and efficient, but it cannot be applied to virtual machines with exclusive threads
Solution Approach 1:
The patent changes the detection parameter from halt instructions to guest mode occupation duration. By measuring how long the virtual processor thread spends in guest mode executing virtual machine tasks, the system achieves load detection that works for both shared and exclusive thread virtual machines, resolving the adaptability issue while maintaining detection effectiveness
Solution Approach 2:
The patent creates a universal detection method that works for both shared thread and exclusive thread virtual machines. The guest mode occupation duration metric serves as a common indicator across different virtual machine configurations, eliminating the need for separate detection mechanisms and enabling broad applicability
2Reliability
If traditional load detection methods are used, then detection can be performed for shared thread virtual machines, but resource overhead of the virtualization layer is introduced
Solution Approach 1:
The patent extracts the detection metric directly from the virtual processor thread's mode occupation data without requiring virtualization layer intervention. By measuring guest mode occupation duration at the hardware level, the method eliminates the need for virtualization layer software agents and reduces resource overhead while maintaining reliable detection
Solution Approach 2:
The virtual processor thread itself provides the detection data through its mode occupation records. The thread's own execution state information is utilized for load detection, eliminating the need for external monitoring resources and achieving self-service detection that reduces overall system overhead
Data Source
AI summary
Embodiments of the disclosure provide a method, an apparatus, an electronic device, and a storage medium for detecting virtual machine load. The method include: acquiring a virtual processor thread corresponding to a target virtual machine, wherein the virtual processor thread is an exclusive thread of the target virtual machine; acquiring a first occupation duration of the virtual processor thread in a guest mode within a first detection period, wherein the virtual processor thread in the guest mode is used for executing a task request of the target virtual machine, and the first occupation duration represents a duration in which the virtual processor thread is in a state of executing the task request of the target virtual machine; and obtaining a running load of the target virtual machine according to a proportion of the first occupation duration in the first detection period.


