Jan Grashöfer
2015-Dec-06 17:19 UTC
[libvirt-users] Destroy autostarted network on shutdown
Hi all, I just ran into problem properly stopping a network. I have defined a network and network hook script to accomplish some preparations and cleanup. Testing my configuration (virsh net-start and virsh net-destroy) was successfully. Now I wanted to automate the lifecycle. Unfortunately I realized that an autostarted network has to be persistent and thus will not be destroyed (even if the host gets shutdown). As it won't be destroyed, my cleanup doesn't get executed and I run into trouble. What would be the preferred way to implement an autostarting and autostopping network? Thanks, Jan
Laine Stump
2015-Dec-07 17:57 UTC
Re: [libvirt-users] Destroy autostarted network on shutdown
On 12/06/2015 12:19 PM, Jan Grashöfer wrote:> Hi all, > > I just ran into problem properly stopping a network. I have defined a > network and network hook script to accomplish some preparations and > cleanup. Testing my configuration (virsh net-start and virsh > net-destroy) was successfully. > > Now I wanted to automate the lifecycle. Unfortunately I realized that an > autostarted network has to be persistent and thus will not be destroyed > (even if the host gets shutdown). As it won't be destroyed, my cleanup > doesn't get executed and I run into trouble. > > What would be the preferred way to implement an autostarting and > autostopping network?autostarting (and autostopping) based on what event?
Jan Grashöfer
2015-Dec-07 18:20 UTC
Re: [libvirt-users] Destroy autostarted network on shutdown
> autostarting (and autostopping) based on what event?Based on start/shutdown of the host or starting/stopping libvirtd. I just wrote a script to start with systemd but as there is that autostart functionality in libvirtd this might not be the best solution. Regards, Jan