[libvirt] Regarding Migration Statistics

Anubhav Guleria anubhav.nitsri.it at gmail.com
Tue Jan 10 14:37:13 UTC 2017


Greetings,

I am writing a code using libvirt API to migrate VM between two physical
hosts *(QEMU/KVM) , *say some *n *number of times.

*1)* I am using right now* virDomainPtr virDomainMigrate (.......) *and to
calculate the total migration time I am using something like this:

*clock_gettime(CLOCK_MONOTONIC_RAW,&begin);  *
 *migrate*(domainToMigrate,nodeToMigrate);

*clock_gettime(CLOCK_MONOTONIC_RAW,&end);*



*Total Migration Time = end.tv_sec-begin.tv_sec*

Is this correct way to calculate total migration time. And is there some
way to calculate the downtime (not how to set it)?

*2) *I am interested in identifying in particular other statistics of
migration like :
*Number of iterations in Pre Copy*, *Memory transferred in each iteration*
etc.
I was going through the API and found* virDomainJobInfo
<http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainJobInfo> and
virDomainGetJobStats
<http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats>
*functions.But
how to use them is not very clear. Can anyone point me to right place to
achieve this objective?

Thanks in advance.
And sorry if that was too silly to ask.

Anubhav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170110/cc1eb7a7/attachment-0001.htm>


More information about the libvir-list mailing list