Triggering a checkpoint from inside the VM

Leek, Jim leek2 at llnl.gov
Thu Sep 9 00:30:53 UTC 2021


Here's the error I sometimes get on checkpoint/restore.  It just happened again.  In this test I had at least a 40 second break between checkpoint and restore, so extra sleep doesn't seem to help much.

Error unpausing domain: Timed out during operation: cannot acquire state change lock (held by monitor=qemuDispatchDomainMonitorCommand)

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1312, in resume
    self._backend.resume()
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2174, in resume
    if ret == -1: raise libvirtError ('virDomainResume() failed', dom=self)
libvirt.libvirtError: Timed out during operation: cannot acquire state change lock (held by monitor=qemuDispatchDomainMonitorCommand)
________________________________
From: Tony Brian Albers <tba at kb.dk>
Sent: Wednesday, September 8, 2021 12:06 AM
To: Leek, Jim <leek2 at llnl.gov>; virt-tools-list at redhat.com <virt-tools-list at redhat.com>
Subject: Re: Triggering a checkpoint from inside the VM

On 08/09/2021 08.31, Leek, Jim wrote:
> 1. I guess you mean by Using a shared disk?  That could work, I had some trouble with the shared disk before, I don’t think I ever got it to work. I’ll have to check my notes. IT has the host machine locked down very securely in some ways, and sometimes that causes trouble.

On my host I've set up a local network that only the VM's and the host
has access to. That makes it possible to do smth like:

user at host$  ssh user at vm ls -l somefile

and then compare that output to something you've defined, and trigger
the savevm based on that.

>
> 2. I did specify the settings in virt-manager and I can use virsh. But sometimes I get an error from libvirt when doing a series of savevm and loadvm in a row. I have a hope that using qemu-kvm without libvirt might make it more reliable.  But as I said, I’m having trouble getting the networking and display working properly without libvirt.
>

I think libvirt is necessary to make networking and display work(not
entirely sure). But the errors you get might be because the processes
are scheduled too close to one another, see if you can put something
like a sleep() in between them. I think 10 seconds will do.

/tony

>
> ---
> Sent from Workspace ONE Boxer<https://urldefense.us/v3/__https://whatisworkspaceone.com/boxer__;!!G2kpM7uM-TzIFchu!hbhAdjLTl6sGjvB4cfYJDpIObK0BhNLmWmmi0NEBWX7ls4h84l2slu6DAIhiKh0$ >
>
> On September 7, 2021 at 10:58:03 PM PDT, Tony Brian Albers <tba at kb.dk> wrote:
> On 08/09/2021 06.22, Leek, Jim wrote:
>
>>
>>     1.  Connect to the qemu monitor with telnet from inside the VM.  (Therefore skipping the whole ssh remote command thing.)
>
> I'd go the other way around, make the guest touch a file somewhere and
> let the host check if the file is there/has been updated, and based on
> that, run the savevm process.
>
>
>>     2.  Run the VM without virt-manager (perhaps that would be simpler?)
>>
>
> I think you can specify the settings for the VM through virt-manager and
> then just use virsh to manage it afterwards.
>
> Also, check out github for kvm backup scripts, I know there are some
> that you could use.
>
>
> HTH
>
> /tony
>
>
> --
> Tony Albers - Systems Architect - Data Department, Royal Danish Library,
> Victor Albecks Vej 1, 8000 Aarhus C, Denmark
> Tel: +45 2566 2383 - CVR/SE: 2898 8842 - EAN: 5798000792142
>


--
Tony Albers - Systems Architect - Data Department, Royal Danish Library,
Victor Albecks Vej 1, 8000 Aarhus C, Denmark
Tel: +45 2566 2383 - CVR/SE: 2898 8842 - EAN: 5798000792142
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20210909/2f5d2ea2/attachment.htm>


More information about the virt-tools-list mailing list