Bug 680198

Summary: the guest kernel will panic when ballooning memory
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CANTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: berrange, dyuan, eblake, jdenemar, jyang, llim, xen-maint, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-28 09:38:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 693510    
Attachments:
Description Flags
virtio_balloon driver
none
guest screen none

Description Alex Jia 2011-02-24 16:18:15 UTC
Description of problem:
The guest kernel will panic when set memory on the active guest.

Version-Release number of selected component (if applicable):
# rpm -q libvirt 
libvirt-0.8.7-7.el6.x86_64

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.145.el6.x86_64

# uname -r
2.6.32-113.el6.x86_6

How reproducible:
always

Steps to Reproduce:
1. virsh start domainname
2. virsh setmem domainname --kilobytes 131072
3. virt-viewer domainname
  
Actual results:
kernel panic

Expected results:
fix it

Additional info:
# virsh dominfo vr-rhel6u1-x86_64-kvm
Id:             25
Name:           vr-rhel6u1-x86_64-kvm
UUID:           a03093a1-5da6-a2a2-3baf-a845db2f10b9
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       1193.6s
Max memory:     2097152 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      disable
Security model: selinux
Security DOI:   0
Security label: system_u:system_r:svirt_t:s0:c104,c286 (permissive)

# virsh memtune vr-rhel6u1-x86_64-kvm
hard_limit     : unlimited
soft_limit     : unlimited
swap_hard_limit: unlimited

# virsh setmem vr-rhel6u1-x86_64-kvm --kilobytes 131072

# virsh dominfo vr-rhel6u1-x86_64-kvm
Id:             25
Name:           vr-rhel6u1-x86_64-kvm
UUID:           a03093a1-5da6-a2a2-3baf-a845db2f10b9
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       1225.2s
Max memory:     2097152 kB
Used memory:    194492 kB
Persistent:     yes
Autostart:      disable
Security model: selinux
Security DOI:   0
Security label: system_u:system_r:svirt_t:s0:c104,c286 (permissive)

# virt-viewer vr-rhel6u1-x86_64-kvm

Note: current used memory does change, but use virt-viewer to check guest screen, which display Out of memory and kernel panic...

Comment 1 Alex Jia 2011-02-24 16:21:28 UTC
Created attachment 480795 [details]
virtio_balloon driver

Comment 2 Alex Jia 2011-02-24 16:22:29 UTC
Created attachment 480796 [details]
guest screen

Comment 4 Jiri Denemark 2011-02-25 15:33:47 UTC
That's the dark side of memory ballooning. If you want to shrink too much your guest may get into an OOM condition and start killing processes like crazy. Frankly, decreasing memory from 2GB to 128MB really sounds like too much to me. It's hard to find a general rule what amount of memory is still ok and what is already not enough for a guest so I don't think we can really do anything useful with this in libvirt. The user (of libvirt API, so it can even be an application higher in the stack) should know what the guest OS is, what processes need to run in it and what the memory consumption should look like.

I'm inclined to close this as CANTFIX although I'll wait a bit in case someone else has a better suggestion.

Comment 5 Daniel Berrangé 2011-02-25 15:37:47 UTC
Agreed, we have tried to set a minimum limit in the past, but had to remove it precisely because it will always be wrong for at least one person's valid use case.