• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Increase KVM Guest Memory Resources

by admin

This post illustrates the steps about how to increase KVM guest memory. If the current KVM guest memory is the same as the memory limit, you can to increase the memory offline following the below steps:

1. Check the current memory status of the KVM guest:

[root@kvm-host]# virsh dumpxml kvm-guest | grep -i memory
<memory unit='KiB'>8392704</memory>                   ### the maximum amount of memory that can be allocated to the VM
<currentMemory unit='KiB'>8392704</currentMemory>     ### current Guest VM memory
[root@kvm-host]# virsh dominfo kvm-guest
Id: 12
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
OS Type: hvm
State: running
CPU(s): 4
CPU time: 429.8s
Max memory: 8392704 KiB
Used memory: 8392704 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c339,c981 (enforcing)
[root@kvm-host]# virsh dominfo kvm-guest
Id: 12
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
OS Type: hvm
State: running
CPU(s): 4
CPU time: 429.8s
Max memory: 8392704 KiB
Used memory: 8392704 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c339,c981 (enforcing)

2. Shutdown the Guest VM:

[root@kvm-host]# virsh list
Id Name State
----------------------------------------------------
12 kvm-guest running
[root@kvm-host]# virsh destroy kvm-guest
Domain kvm-guest destroyed
[root@kvm-host]# virsh list
Id Name State
----------------------------------------------------

3. Update the memory:

# virsh edit guest_vm

For example:

[root@kvm-host]# virsh edit kvm-guest
Domain kvm-guest XML configuration edited.

From:

<memory unit='KiB'>8392704</memory>
<currentMemory unit='KiB'>8392704</currentMemory>

To:

<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>

4. Boot the Guest VM:

[root@kvm-host]# virsh start kvm-guest
Domain kvm-guest started

5. Check if the memory has been increased:

From KVM host:

[root@kvm-host]# virsh dominfo kvm-guest
...
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
Max memory: 16777216 KiB
Used memory: 16777216 KiB
...
[root@kvm-host]# virsh dumpxml kvm-guest |grep -i memo
<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>

From guest:

[root@localhost ~]# free -g
total used free shared buffers cached
Mem: 15 0 15 0 0 0
-/+ buffers/cache: 0 15
Swap: 3 0 3
How to Increase KVM Guest vCPU Resources

Filed Under: CentOS/RHEL, Linux, RHV

Some more articles you might also be interested in …

  1. How to Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8
  2. CentOS / RHEL 7 : Configuring NTP using chrony
  3. How to Disable RSH Server in CentOS/RHEL
  4. How to use “btrfs scrub” command to manage scrubbing on Btrfs file systems
  5. How to add or delete a samba user under Linux
  6. CentOS / RHEL : anacron basics (What is anacron and how to configure it)
  7. How to use ‘yum’ to connect ULN on CentOS/RHEL/OEL 6
  8. How to Mount NFS File Systems Using ‘autofs’ in CentOS/RHEL
  9. How To Calculate The Memory Reserved By HugePages in CentOS/RHEL
  10. How to Compress and Decompress .bz2 files in Linux Using bzip2 Command

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright