0

I am attempting to create a startup script that will modify the model of the following interfaces in virsh:

</interface>
<interface type='bridge'>
<mac address='52:54:00:df:9a:65'/>
  <source bridge='qvs3'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:4d:e2:71'/>
  <source bridge='qvs0'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:99:ce:83'/>
  <source bridge='qvs0'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:44:13:48'/>
  <source bridge='qvs2'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:e5:2b:c9'/>
  <source bridge='qvs2'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:b1:24:98'/>
  <source bridge='qvs1'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
<interface type='bridge'>
  <mac address='52:54:00:e0:51:5f'/>
  <source bridge='qvs1'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</interface>

This is due to my specific model of machine resetting these values upon restart of the system or the reloading of my virtualization manager. I am attempting to change to .

virsh edit uses the vim editor. If I do this using the virsh edit command this works absolutely fine however upon reboot it resets back to virtio. I have already tried the sed and awk parameters and unfortunately, these did not work either.

Tried SED and awk using the EDITOR='sed -i "s/virtio\vmxnet3/g'" virsh net-default in the script, however, this returned a no networks exist error. I looked in the qemu networks folder and there are no networks. This is due to all network interfaces and bridges being specified in the UUID of the virtual machine domain XML.

Sujith Kumar
  • 872
  • 6
  • 19
  • what exactly is your question? – Doktor OSwaldo Mar 13 '23 at 10:34
  • Hi, thank you for replying. I am attempting to modify the to of my network interfaces using a startup script, as my server resets these values back to 'virtio' when I reboot the machine. – Ashley Mark Brown Mar 13 '23 at 11:48
  • sorry but your question is still unclear. Do you want to change anything with vim? you say it does work. So what is your problem? Do you want to change the editor of virsh? – Doktor OSwaldo Mar 16 '23 at 06:29

0 Answers0