[libvirt-users] timeout on VM actions prone to hang

Michal Privoznik mprivozn at redhat.com
Wed Nov 7 13:59:59 UTC 2018


On 11/07/2018 01:46 PM, Nikola Ciprich wrote:
> Hi fellow libvirt users,
> 
> I'd like to ask, whether somebody possibly dealt with similar
> problem we're hitting.. Some of libvirt VM operations (ie
> fs freeze) are prone to hang for long time, in case the guest
> agent is in some bad state.. My question is, if it's possible
> to set some timeout for such operations, or we have to deal with
> it ie with separate thread and some timers? we're using python
> libvirt bindings..
> 
> I'll appreciate any advice

We explicitly chose not to have any timeouts becuase no one can know how
big the timeout should be. Nor libvirt, nor mgmt application. What I am
saying is that even if you'd set timeout of X seconds, fs freeze might
still time out. But given that Murphy's law are correct the freeze will
finish right after timeout is reported. Problem with this is that domain
is in different state than libvirt thinks.

But specifically for qemu guest agent related issues, there is
virDomainQemuAgentCommand() through which you can send 'guest-ping' to
check that the agent is responsive. If it fails, then don't issue fs
freeze API and vice versa.

Michal




More information about the libvirt-users mailing list