#657120 libvirt-bin: Should bring down virtual networks upon stop when no VM still there

Package:
libvirt-bin
Source:
libvirt
Submitter:
Olivier Berger
Date:
2023-04-17 15:57:42 UTC
Severity:
wishlist
Tags:
#657120#5
Date:
2012-01-24 09:30:49 UTC
From:
To:
Hi.

When one issues /etc/init.d/libvirt-bin stop, and no VMs are still running, it should bring down the virtual networks.

AFAICT, virbr0 is still there, though.

See https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/345485 for some details on this issue on Ubuntu side.

AFAIU, the conclusion in that LP bug was that nothing should be down WRT networks when VMs are running.

But I think that one could expect that libvirt actually *knows* if VMs are still running, and may then be able to do things if no VM it started are still running.

Is there something that can be done to have libvirt not mess too much with the host when it is no longer needed ?

Thanks in advance.

Best regards,

#657120#10
Date:
2012-01-24 09:59:33 UTC
From:
To:
tags 657120 +wontfix
thanks
Libvirt doesn't bring down vms when it stops nor storage pools nor
networks. Why should it? It should infact preserve it's state across
restarts.
Cheers,
 -- Guido

#657120#17
Date:
2012-01-24 10:26:12 UTC
From:
To:
Because it started a network even though no VM was ever started, AFAICT.

I have a virbr0 bridge started automatically even if I haven't used a VM
since my machine's boot... and if I stop libvirt-bin, it stays there.

Shouldn't it do things in a symetric way as for the start operations ?

Hope this is a sound rationale.

Best regards,

#657120#22
Date:
2012-01-24 11:12:53 UTC
From:
To:
Are you sure you tested the Debian (in contrast to the Ubuntu) package?
We don't start any networks automatically. So there's no virbr0 by
default. It only does so if you set the network to _autostart_.
Cheers,
 -- Guido

#657120#27
Date:
2012-01-24 11:23:03 UTC
From:
To:
Yes sir.
the network with autostart, then it should have a symetrical autostop
feature, for when no VM is left.

How does it sound ?

Best regards,

#657120#32
Date:
2012-01-24 13:09:57 UTC
From:
To:
severity 657120 wishlist
thanks

The network is autostarted _unconditionally_. It doesn't matter if there
are VMs or not. Libvirt does more than starting and stopping of
machines.  It manages network interfaces, storage, etc. So the feature
you're asking for is configurable auto-destroy of networks, storage
pools and vms when the daemon is stopped if I understand correctly.
That's a valid request and I'd recommend to discuss this with upstream.
Cheers,
 -- Guido