[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] Persisting the libvirt guest's reason code.



On Tue, Mar 20, 2018 at 08:21:00AM +0000, Tanmoy Sinha wrote:
> Hi,
> 
> I am currently facing an issue with libvirt w.r.t  a guest's state and
> reason code. Precisely following are steps:
> 
> 1. I have a running guest named *linux-test *on KVM
> 2. I do a
> *           $> virsh save linux-test linux-saved.dat*
> 3. At this point
> *          $> virsh domstate --reason linux-test *shows  *shutoff(saved)*
> 4. I restarted the libvirtd daemon
> *         $>systemctl restart libvirtd*
> 5. Now when I check for the domain state,
> *         $> virsh domstate --reason linux-test  *it reads
> *shutoff(unknown)*
> 
> 
> >From what I understand:
> 
> The reason code for a particular state is maintained in-memory (no
> persistence in libvirt). Now when libvirtd restarts it queries the qemu
> monitor for all the running qemu processes and reassigns the state and
> reason. But for guests which are in shutoff state, there’s exists no QEMU
> instance for it, hence it has no way to know what was the last reason (i..e
> the default value 0 or UNKNOWN), but the state remains as shutfoff!
> 
> Is there a patch for it? Or someway to retain the reason code across
> reboots and restart?

In general libvirtd maintains state for running VMs across libvirtd
restarts by recording it in /var/run/libivrt/qemu/$GUEST.xml. That
file is only relevant when the guest is running though, so when you
have saved the guest, it is now shutoff and we've no place in which
to record the "reason" across the libvirtd restart.

IOW we preserve the reason across restarts, except when shutting off

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]