I have an XML template for the image I am loading on KVM using ansible. For now, the image loads without IP. I would like to know if there is a way to add static IP on the XML template so that my VM loads with static IP on eth0 interface.
I tried the below in XML but it shows ERR "libvirtError: unsupported configuration: Invalid attempt to set network interface guest-side IP route and/or address info, not supported by QEMU"
<interface type='bridge'>
<source bridge='veth0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
<ip address='172.x.x.x' netmask='255.255.254.0' gateway='172.x.x.1' dns-nameserver='x.x.x.x'>
</ip>
</interface>
Please suggest a way, Thanks