Skip to content

Commit 0919754

Browse files
authored
hosts: make it clear what to expect and how to configure balloon feature on KVM (#337)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 55e9f0a commit 0919754

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

source/adminguide/hosts.rst

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,11 @@ VMware tools installed.
377377
KVM
378378
'''
379379

380-
All VMs are required to support the virtio drivers. These drivers are
380+
All KVM VMs are required to support the virtio drivers. These drivers are
381381
installed in all Linux kernel versions 2.6.25 and greater. The
382382
administrator must set CONFIG\_VIRTIO\_BALLOON=y in the virtio
383-
configuration.
383+
configuration. Drivers for Windows can be downloaded from
384+
https://github.com/virtio-win/virtio-win-pkg-scripts
384385

385386

386387
Hypervisor capability
@@ -396,12 +397,45 @@ The DMC (Dynamic Memory Control) capability of the hypervisor should be
396397
enabled. Only XenServer Advanced and above versions have this feature.
397398

398399

399-
VMware, KVM
400-
'''''''''''
400+
VMware
401+
''''''
401402

402403
Memory ballooning is supported by default.
403404

404405

406+
KVM
407+
'''
408+
409+
Memory ballooning is supported and enabled by default. This can be configured on
410+
per KVM host basis via the `vm.memballoon.disable=false` property and the
411+
`vm.memballoon.stats.period` property in the `agent.properties` of the KVM host.
412+
413+
The memory ballooning feature on KVM allows the host to reclaim memory from
414+
guest VMs which is enabled by a virtio balloon device on the guest VM and the
415+
related virtio drivers inside the guest VMs. This feature is mainly intended to
416+
support over-committing memory on KVM hosts.
417+
418+
A related feature, KSM (Kernel Same-page Merging), can also be enabled to assist
419+
with over-committing memory. On some distributions such as Ubuntu, this is
420+
enabled by default, and can be checked otherwise by checking/setting
421+
`/sys/kernel/mm/ksm/run` to 1 and for libvirt set the `KSM_ENABLED=AUTO` in
422+
`/etc/defaults/qemu-kvm`.
423+
424+
Note: the memory ballooning feature isn't automatic on KVM and shouldn't be
425+
confused with the dynamic scaling feature that allows manual scaling of running
426+
VMs by changing the service offering (feature can be enabled via the setting
427+
enable.dynamic.scale.vm) of VMs that aren't using a fixed compute offering.
428+
429+
By default, when memory is over provisioned (setting mem.overprovisioning.factor
430+
is greater than 1.0 at global or cluster level) the actual memory for the VM is
431+
the memory per the service offering divided by the global or cluster-specific
432+
memory overprovisioning factor. This means guests start with a lower memory than
433+
their service offering intended memory, which will not be changed or scaled
434+
automatically. When overcommitting memory, this behaviour can be disabled by
435+
turning off (set the value false) the setting
436+
`vm.min.memory.equals.memory.divided.by.mem.overprovisioning.factor`.
437+
438+
405439
Setting Over-Provisioning Factors
406440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
407441

0 commit comments

Comments
 (0)