Hi, I have a CentOS-7 server running KVM but also oVirt. Recently, following updates, VMs not handled by oVirt have been deleting themselves after they shut down. Previously to this, I have not had any problems of this nature. I cannot say whether the problem is coming from oVirt updates or not. I am creating a VM using "virsh define myvm.xml" on the server, starting it through virt-manager on my local PC, performing work inside the VM and then closing down the operating system inside the VM, and then once it has completed shutting down it shows "Shutoff" as the status in virt-manager and then maybe 5 seconds later it disappears from the list entirely and has been deleted. To start the VM again, requires "virsh define myvm.xml" to be run again. What I cannot determine is **why** the VM is deleted. I am using "virsh define" which I understand should create a persistent VM, and I have enabled "audit_level=2" and "audit_logging=1" in libvirtd.conf but can't see anything helpful in the log output (although maybe I don't know what I'm looking for). Is anyone, please, able to help me work out what is deleting my VMs once they shut down ... and, if possible, why?! Many, many thanks, Andy
Peter Krempa
2018-Nov-07 16:33 UTC
Re: [libvirt-users] How to find out what is deleting my vms
On Wed, Nov 07, 2018 at 15:32:27 +0000, Andy Gibbs wrote:> Hi, > > > I have a CentOS-7 server running KVM but also oVirt. > > > Recently, following updates, VMs not handled by oVirt have been deleting themselves after they shut down. Previously to this, I have not had any problems of this nature. I cannot say whether the problem is coming from oVirt updates or not. > > > I am creating a VM using "virsh define myvm.xml" on the server, starting it through virt-manager on my local PC, performing work inside the VM and then closing down the operating system inside the VM, and then once it has completed shutting down it shows "Shutoff" as the status in virt-manager and then maybe 5 seconds later it disappears from the list entirely and has been deleted. To start the VM again, requires "virsh define myvm.xml" to be run again. > > > What I cannot determine is **why** the VM is deleted. I am using "virsh define" which I understand should create a persistent VM, and I have enabled "audit_level=2" and "audit_logging=1" in libvirtd.conf but can't see anything helpful in the log output (although maybe I don't know what I'm looking for).You should enable debug logging to see which connection deletes your vms.> Is anyone, please, able to help me work out what is deleting my VMs once they shut down ... and, if possible, why?!AFAIK this change comes from oVirt. They recently started to use persistently defined VMs for their actions, but they define them before use. And undefine them after done. I presume that they delete all inactive persistent VMs they find as a way to "clean up" after themselves rather than just those they've created. I presume their rationale is that oVirt is the only thing that should deal with libvirt on the oVirt hypervisor node, but that sounds flawed.
Andy Gibbs
2018-Nov-08 07:48 UTC
Re: [libvirt-users] How to find out what is deleting my vms
On Wed, Nov 07, 2018 at 16:33, Peter Krempa wrote:> AFAIK this change comes from oVirt. They recently started to use > persistently defined VMs for their actions, but they define them before > use. And undefine them after done. > > I presume that they delete all inactive persistent VMs they find as > a way to "clean up" after themselves rather than just those they've > created. > > I presume their rationale is that oVirt is the only thing that should > deal with libvirt on the oVirt hypervisor node, but that sounds flawed.Thank you for your help, I managed to find the offending lines in the log and, yes, unfortunately you seem to be right. I will take it up in the oVirt bug tracker. Thanks again, Andy