Dynamic Virtual Machine Sizing via CPU Ballooning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtual machines (VMs) often face inefficiencies due to over-allocation of virtual CPUs (vCPUs), leading to increased resource usage and performance issues, especially in heavily loaded systems, as configuring vCPU allocations requires taking VMs offline, which is time-consuming and disrupts services.
Innovation Solution
The method involves dynamically managing CPU resources through 'CPU ballooning,' where a balloon driver adjusts the number of active vCPUs based on demand by launching prioritized threads with halt instructions, allowing the hypervisor to deschedule underutilized vCPUs, thereby optimizing resource utilization without interrupting VM operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If virtual machines are allocated more virtual CPUs than the workload requires, then more VMs can be packed onto a single host through CPU over-commitment, but resource usage increases due to overhead and performance is impacted on heavily loaded systems
Solution Approach 1:
The patent implements dynamic vCPU activation where the hypervisor monitors workload demands and activates or deactivates vCPUs in real-time based on actual needs. This allows the system to maintain high VM density while minimizing overhead by only activating vCPUs when workloads require them, resolving the contradiction between packing more VMs and reducing resource overhead.
Solution Approach 2:
The system changes the operational state parameter of vCPUs from static allocation to dynamic activation/deactivation. By monitoring workload metrics and adjusting the number of active vCPUs accordingly, the system optimizes the balance between VM density and resource overhead, allowing aggressive over-commitment when workloads are light while maintaining performance when workloads increase.
2Productivity
If CPU allocations for virtual machines are changed, then resource utilization can be optimized, but the virtual machine must be taken offline which interrupts service access and is time-consuming
Solution Approach 1:
The hypervisor performs preliminary monitoring of workload demands and proactively activates or deactivates vCPUs before performance degradation occurs. This allows optimization of resource utilization without requiring VM shutdowns, as the system anticipates workload changes and adjusts vCPU allocation in advance while the VM remains online and serving requests.
Solution Approach 2:
The system implements self-service CPU allocation where the hypervisor automatically monitors workload metrics and adjusts vCPU activation without administrator intervention. This eliminates the need for time-consuming manual reconfiguration and VM shutdowns, allowing continuous service operation while dynamically optimizing resource utilization based on actual workload conditions.
Data Source
AI summary
A technique is described for managing processor (CPU) resources in a host having virtual machines (VMs) executed thereon. A target size of a VM is determined based on its demand and CPU entitlement. If the VM's current size exceeds the target size, the technique dynamically changes the size of a VM in the host by increasing or decreasing the number of virtual CPUs available to the VM. To “deactivate” virtual CPUs, a high-priority balloon thread is launched and pinned to one of the virtual CPUs targeted for deactivation, and the underlying hypervisor deschedules execution of the virtual CPU accordingly. To “activate” virtual CPUs, the number of virtual CPUs, the launched balloon thread may be killed.


