0

I want to automatically add a DNS CNAME entry using the dnsmasq namespace. Since this seems too complex to be handled by virsh net-edit, my idea is to use virsh net-dumpxml, apply the modifications and re-import the network. While the export works, the import throws an error.

$ virsh net-update --xml network.yml
error: command 'net-update' requires <network> option
error: command 'net-update' requires <command> option
error: command 'net-update' requires <section> option

It seems that net-update doesn't work that way, so I tried it with net-create

$ virsh net-create --file network.yml
error: Failed to create network from network.yml
error: Requested operation is not valid: network is already active as 'mynet.internal'

According to the help, there is no switch to override an existing network.

Lion
  • 506
  • 10
  • 21

2 Answers2

0

The problem is, that the network was active - so I disabled it with destroy:

$ virsh net-destroy mynet.internal

After that, it's problemly possible to override the existing network (without any additional switches) using net-define

$ virsh net-define network.yml

Using virsh net-dumpxml mynet I could verify that my changes from the XML file were applied.

Lion
  • 506
  • 10
  • 21
0

Virsh commands handle network characteristics and can be used in conjunction with brctl commands to establish extra virtual bridges in your KVM setup. To reset it or override, shut down a guest, reboot a guest, and force a guest to stop.