Hi Everyone,
I want to build a qemu guest vm through packer on redhat vm and also able to build the vm as well when using default nat network.
But i want guest vm to connect to host vm so configured bridge network and added “net_bridge”: “br0”, in json file but when ran packer build screen stuck at qemu: Waiting for the guest address to become available in the br0 network bridge… and later once timeout after 20 mins build failed.
[root@SOGO-KVM-HOST networks]# sudo virsh net-list
Name State Autostart Persistent
--------------------------------------------
br0 active yes yes
default active yes yes
[root@SOGO-KVM-HOST networks]# sudo cat /etc/libvirt/qemu/networks/br0.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh net-edit br0
or other application using the libvirt API.
-->
<network>
<name>br0</name>
<uuid>c9bb34ab-9ba7-41c4-ac91-b2e6ffaaed55</uuid>
<forward mode='bridge'/>
<bridge name='br0'/>
</network>
#####packer json file####
"builders": [
{
"type": "qemu",
"qemu_binary": "/usr/libexec/qemu-kvm",
"iso_url": "/var/lib/libvirt/images/test.iso",
"iso_checksum": "md5:030eca87cb007ab3918ad5ae97e73ab2",
"output_directory": "/var/lib/libvirt/images/iso-dir/test",
"disk_size": "350G",
"headless": "true",
"qemuargs": [
[
"-m",
"45000"
],
[
"-cpu",
"host"
],
[
"-smp",
"10"
]
],
"format": "qcow2",
"accelerator": "kvm",
"ssh_username": "root",
"ssh_password": "*********",
"ssh_timeout": "20m",
"vm_name": "test",
"net_device": "virtio-net",
"disk_interface": "virtio",
"net_bridge": "br0",
"http_directory": "/home/sogouser/http",
"boot_wait": "10s",
"boot_command": [
"<tab><bs><bs><bs><bs><bs>text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/anaconda-ks.cfg<enter><wait>"
]
}
]
################
Packer version is 1.9+
Host VM where KVM installed → redhat 8.5
guest vm —> rocky 8.7
Packer Azure