Bug 1196644
| Summary: | domains have hugepages settings cannot be migrated from RHEL hosts older than 7.1 to 7.1 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.1 | CC: | bmcclain, dgilbert, dyuan, gklein, jdenemar, jkurik, jsuchane, lhuang, michal.skrivanek, mprivozn, mzhan, pm-eus, rbalakri, rgolan, sherold, virt-bugs, zhwang, zpeng |
| Target Milestone: | rc | Keywords: | Upstream |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.17-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1194982 | Environment: | |
| Last Closed: | 2015-11-19 06:18:05 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: | 1191567, 1194982 | ||
| Bug Blocks: | 1035038, 1172230, 1205796, 1250959 | ||
|
Description
Luyao Huang
2015-02-26 12:50:25 UTC
I think is is already fixed by:
commit 732586d979738077af7e8b7dfd11d61fe46533c6
Author: Michal Privoznik <mprivozn>
AuthorDate: Wed Jan 7 15:17:03 2015 +0100
Commit: Michal Privoznik <mprivozn>
CommitDate: Wed Jan 7 18:32:07 2015 +0100
qemu: Fix system pages handling in <memoryBacking/>
In one of my previous commits (311b4a67) I've tried to allow to
pass regular system pages to <hugepages>. However, there was a
little bug that wasn't caught. If domain has guest NUMA topology
defined, qemuBuildNumaArgStr() function takes care of generating
corresponding command line. The hugepages backing for guest NUMA
nodes is handled there too. And here comes the bug: the hugepages
setting from XML is stored in KiB internally, however, the system
pages size was queried and stored in Bytes. So the check whether
these two are equal was failing even if it shouldn't.
Signed-off-by: Michal Privoznik <mprivozn>
v1.2.11-113-g732586d
Test with build: libvirt-1.2.16-1.el7.x86_64
migration always failed
try hugapge testing on rhel7.2
config hugapage on qemu.conf:
hugetlbfs_mount = "/dev/hugepages"
define a guest with xml:
<memoryBacking>
<hugepages/>
</memoryBacking>
....
<type arch='x86_64' machine='rhel6.5.0'>hvm</type>
<boot dev='hd'/>
....
<cpu>
<numa>
<cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
</numa>
</cpu>
...
start guest always get error:
# virsh start rhel6
error: Failed to start domain rhel6
error: internal error: Unable to find any usable hugetlbfs mount for 0 KiB
the hugepage can't worked on rhel7.2 build.
Hi Michal, need some special steps on rhel7.2 ? or it's a hugepage issue?
hugepage on rhel6 host worked well.
(In reply to zhe peng from comment #3) > Test with build: libvirt-1.2.16-1.el7.x86_64 > > Hi Michal, need some special steps on rhel7.2 ? or it's a hugepage issue? > hugepage on rhel6 host worked well. Yes, this is a hugepage issue. Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2015-June/msg01348.html I've just pushed patch upstream:
commit f8e9deb1d4c677eea7f22abef580ceb70765abae
Author: Michal Privoznik <mprivozn>
AuthorDate: Wed Jun 24 18:09:57 2015 +0200
Commit: Michal Privoznik <mprivozn>
CommitDate: Fri Jun 26 09:15:26 2015 +0200
qemuBuildMemoryBackendStr: Fix hugepages lookup process
https://bugzilla.redhat.com/show_bug.cgi?id=1196644
This function constructs the backend (host facing) part of the
memory device. At the beginning, the configured hugepages are
searched to find the best match for given guest NUMA node.
Configured hugepages can have a @nodeset attribute to specify on
which guest NUMA nodes should be the hugepages backing used.
There is, however, one 'corner case'. Users may just tell 'use
hugepages to back all the nodes'. In other words:
<memoryBacking>
<hugepages/>
</memoryBacking>
<cpu>
<numa>
<cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
</numa>
</cpu>
Our code fails in this case. Well, since there's no @nodeset (nor
any <page/> child element to <hugepages/>) we fail to lookup the
default hugepage size to use.
Signed-off-by: Michal Privoznik <mprivozn>
v1.2.16-316-gf8e9deb
verify with build:
libvirt-1.2.17-2.el7.x86_64
step:
1:prepare a guest with hugepage setting on rhel6.6 host
2:#virsh dumpxml rhel6
....
<memoryBacking>
<hugepages/>
</memoryBacking>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='rhel6.5.0'>hvm</type>
<boot dev='hd'/>
</os>
....
3:start guest and do migration to rhel7.2 host
# virsh migrate --live rhel6 qemu+ssh://$target_ip/system --verbose
Migration: [100 %]
4:check on target host
# virsh list --all
Id Name State
----------------------------------------------------
5 rhel6 running
#virsh dumpxml rhel6
....
<memoryBacking>
<hugepages/>
</memoryBacking>
....
<os>
<type arch='x86_64' machine='rhel6.5.0'>hvm</type>
<boot dev='hd'/>
</os>
....
check qemu cmd:
....
qemu 6755 1 2 16:16 ? 00:00:02 /usr/libexec/qemu-kvm -name rhel6 -S -machine rhel6.5.0,accel=kvm,usb=off -m 500 -mem-prealloc -mem-path /dev/hugepages/libvirt/qemu ....
5: migrate guest back to rhel6.6 host
# virsh migrate rhel6 --live qemu+ssh://$source_ip/system --verbose
Migration: [100 %]
move to verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2202.html |