Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

Virt-Manager GUI在给虚拟机分配32GB以上的内存时显示失败。

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6 + earlier virt-manager-0.8.6-4.el6
  • Virt-Manager
  • KVM and XEN

Issue

1.Virt-Manager GUI在给基于kvm的虚拟机分配32GB以上的内存时显示失败。

2.通过virt-manager可以分配多少内存给KVM的虚拟机?

3.Virtualization limits page上写到KVM虚拟机可以支持到512GM的内存,但是virt-manager
却在给KVM的完全虚拟化虚拟机分配32GB以上的内存时,显示失败。

Resolution

KVM环境中

通过手动编辑虚拟机的XML配置文件来增大虚拟机的内存


停止一个虚拟机运行。

执行下面的命令来编辑虚拟机的XML配置文件。

  # virsh edit <VM Name>

举个例子(这里的<memory>是"setmaxmem"的值,<currentMemory>是"setmem" 的值)

virsh # edit <domain-name>

    <domain type='kvm'>
      ...
    <memory>514144</memory>
    <currentMemory>262144</currentMemory>
    ...
    </domain>

根据不同的需要改变内存的大小,并且保存设置。

Restart the libvirtd service

XEN环境中

编辑/etc/xen/中的虚拟机XML文件

举个例子

maxmem = 512   <-- These are the parameters which need to be        modified. It is mentioned in MB
memory = 512    <-- So for 32 GB mention 32000

重新启动libvirtd服务

在RHEL6的virt-manager-0.8.6-4.el6 中这个问题已经被修复( Bugzilla640781 )。

Root Cause

在GUI界面中,Virt-manager对于最大内存设置会有一些限制。
RHEL5的环境中不可以通过virt-manager来给虚拟机分配超过32GB的内存。

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments