Description of problem: When starting a VM with running qemu-guest-agent, the engine does not report/receive FQDN of the VM, only IP, After restarting the qemu-guest-agent service, the FQDN is reported. Version-Release number of selected component (if applicable): ovirt-engine-4.4.4.2-0.1.el8ev.noarch libvirt-6.6.0-7.module+el8.3.0+8424+5ea525c5.x86_64 vdsm-4.40.38-1.el8ev.x86_64 qemu-guest-agent-2.12.0-99.module+el8.2.0+6870+55b789b4.2.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create a VM and start it 2. Watch the VM FQDN/IP on the engine dashboard Actual results: Only IP is reported, no FQDN. Expected results: Both IP and FQDN should be reported to the engine by the qemu-guest-agent. Additional info: See the hostname differences on the qemu-guest-agent log [0] before and after the restart, seems like while qemu-guest-agent started, the VM hostname was `localhost.localdomain` (maybe some systemd services-deps) In addition, see the hostname reported on the host [1] [0] [root@vm-14-99 ~]# systemctl status qemu-guest-agent ● qemu-guest-agent.service - QEMU Guest Agent Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled; vendor preset: enabled) Active: active (running) since Thu 2020-12-03 16:57:51 IST; 12min ago Main PID: 741 (qemu-ga) Tasks: 1 (limit: 4604) Memory: 3.0M CGroup: /system.slice/qemu-guest-agent.service └─741 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-ex> Dec 03 16:57:51 localhost.localdomain systemd[1]: Started QEMU Guest Agent. [root@vm-14-99 ~]# journalctl -u qemu-guest-agent -- Logs begin at Thu 2020-12-03 16:57:46 IST, end at Thu 2020-12-03 17:09:57 IST. -- Dec 03 16:57:51 localhost.localdomain systemd[1]: Started QEMU Guest Agent. [root@vm-14-99 ~]# [root@vm-14-99 ~]# [root@vm-14-99 ~]# [root@vm-14-99 ~]# systemctl restart qemu-guest-agent [root@vm-14-99 ~]# journalctl -u qemu-guest-agent -- Logs begin at Thu 2020-12-03 16:57:46 IST, end at Thu 2020-12-03 17:11:24 IST. -- Dec 03 16:57:51 localhost.localdomain systemd[1]: Started QEMU Guest Agent. Dec 03 17:11:24 vm-14-99.lab.eng.tlv2.redhat.com systemd[1]: Stopping QEMU Guest Agent... Dec 03 17:11:24 vm-14-99.lab.eng.tlv2.redhat.com systemd[1]: Stopped QEMU Guest Agent. Dec 03 17:11:24 vm-14-99.lab.eng.tlv2.redhat.com systemd[1]: Started QEMU Guest Agent. [root@vm-14-99 ~]# [1] # virsh qemu-agent-command bpelled_test_ga82 '{"execute":"guest-info"}' Please enter your authentication name: Please enter your password: {"return":{"version":"2.12.0","supported_commands":[{"enabled":true,"name":"guest-get-osinfo","success-response":true},{"enabled":true,"name":"guest-get-timezone","success-response":true},{"enabled":true,"name":"guest-get-users","success-response":true},{"enabled":true,"name":"guest-get-host-name","success-response":true},{"enabled":false,"name":"guest-exec","success-response":true},{"enabled":false,"name":"guest-exec-status","success-response":true},{"enabled":true,"name":"guest-get-memory-block-info","success-response":true},{"enabled":true,"name":"guest-set-memory-blocks","success-response":true},{"enabled":true,"name":"guest-get-memory-blocks","success-response":true},{"enabled":true,"name":"guest-set-user-password","success-response":true},{"enabled":true,"name":"guest-get-fsinfo","success-response":true},{"enabled":true,"name":"guest-set-vcpus","success-response":true},{"enabled":true,"name":"guest-get-vcpus","success-response":true},{"enabled":true,"name":"guest-network-get-interfaces","success-response":true},{"enabled":true,"name":"guest-suspend-hybrid","success-response":false},{"enabled":true,"name":"guest-suspend-ram","success-response":false},{"enabled":true,"name":"guest-suspend-disk","success-response":false},{"enabled":true,"name":"guest-fstrim","success-response":true},{"enabled":true,"name":"guest-fsfreeze-thaw","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze-list","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true},{"enabled":true,"name":"guest-fsfreeze-status","success-response":true},{"enabled":false,"name":"guest-file-flush","success-response":true},{"enabled":false,"name":"guest-file-seek","success-response":true},{"enabled":false,"name":"guest-file-write","success-response":true},{"enabled":false,"name":"guest-file-read","success-response":true},{"enabled":false,"name":"guest-file-close","success-response":true},{"enabled":false,"name":"guest-file-open","success-response":true},{"enabled":true,"name":"guest-shutdown","success-response":false},{"enabled":true,"name":"guest-info","success-response":true},{"enabled":true,"name":"guest-set-time","success-response":true},{"enabled":true,"name":"guest-get-time","success-response":true},{"enabled":true,"name":"guest-ping","success-response":true},{"enabled":true,"name":"guest-sync","success-response":true},{"enabled":true,"name":"guest-sync-delimited","success-response":true}]}} # virsh qemu-agent-command bpelled_test_ga82 '{"execute":"guest-get-host-name"}' Please enter your authentication name: Please enter your password: {"return":{"host-name":"localhost.localdomain"}}
What/when configures the hostname of the VM? Is /etc/hostname already populated when the VM boots or are you using some other means (cloudinit/ansible/...) to set it?
(In reply to Tomáš Golembiovský from comment #1) > What/when configures the hostname of the VM? Is /etc/hostname already > populated when the VM boots or are you using some other means > (cloudinit/ansible/...) to set it? I don't define the hostname, it defined by the DHCP. [root@vm-14-61 ~]# hostname vm-14-61.lab.eng.tlv2.redhat.com [root@vm-14-61 ~]# cat /etc/hostname localhost.localdomain[root@vm-14-61 ~]#
*** This bug has been marked as a duplicate of bug 1845127 ***