Score:0

Override virsh network from xml file to apply custom dnsmasq options outside

jp flag

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.

Score:0
dk flag

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.

Score:0
jp flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.