How can I check how much ram available to add to guest OS on libvirt?

6,797

The absolute maximum amount of RAM you can give to a guest is the total amount of RAM available to the host. But of course, if you do that, then you should expect some performance issues, or things will just fail to start or run properly.

That number is displayed both when you create the VM in virt-manager, and by virsh nodememstats.

virt-manager new VM memory

# virsh nodememstats
total  :             32938320 KiB
free   :              1087720 KiB
buffers:              1249844 KiB
cached :              3681120 KiB

This system is using almost all of its memory, so it has little room left for memory for new VMs.

To improve memory usage in KVM, make sure that each Windows guest has the virtio balloon driver installed (Linux already includes this driver), and enable ksm on the host to deduplicate virtual machine memory.

Share:
6,797

Related videos on Youtube

Gani Rakhmatov
Author by

Gani Rakhmatov

Computer geek. Linux system administrator.

Updated on September 18, 2022

Comments

  • Gani Rakhmatov
    Gani Rakhmatov almost 2 years

    I have a server with 32 gb ram and there is libvirt. There are 12 gb of ram is used. When I try to add ram to my guest OS it is not possible to add more than 12gb ram. How can I check how much ram available to add to guest OS on libvirt? I want to give all available memory to it.

  • Gani Rakhmatov
    Gani Rakhmatov over 7 years
    Thank you for your answer ! Could you tell me why I have 17 gb cached memory ? <img src="example.com/sample.png" width="100" height="100">
  • Gani Rakhmatov
    Gani Rakhmatov over 7 years
    Here is the screeenshot: img.uz/s?i5geehe
  • Gani Rakhmatov
    Gani Rakhmatov over 7 years
    When I try to add more memory to guest OS it shows an error that I run out of memory.