Virtualized computing environments provide tremendous efficiency and flexibility for systems operators by enabling computing resources to be deployed and managed as needed to accommodate specific applications and capacity requirements. As virtualization systems mature and achieve broad market acceptance, demand continues for increased consolidation of virtual machines (VMs) on host server systems to enable on-going efforts to reduce operating costs. Over-commitment of resources, such as memory and processing resources, enables a high degree of consolidation. Process migration from a source host server system to a target host server system is a key feature that enables flexibility in managing rapidly growing numbers of VMs within virtualized computing environments. VMware's vMotion® product enables process migration between host server systems.
A host virtualization system, commonly known as a hypervisor, an example of which is VMware's ESX® Server product, executes on a host server system to manage resident VMs and to provide certain services to the resident VMs, such as managing host server system resources for each VM. For example, a VM that executes as a guest on the hypervisor may be configured to present a guest physical memory space to a guest operating system. To the guest operating system, the guest physical memory space may be indistinguishable from a memory space provided by physical machine memory, such as a physical memory subsystem comprising dynamic random access memory (DRAM). However, each guest physical memory space is actually a distinct virtual memory space that is assigned to a corresponding VM and managed by the host virtualization system. At least a portion of a given guest physical memory space may be mapped to and reside within host physical memory (machine memory). Each guest physical memory space is typically backed to a swap file within a file system provided by the host virtualization system. The file system may reside within a mass storage system coupled to the host server system. Because other processes may allocate space on the mass storage system, each swap file is pre-allocated to avoid swap failure. The swap file is conventionally pre-allocated using thick provisioning to accommodate swapping of all unreserved guest physical memory, where the unreserved guest physical memory represents the physical memory allocated to the VM in excess of the physical memory reserved for that VM.
Each guest physical memory space typically resides within a corresponding swap file, with at least a portion of the guest physical memory space mapped to and residing within machine memory. The host server system implements memory over-commitment when configured to execute a set of VMs having a total guest physical memory space that is larger than available machine memory. To manage guest physical memory usage for a given VM, memory entitlement parameters are typically applied to the VM. Memory entitlement parameters include a memory reservation that reserves a minimum machine memory space for the VM, a memory limit that sets a maximum machine memory usage for the VM, and a memory share for setting priority of machine memory usage between VMs. These entitlement parameters may also be applied to a resource pool (RP), e.g., a pool of hardware resources made available by a cluster of host server systems, to control memory entitlements for the resource pool, sibling VMs within the RP, or sibling RPs. Guest physical memory size is a memory entitlement parameter that indicates an amount of guest physical memory space for a VM. Guest physical memory size conventionally determines the size of a corresponding swap file used to back the guest physical memory.
The hypervisor employs a strict admission control policy to ensure that the total of all memory reservations for all executing VMs does not exceed available physical system memory. To enforce this policy, the hypervisor does not over-commit the memory reservation entitlement parameter. The hypervisor also determines and reserves swap space required to back all unreserved guest physical memory for a given VM. If the VM's guest physical memory size or memory reservation entitlement parameters change, the hypervisor re-computes swap space requirements and may expand a given swap space to ensure that each powered-on VM always has adequate backing store space in either machine memory or an associated swap file. In certain settings, the hypervisor may be configured to store each VM guest physical memory space in a different swap file for greater efficiency during process migration and for data isolation between VMs.
Although a swap file or a collection of swap files may be conventionally configured to pre-allocate adequate backing store capacity for the combined VM's guest physical memory space, such conventional techniques require significant storage capacity, leading to storage and process migration inefficiencies. Therefore, what is needed in the art is a more efficient technique for managing swap space in a virtualized environment.