2

Hi I just started using kvm on rhel6 and after creating a vm I tried to increase the memory but the changes I amde in the xml file do not propogate to vm, even after bouncing vm and restarting libvert?

[root@kvm01 qemu]# virsh dominfo dev-kvm01
Id: 2
Name: dev-kvm01
UUID: 9b2bf581-2807-3116-b176-60e9c0559943
OS Type: hvm
State: running
CPU(s): 2
CPU time: 1975.3s
Max memory: 7864320 kB
Used memory: 7864320 kB
Persistent: yes
Autostart: disable
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c47,c760 (enforcing)
[iknowmed@dev-kvm01 ~]$ free
           total       used       free     shared    buffers     cached
Mem:     3632284    3614508      17776          0       3980    3491676
-/+ buffers/cache:   118852    3513432
Swap:    5668856          0    5668856
womble
  • 96,255
  • 29
  • 175
  • 230
kevintmckay
  • 21
  • 1
  • 2

2 Answers2

3

I believe that in your guest you might have a x86 (32 bit) kernel without PAE (Physical Address Extension) support. Those kernels are only able to support less than 4 GB of memory.

The easy solution is to switch to PAE enabled kernel (hopefully) provided by your Linux distribution.

The more difficult solution is to switch to x86_64/amd64 (64 bit) architecture but then you need to re-install the guest.

Edited to add:

Alternatively you might not have PAE enabled in your libvirt configuration.

If you do virsh edit dev-kvm01 you should see a features section such as follows:

<features>
    <pae/>
    <acpi/>
    <apic/>
</features>

If the <pae/> entry is not there, put it there and restart the guest.

snap
  • 1,251
  • 10
  • 18
0

You can follow the following steps to increase memory size of your KVM virtual machine.

  1. First shutdown vm virsh shutdown dev-kvm01

  2. After completion, verify memory settings in vm xml file and then run virsh undefine dev-kvm01 virsh define dev-kvm01

  3. Now start vm virsh start dev-kvm01

  4. Verify memory changes in the vm, I recommend not to use linux free program to check memory usage rather you can install a nice tool htop

yum install htop # For Red Hat/ CentOS / Fedora
apt-get install htop # For Debian / Ubuntu / Linux Mint

  1. Run htop

I hope this will solve your problem.

dyasny
  • 18,802
  • 6
  • 49
  • 64