Bug 1891923
| Summary: | qga could not get new host name after guest set a new name | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | bfu <bfu> |
| Component: | qemu-kvm | Assignee: | Virtualization Maintenance <virt-maint> |
| qemu-kvm sub component: | Guest Agent | QA Contact: | bfu <bfu> |
| Status: | CLOSED WONTFIX | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | dbarboza, demeng, dgibson, jinzhao, juzhang, lvivier, mdeng, ngu, qzhang, virt-maint, xianwang, xuma, zhenyzha |
| Version: | 8.3 | Keywords: | Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.4 | ||
| Hardware: | ppc64le | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-11-30 04:32:55 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: | 1845127 | ||
| Bug Blocks: | |||
@demeng , hi dehan, does x86 also have this bug? (In reply to bfu from comment #1) > @demeng , hi dehan, does x86 also have this bug? We hit it before as Bug-1845127, but it has been fixed and automated yet. It's a bit hard to see what could be arch-specific about the fix for bug 1845127. Hi david, this bug also occurred with qemu_version:qemu-kvm-4.2.0-34.module+el8.3.0+7976+077be4ec.ppc64le, so this seems not a regression bug The only way I can reproduce this bug is when I don't update the guest QGA to
the 5.1 version. Which makes sense, given that the fix was in QGA code.
bfu, can you please check the qemu-ga version you're using? I was using:
[root@localhost ~]# /usr/bin/qemu-ga --version
QEMU Guest Agent 4.2.0
And I got the exact behavior you described. When I updated the qemu-guest-agent
package - inside the guest - to the RHEL-AV version, the bug didn't occur:
# qemu-ga --version
QEMU Guest Agent 5.1.0
This is a series of commands changing the hostname in the guest:
[root@newhostname ~]# hostnamectl set-hostname newhostname && cat /etc/hostname
newhostname
[root@newhostname ~]# hostnamectl set-hostname newhostname2 && cat /etc/hostname
newhostname2
[root@newhostname ~]# hostnamectl set-hostname newhostname-qga5.1
This is the output from the QGA socket:
[danielhb@ltc-boston115 ~]$ sudo nc -U /tmp/qga.sock
[sudo] password for danielhb:
{"execute":"guest-get-host-name"}
{"return": {"host-name": "newhostname"}}
{"execute":"guest-get-host-name"}
{"return": {"host-name": "newhostname2"}}
{"execute":"guest-get-host-name"}
{"return": {"host-name": "newhostname-qga5.1"}}
(In reply to Daniel Henrique Barboza from comment #5) > The only way I can reproduce this bug is when I don't update the guest QGA to > the 5.1 version. Which makes sense, given that the fix was in QGA code. > > bfu, can you please check the qemu-ga version you're using? I was using: > > [root@localhost ~]# /usr/bin/qemu-ga --version > QEMU Guest Agent 4.2.0 > > > And I got the exact behavior you described. When I updated the > qemu-guest-agent > package - inside the guest - to the RHEL-AV version, the bug didn't occur: > > # qemu-ga --version > QEMU Guest Agent 5.1.0 > > This is a series of commands changing the hostname in the guest: > > [root@newhostname ~]# hostnamectl set-hostname newhostname && cat > /etc/hostname > newhostname > [root@newhostname ~]# hostnamectl set-hostname newhostname2 && cat > /etc/hostname > newhostname2 > [root@newhostname ~]# hostnamectl set-hostname newhostname-qga5.1 > > > This is the output from the QGA socket: > > [danielhb@ltc-boston115 ~]$ sudo nc -U /tmp/qga.sock > [sudo] password for danielhb: > {"execute":"guest-get-host-name"} > {"return": {"host-name": "newhostname"}} > {"execute":"guest-get-host-name"} > {"return": {"host-name": "newhostname2"}} > {"execute":"guest-get-host-name"} > {"return": {"host-name": "newhostname-qga5.1"}} Hi david, I checked with the qemu-ga version and it's QEMU Guest Agent 4.2.0 indeed, by the way how could I upgrade it? (In reply to bfu from comment #6) > (In reply to Daniel Henrique Barboza from comment #5) [...] > > Hi david, > I checked with the qemu-ga version and it's QEMU Guest Agent 4.2.0 > indeed, by the way how could I upgrade it? Inside the guest, I added an ADVANCED-VIRT 8.3 repo in /etc/yum.repos.d, then: $ dnf module disable virt:rhel -y $ dnf module enable virt:8.3 -y $ dnf update qemu-guest-agent This updated qemu-guest-agent to the AV version (5.1). (In reply to Daniel Henrique Barboza from comment #8) > (In reply to bfu from comment #6) > > (In reply to Daniel Henrique Barboza from comment #5) > > [...] > > > > > Hi david, > > I checked with the qemu-ga version and it's QEMU Guest Agent 4.2.0 > > indeed, by the way how could I upgrade it? > > Inside the guest, I added an ADVANCED-VIRT 8.3 repo in /etc/yum.repos.d, > then: > > $ dnf module disable virt:rhel -y > $ dnf module enable virt:8.3 -y > $ dnf update qemu-guest-agent > > > This updated qemu-guest-agent to the AV version (5.1). Hi Daniel, I try to use dnf update and seems it works but qga in guest could not be updated automatically also seems a problem, will you fix this ? (In reply to bfu from comment #9) > (In reply to Daniel Henrique Barboza from comment #8) [...] > Hi Daniel, > I try to use dnf update and seems it works but qga in guest could not be > updated automatically also seems a problem, will you fix this ? We can't do that. There is no guarantee that the user/sysadm wants to automatically update packages on the guest (or the host, for that matter). As state in comment #2, https://bugzilla.redhat.com/show_bug.cgi?id=1845127 fixed this issue for the RHEL-AV 8.3 package. A guest using QGA 4.2.0 will need to update QGA to the AV version 5.1, and we can't automate that. (In reply to Daniel Henrique Barboza from comment #10) > (In reply to bfu from comment #9) > > (In reply to Daniel Henrique Barboza from comment #8) > > [...] > > > Hi Daniel, > > I try to use dnf update and seems it works but qga in guest could not be > > updated automatically also seems a problem, will you fix this ? > > We can't do that. There is no guarantee that the user/sysadm wants to > automatically update packages on the guest (or the host, for that matter). > > As state in comment #2, https://bugzilla.redhat.com/show_bug.cgi?id=1845127 > fixed this issue for the RHEL-AV 8.3 package. A guest using QGA 4.2.0 will > need to update QGA to the AV version 5.1, and we can't automate that. followed with https://bugzilla.redhat.com/show_bug.cgi?id=1845127 in comment8 I could only check with this bug after qemu5.1 released so that I won't need to update qga in guest automatically cause it becomes the default qga version right? Hi Daniel,
I've changed this bug to rhel8 and are you going to fix it within qemu4.2? If not maybe you could close it
@dbarboza (In reply to bfu from comment #12) > Hi Daniel, > I've changed this bug to rhel8 and are you going to fix it within > qemu4.2? If not maybe you could close it In my opinion this doesn't look like the type of bug that warrants a backport. However I'm also aware that the fix is in QEMU 5.1, and the non-AV QEMU packages will stick with QEMU 4.2 for awhile. I'll need some advice on what to do with this one. If the resolution "just tell users to use QGA from RHEL-AV" is acceptable, then we can close it. "just tell users to use QGA from RHEL-AV" doesn't quite work, because presumably people are using the non-AV versions because they don't have an AV entitlement. That said, this is a fairly cosmetic problem, particularly with non-AV (no layered product) where we're probably dealing with a fairly basic management layer, and managing the hostname from within the guest is more likely. Given that, I'm closing as WONTFIX. We'll revisit this if a customer encounters the problem in the wild. |
Description of problem: after set a new hostname through guest with cmd:"hostnamectl set-hostname newhostname", could only show old name through qemu_guest_agent socket /home/bfu/Documents/test_data/testresults/autobugs/guest_agent/39-Host_RHEL.m8.u3.product_rhel.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.3.0.ppc64le.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.check_os_basic_info/debug.log Version-Release number of selected component (if applicable): host kernel version:4.18.0-240.el8.ppc64le guest kernel version:4.18.0-240.el8.ppc64le qemu version:qemu-img-5.1.0-14.module+el8.3.0+8438+644aff69.ppc64le How reproducible: 100% Steps to Reproduce: 1.boot up guest with: /usr/libexec/qemu-kvm \ -name 'vm1' \ -sandbox on \ -machine pseries,cap-ccf-assist=off \ -nodefaults \ -device VGA,bus=pci.0,addr=0x2 \ -m 4G,slots=4,maxmem=8G \ -smp 8,maxcpus=8,cores=4,threads=1,sockets=2 \ -cpu 'host' \ -chardev socket,id=chardev_serial0,server,path=/tmp/bfu,nowait \ -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7,iommu_platform=on,disable-legacy=on,disable-modern=off \ -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 \ -device virtserialport,bus=virtio-serial0.0,chardev=qga0,name=org.qemu.guest_agent.0 \ -device spapr-vty,id=serial0,reg=0x30000000,chardev=chardev_serial0 \ -device qemu-xhci,id=usb1,bus=pci.0,addr=0x6 \ -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x9 \ -blockdev node-name=file_image1,driver=file,aio=threads,filename=rhel8301009.qcow2,cache.direct=off,cache.no-flush=on \ -blockdev node-name=drive_image1,driver=qcow2,cache.direct=off,cache.no-flush=on,file=file_image1 \ -device scsi-hd,id=image1,drive=drive_image1,write-cache=on \ -device virtio-net-pci,mac=9a:f3:34:18:4d:a4,id=idxUm7Mp,netdev=idgKDzyu,bus=pci.0,addr=0x8 \ -netdev tap,id=idgKDzyu,vhost=on \ -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \ -device usb-kbd,id=usb-kbdppc1,bus=usb1.0,port=2 \ -vnc :32 \ -qmp tcp:0:4444,server,nowait \ -rtc base=utc,clock=host \ -boot menu=off,order=cdn,once=c,strict=off \ -enable-kvm \ -monitor stdio \ 2.set host name and check if it works through guest with: hostnamectl set-hostname newhostname && cat /etc/hostname 3.check host name through qga socket with: {"execute":"guest-get-host-name"} Actual results: from qga: dhcp16-215-195.ibm2.lab.eng.bos.redhat.com Expected results: from qga:newhostname Additional info: