<div dir="ltr"><span style="font-size:12.8px">Of course the cronjob fails when trying to virsh blockcommit and not when creating the snapshot, sorry for the noise.</span><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-07 9:15 GMT+02:00 Dominik Psenner <span dir="ltr"><<a href="mailto:dpsenner@gmail.com" target="_blank">dpsenner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>different day, same issue.. cronjob runs and fails:</div><div><br></div><div><span style="font-size:12.8px">$ virsh snapshot-create-as --domain domain --name backup --no-metadata --atomic --disk-only --diskspec hda,snapshot=external</span><br></div><span class=""><div><span style="font-size:12.8px">error: failed to pivot job for disk hda</span><br style="font-size:12.8px"><span style="font-size:12.8px">error: block copy still active: disk 'hda' not ready for pivot yet</span><br style="font-size:12.8px"><span style="font-size:12.8px">Could not merge changes for disk hda of domain. VM may be in invalid state.</span><br></div><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">Then running the following in the morning succeeds and successfully pivotes the snapshot into the base image while the vm is live:</span></div><div><span style="font-size:12.8px"><br></span></div><div><div style="font-size:12.8px">$ virsh blockjob domain hda --abort<br></div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px">$ virsh blockcommit domain hda --active --pivot</span><span style="font-size:12.8px"><br></span></div><div><span class="m_-4622351790740132041gmail-im"><span style="font-size:12.8px">Successfully pivoted</span><br></span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px"><br></span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px">This need of manual interventions is becoming a tiring job..</span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px"><br></span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px">I someone else seeing the same issue or has an idea what the cause could be?</span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px">Can I trust the output and is the base image really up to the latest state?</span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px"><br></span></div><div><span class="m_-4622351790740132041gmail-im" style="font-size:12.8px">Cheers</span></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">2017-07-02 10:30 GMT+02:00 Dominik Psenner <span dir="ltr"><<a href="mailto:dpsenner@gmail.com" target="_blank">dpsenner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Just a little catch-up. This time I was able to resolve the issue by doing:<br><br></div>virsh blockjob domain hda --abort<br></div><span>virsh blockcommit domain hda --active --pivot<br><br></span></div>Last
 time I had to shut down the virtual machine and do this while being 
offline.<br><br>Thanks Wang for your valuable input. As far as the memory goes, there's plenty of head room:<br><br>$ free -h<br>              total        used        free      shared  buff/cache   available<br>Mem:           7.8G        1.8G        407M        9.7M        5.5G        5.5G<br>Swap:          8.0G        619M        7.4G<br></div><div class="gmail_extra"><div><div class="m_-4622351790740132041h5"><br><div class="gmail_quote">2017-07-02 10:26 GMT+02:00 王李明 <span dir="ltr"><<a href="mailto:wanglm@certusnet.com.cn" target="_blank">wanglm@certusnet.com.cn</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div link="blue" vlink="purple" lang="ZH-CN">

<div class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605Section1">

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US">mybe this is because you physic host memory is small<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US">then this will Causing instability of the virtual machine<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US">But I'm just guessing<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US">You can try to increase your memory<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:black" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:black" lang="EN-US">Wang Liming<u></u><u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:black" lang="EN-US"> <u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black" lang="EN-US"><u></u> <u></u></span></p>

<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">

<p class="MsoNormal"><b><span style="font-size:10.0pt">发件人<span lang="EN-US">:</span></span></b><span style="font-size:10.0pt" lang="EN-US"> <a href="mailto:libvirt-users-bounces@redhat.com" target="_blank">libvirt-users-bounces@redhat.c<wbr>om</a>
[mailto:<a href="mailto:libvirt-users-bounces@redhat.com" target="_blank">libvirt-users-bounces@<wbr>redhat.com</a>] </span><b><span style="font-size:10.0pt">代表 </span></b><span style="font-size:10.0pt" lang="EN-US">Dominik Psenner<br>
</span><b><span style="font-size:10.0pt">发送时间<span lang="EN-US">:</span></span></b><span style="font-size:10.0pt" lang="EN-US"> 2017</span><span style="font-size:10.0pt">年<span lang="EN-US">7</span>月<span lang="EN-US">2</span>日<span lang="EN-US"> 16:22<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US">
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [libvirt-users]
virtual drive performance<u></u><u></u></span></span></p>

</div><div><div class="m_-4622351790740132041m_2863693438744199861h5">

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Hi again,<u></u><u></u></span></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">just today an
issue I've thought to be resolved popped up again. We backup the machine by
doing:<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">virsh snapshot-create-as --domain domain
--name backup --no-metadata --atomic --disk-only --diskspec
hda,snapshot=external<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US"># backup hda.qcow2<u></u><u></u></span></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">virsh
blockcommit domain hda --active --pivot<u></u><u></u></span></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Every now and
then this process fails with the following error message:<br>
<br>
error: failed to pivot job for disk hda<br>
error: block copy still active: disk 'hda' not ready for pivot yet<br>
Could not merge changes for disk hda of domain. VM may be in invalid state.<u></u><u></u></span></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I expect live
backups are a great asset and should work. Is this a bug that may relates also
to the virtual drive performance issues we observe?<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">Cheers<u></u><u></u></span></p>

</div>

<div>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<div>

<p class="MsoNormal"><span lang="EN-US">2017-07-02 10:10 GMT+02:00 Dominik Psenner
<<a href="mailto:dpsenner@gmail.com" target="_blank">dpsenner@gmail.com</a>>:<u></u><u></u></span></p>

<div>

<div>

<div>

<div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Hi<u></u><u></u></span></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">a small update
on this. I just migrated the vm from the site to my laptop and fired it up. The
exact same xml configuration (except file paths and such) starts up and bursts
with 50Mb/s to 115Mb/s in the guest. This allows only one reasonable answer:
the cpu on my laptop is somehow better suited to emulate IO than the CPU built
into the host on site. The host there is a HP proliant microserver gen8 with
xeon processor. But the processor there is also never capped at 100% when the
guest copies files.<br>
<br>
I just ran another test by copying a 3Gb large file on the guest. What I can
observe on my computer is that the copy process is not at a constant rate but
rather starts with 90Mb/s, then drops down to 30Mb/s, goes up to 70Mb/s, drops
down to 1Mb/s, goes up to 75Mb/s, drops to 1Mb/s, goes up to 55Mb/s and the
pattern continues. Please note that the drive is still configured as:<br>
<br>
<driver name='qemu' type='qcow2' cache='none' io='threads'/><u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">and I would expect a constant rate that is
either high or low since there is no caching involved and the underlying hard
drive is a samsung ssd evo 850. To have an idea how fast that drive is on my
laptop:<br>
<br>
$ dd if=/dev/zero of=testfile bs=1M count=1000 oflag=direct<br>
1000+0 records in<br>
1000+0 records out<br>
1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.47301 s, 424 MB/s<u></u><u></u></span></p>

<div>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

</div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I can further
observe that the smaller the saved chunks are the slower the overall
performance is:<br>
<br>
dd if=/dev/zero of=testfile bs=512K count=1000 oflag=direct<br>
1000+0 records in<br>
1000+0 records out<br>
524288000 bytes (524 MB, 500 MiB) copied, 1.34874 s, 389 MB/s<br>
<br>
$ dd if=/dev/zero of=testfile bs=5K count=1000 oflag=direct<br>
1000+0 records in<br>
1000+0 records out<br>
5120000 bytes (5.1 MB, 4.9 MiB) copied, 0.105109 s, 48.7 MB/s<br>
<br>
$ dd if=/dev/zero of=testfile bs=1K count=10000 oflag=direct<br>
10000+0 records in<br>
10000+0 records out<br>
10240000 bytes (10 MB, 9.8 MiB) copied, 0.668438 s, 15.3 MB/s<br>
<br>
$ dd if=/dev/zero of=testfile bs=512 count=20000 oflag=direct<br>
20000+0 records in<br>
20000+0 records out<br>
10240000 bytes (10 MB, 9.8 MiB) copied, 1.10964 s, 9.2 MB/s<u></u><u></u></span></p>

</div>

<div>

<p class="MsoNormal"><span lang="EN-US">Could this be a limiting factor? Does
qemu/kvm do many many writes of just a few bytes?<u></u><u></u></span></p>

</div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
Ideas, anyone?<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US">Cheers<u></u><u></u></span></p>

</div>

</div>

</div>

<div>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<div>

<div>

<div>

<p class="MsoNormal"><span lang="EN-US">2017-06-21 20:46 GMT+02:00 Dan <<a href="mailto:srwx4096@gmail.com" target="_blank">srwx4096@gmail.com</a>>:<u></u><u></u></span></p>

</div>

</div>

<div>

<div>

<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">

<div>

<div>

<p class="MsoNormal"><span lang="EN-US">On Tue, Jun 20, 2017 at 04:24:32PM +0200,
Gianluca Cecchi wrote:<br>
> On Tue, Jun 20, 2017 at 3:38 PM, Dominik Psenner <<a href="mailto:dpsenner@gmail.com" target="_blank">dpsenner@gmail.com</a>> wrote:<br>
><br>
> ><br>
> > to the following:<br>
> ><br>
> > <disk type='file' device='disk'><br>
> >   <driver name='qemu' type='qcow2' cache='none'/><br>
> >   <source
file='/var/data/virtuals/machi<wbr>nes/windows-server-2016-<br>
> > x64/image.qcow2'/><br>
> >   <backingStore/><br>
> >   <target dev='hda' bus='scsi'/><br>
> >   <address type='drive' controller='0' bus='0'
target='0' unit='0'/><br>
> > </disk><br>
> ><br>
> > Do you see any gotchas in this configuration that could prevent the<br>
> > virtualized guest to power on and boot up?<br>
> ><br>
> ><br>
> When I configure like this, from a linux guest point of view I get this<br>
> Symbios Logic SCSI Controller:<br>
> 00:08.0 SCSI storage controller: LSI Logic / Symbios Logic 53c895a<br>
><br>
> But htis is true only if you add the SCSI controller too, not only the
disk<br>
> definition.<br>
> In my case<br>
><br>
>     <controller type='scsi' index='0'><br>
>       <address type='pci' domain='0x0000'
bus='0x00' slot='0x08'<br>
> function='0x0'/><br>
>     </controller><br>
><br>
> Note the slot='0x08' that is reflected into the first field of lspci
inside<br>
> my linux guest.<br>
> So between your controllers you have to add the SCSI one<br>
><br>
> In my case (Fedora 25 with virt-manager-1.4.1-2.fc25.noar<wbr>ch,<br>
> qemu-kvm-2.7.1-6.fc25.x86_64, libvirt-2.2.1-2.fc25.x86_64) with "Disk
bus"<br>
> set as SCSI in virt-manager, the xml defintiion for the guest is<br>
> automatically updated with the controller if not existent yet.<br>
> And the disk definition sections is like this:<br>
><br>
>     <disk type='file' device='disk'><br>
>       <driver name='qemu' type='qcow2'/><br>
>       <source file='/var/lib/libvirt/images/<wbr>slaxsmall.qcow2'/><br>
>       <target dev='sda' bus='scsi'/><br>
>       <boot order='1'/><br>
>       <address type='drive' controller='0' bus='0'
target='0' unit='0'/><br>
>     </disk><br>
><br>
> So I think you should set dev='sda' and not 'hda' in your xml for it<br>
><u></u><u></u></span></p>

</div>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I am actually
very curious to know if that would make a difference. I<br>
don't have a such windows vm images ready to test at present.<br>
<span style="color:#888888"><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158hoenzb">Dan</span><br>
</span><span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> I don't kknow if w2016 contains
the symbios logic drivers already</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> installed, so that a
"simple" reboot could imply an automatic</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> reconfiguration of the guest....</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> Note also that in Windows when the hw
configuration is considered heavily</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> changed, you could be asked to
register again (I don't think that the IDE</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> --> SCSI should imply it...)</span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">></span><br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605m-9222668100434188158im">> Gianluca</span><u></u><u></u></span></p>

<div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">>
______________________________<wbr>_________________<br>
> libvirt-users mailing list<br>
> <a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/libvirt-users</a><u></u><u></u></span></p>

</div>

</div>

</blockquote>

</div>

</div>

</div>

<p class="MsoNormal"><span style="color:#888888" lang="EN-US"><br>
<br clear="all">
<br>
<span class="m_-4622351790740132041m_2863693438744199861m_2683241285725809605hoenzb">-- <u></u><u></u></span></span></p>

<div>

<div>

<p class="MsoNormal"><span style="color:#888888" lang="EN-US">Dominik Psenner</span><span lang="EN-US"><u></u><u></u></span></p>

</div>

</div>

</div>

</div>

<p class="MsoNormal"><span lang="EN-US"><br>
<br clear="all">
<br>
-- <u></u><u></u></span></p>

<div>

<div>

<p class="MsoNormal"><span lang="EN-US">Dominik Psenner<u></u><u></u></span></p>

</div>

</div>

</div>

</div></div></div>

</div>


</blockquote></div><br><br clear="all"><br></div></div><span class="m_-4622351790740132041HOEnZb"><font color="#888888">-- <br><div class="m_-4622351790740132041m_2863693438744199861gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dominik Psenner<br></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-4622351790740132041gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dominik Psenner<br></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dominik Psenner<br></div></div>
</div>