Bug 1416627
| Summary: | [Xen][libvirt] Can't allocate low memory for guest when creating xen vm with virsh command. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Lin Liu <linl> | ||||
| Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 26 | CC: | agedosier, berrange, clalancette, itamar, laine, libvirt-maint, veillard, virt-maint, xiliang | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2017-04-07 08:38:35 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle. Changing version to '26'. On Fedora-26-20170320.n.0 build, this bug is not reproducible. I can create guest domain with different memory setting, eg 524288,1048576,8388608. So close it.
[root@dhcp-3-6 media]# virsh dominfo test_hvm4
Id: 23
Name: test_hvm4
UUID: dabcd635-edc0-4f85-abaa-68602104a3d2
OS Type: hvm
State: running
CPU(s): 32
CPU time: 231.6s
Max memory: 8388608 KiB
Used memory: 8376332 KiB
Persistent: no
Autostart: disable
Managed save: no
[root@dhcp-2-248 ~]# free -m
total used free shared buffers cached
Mem: 7979 672 7307 2 62 212
-/+ buffers/cache: 397 7582
Swap: 1199 0 1199
[root@dhcp-3-6 media]# cat test_hvm4.cfg
<domain type='xen' id='1'>
<name>test_hvm4</name>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>32</vcpu>
<os>
<type arch='x86_64' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
<boot dev='network'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>preserve</on_crash>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<source file='/media/guest_hvm4.img'/>
<target dev='xvda' bus='xen'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='/media/test.img'/>
<target dev='xvdb' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3b:f1:1c:59'/>
<source bridge='xenbr0'/>
<model type='e1000'/>
</interface>
<controller type='ide' index='0'/>
<serial type='pty'>
<source path='/dev/pts/3'/>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' listen='10.66.3.6' port='5900' autoport='yes' keymap='en-us'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
</devices>
</domain>
Packages information:
kernel-4.11.0-0.rc1.git0.1.fc26.x86_64
libvirt-3.1.0-1.fc26.x86_64
xen-4.8.0-8.fc26.x86_64
|
Created attachment 1244596 [details] guest_create_failed.log Description of problem: Using virsh command to create xen guest, only guest with 1G(1048576Mb) memory can be created, guests with other size memory cannot be created with error message: "xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory". Using xl to create the same configuration guest is OK. Version-Release number of selected component (if applicable): kernel-4.9.0-0.rc6.git2.1.fc26.x86_64 libvirt-3.0.0-1.fc26.x86_64 xen-4.8.0-2.fc26.x86_64 How reproducible: Always Steps to Reproduce: 1. Boot Fedora Rawhide system xen hypervisor with "dom0_mem=1024M,max:1024M" in kernel command: [root@dhcp-10-249 ~]# cat /etc/grub2.cfg | grep 1024 multiboot /xen-4.8.0.gz dom0_mem=1024M,max:1024M placeholder ${xen_rm_opts} The total memory is enough to balloon to guests: [root@dhcp-10-249 ~]# cat /proc/meminfo MemTotal: 911280 kB MemFree: 11708 kB MemAvailable: 705572 kB 2. Create a guest with command "virsh create xen-hvm-guest.xml" with below configure file: [root@dhcp-10-249 ~]# cat xen-hvm-guest.xml <domain type='xen'> <name>rhel-hvm</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine='xenfv'>hvm</type> <loader>/usr/lib/xen/boot/hvmloader</loader> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/lib64/xen/bin/qemu-dm</emulator> <disk type='file' device='disk'> <source file='/home/RHEL-Server-6.9-64-hvm.raw'/> <target dev='xvda' bus='xen'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='ide' index='0'/> <interface type='bridge'> <mac address='00:16:3e:83f:81'/> <source bridge='xenbr0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/> <video> <model type='cirrus' vram='4096' heads='1'/> </video> </devices> </domain> 3. Guest is created successfully and then destroy it. 4. Change the memory to other size for example 1048575 as below: [root@dhcp-10-249 ~]# cat xen-hvm-guest.xml | grep -i memory <memory unit='KiB'>1048575</memory> <currentMemory unit='KiB'>1048575</currentMemory> 5. Create the guest again. Actual results: Cannot create guest with error message: [root@dhcp-10-249 ~]# virsh create xen-hvm-guest.xml error: Failed to create domain from xen-hvm-guest.xml error: internal error: libxenlight failed to create new domain 'rhel-hvm' Expected results: The guest should be created successfully since there is enough memory and the same configuration guest can be created by xl command. Additional information: In the log file /var/log/libvirt/libxl/libxl-driver.log it reports that: xc: panic: xc_dom_boot.c:141: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory Attach the full log file as guest_create_failed.log, also attach the log file when creating 1G(1048576Mb) memory guest successfully as virsh_guest.log.