由于内存分配错误,Libvirt / QEmu机器失败并拒绝重新启动

我遇到了libvirt的问题。 在系统重新启动时,所有虚拟机(VM)都可以毫无问题地启动并继续运行。 然后在某个时间点,一组机器根据他们的日志closures。 当我尝试重新启动机器时,出现内存分配失败的错误,尽pipe有足够的内存空闲。

server ~ # free total used free shared buffers cached Mem: 16176648 16025476 151172 0 285432 950300 -/+ buffers/cache: 14789744 1386904 Swap: 0 0 0 server ~ # virsh start zimbra error: Failed to start domain zimbra error: Unable to read from monitor: Connection reset by peer server ~ # tail -n 4 /var/log/libvirt/qemu/zimbra.log LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 3072 -smp 2,sockets=2,cores=1,threads=1 -name zimbra -uuid d05ddb7a-83c4-a77b-d8bc-a322648520cf -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/zimbra.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/var/lib/libvirt/images/zimbra.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=19,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:21:a9:ad,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 192.168.1.2:25 -k de -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char device redirected to /dev/pts/2 Failed to allocate 3221225472 B: Cannot allocate memory 2012-07-06 08:42:56.076+0000: shutting down server ~ # uname -a Linux server 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 

该系统是Ubuntu 12.04服务器。 这个问题似乎是自上次重新启动以来发生的,这是由于一些软件包升级和内核升级造成的。 我试图用以前的内核启动,问题依然存在。 机器一个接一个地失败。 内核使用的缓冲区总是在增加。 我不确定这是造成这次事故的原因,还是对可用空间的反应。

慕尼黑日记忆缪宁记忆

任何关于如何debugging的build议?

附录:

最好的问候,榆树

根据你粘贴的错误信息,你没有足够的可用内存,但是 – 有些东西试图分配3221225472字节(3.2GB左右),而free (1)是说你在常用(如果你使用没有缓冲区或caching)约1.3GB的可用内存。

看起来你正在运行没有交换。 这当然不会帮助你的内存分配问题。 如果你平时运行swap(我认为这是虚拟化服务器上​​的一个非常好的主意),那么有些问题会出错,你就要解决这个问题。

另一种可能是你已经configuration了一些运行在大页面上的东西,现在系统已经运行了一段时间了,你没有足够的内存来分配虚拟机想要的所有页面。