Ashley Mark Brown
Ashley Mark Brown

Reputation: 1

Modifying multiple interfaces model types in virsh using a startup script, reboot restores original types

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.

Upvotes: 0

Views: 121

Answers (0)

Related Questions