<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi <span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;">Kashyap Chamarthy:</span></div><div>thank you very much for answer my question:</div><div><br></div><div><div style="font-size: 19px;"><b>一: lead to VM filesystem becoming read-only</b></div><div style="font-size: 19px;"><b>1: test case</b></div><div style="font-size: 16px;">it  lead to VM <span style="line-height: 1.5; background-color: window;">filesystem becoming read-only test case as follows:</span></div><div><br></div><div>we want to snapshot for VM , to obtain VM incremental data,and use virsh blockcommit,qemu-img commit,qemu-img rebase  to shorten snapshot chain.</div><div>Details are as  follows(<b>when VM  running state,</b> we perform the following operations):</div><div><br></div><div><b>(1)  the host machine control VM test</b></div><div style=""><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">virsh snapshot-create-as mix snap1 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap1-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap2 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap2-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap3 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap3-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap4 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap4-mix.img --disk-only --atomic --quiesce<br>virsh blockcommit mix vda --base /tmp/mul/loop-mix-commit-rebase/snap1-mix.img --top /tmp/mul/loop-mix-commit-rebase/snap2-mix.img --wait --verbose<br><b>qemu-img commit -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap1-mix.img<br>qemu-img rebase -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap3-mix.img -b /tmp/mul/loop-mix-commit-rebase/mix.img -F qcow2 -p</b><br>virsh snapshot-delete mix snap1 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap1-mix.img<br>virsh snapshot-delete mix snap2 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap2-mix.img<br>virsh snapshot-create-as mix snap5 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap5-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap6 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap6-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap7 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap7-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap8 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap8-mix.img --disk-only --atomic --quiesce<br>virsh blockcommit mix vda --base /tmp/mul/loop-mix-commit-rebase/snap3-mix.img --top /tmp/mul/loop-mix-commit-rebase/snap6-mix.img --wait --verbose<br><b>qemu-img commit -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap3-mix.img<br>qemu-img rebase -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap7-mix.img -b /tmp/mul/loop-mix-commit-rebase/mix.img -F qcow2 -p</b><br>virsh snapshot-delete mix snap3 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap3-mix.img<br>virsh snapshot-delete mix snap4 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap4-mix.img<br>virsh snapshot-delete mix snap5 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap5-mix.img<br>virsh snapshot-delete mix snap6 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap6-mix.img<br>virsh snapshot-create-as mix snap9 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap9-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap10 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap10-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap11 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap11-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap12 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap12-mix.img --disk-only --atomic --quiesce<br>virsh blockcommit mix vda --base /tmp/mul/loop-mix-commit-rebase/snap7-mix.img --top /tmp/mul/loop-mix-commit-rebase/snap10-mix.img --wait --verbose<br><b>qemu-img commit -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap7-mix.img<br>qemu-img rebase -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap11-mix.img -b /tmp/mul/loop-mix-commit-rebase/mix.img -F qcow2 -p</b><br>virsh snapshot-delete mix snap7 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap7-mix.img<br>virsh snapshot-delete mix snap8 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap8-mix.img<br>virsh snapshot-delete mix snap9 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap9-mix.img<br>virsh snapshot-delete mix snap10 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap10-mix.img<br>virsh snapshot-create-as mix snap13 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap13-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap14 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap14-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap15 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap15-mix.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as mix snap16 --diskspec vda,file=/tmp/mul/loop-mix-commit-rebase/snap16-mix.img --disk-only --atomic --quiesce<br>virsh blockcommit mix vda --base /tmp/mul/loop-mix-commit-rebase/snap11-mix.img --top /tmp/mul/loop-mix-commit-rebase/snap14-mix.img --wait --verbose<br><b>qemu-img commit -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap11-mix.img<br>qemu-img rebase -f qcow2 /tmp/mul/loop-mix-commit-rebase/snap15-mix.img -b /tmp/mul/loop-mix-commit-rebase/mix.img -F qcow2 -p</b><br>virsh snapshot-delete mix snap11 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap11-mix.img<br>virsh snapshot-delete mix snap12 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap12-mix.img<br>virsh snapshot-delete mix snap13 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap13-mix.img<br>virsh snapshot-delete mix snap14 --metadata<br>rm -fr /tmp/mul/loop-mix-commit-rebase/snap14-mix.img</span></div><div style=""><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><b>。。。。。。。。。。。。。。。。。。。。。。。。。。。。(the cycle test continue)</b></span></div><div style=""><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div><b>(2)  the VM  test</b></div><div>in the VM,  loop write data and  delete data operations。</div><div><br></div><div><b style="font-size: 19px; line-height: 28px;">2: test result</b></div><div><span style="line-height: 28px;">when the test run for a while(8 hour or 10 hour or 20 hour or 30 hour  and so on), the </span><span style="background-color: window; font-size: 16px; line-height: 24px;">VM </span><span style="font-size: 16px; line-height: 1.5; background-color: window;">filesystem becoming read-only!</span></div><div><b style="font-size: 19px; line-height: 28px;">3: We are not sure the problem</b></div><div><b style="font-size: 19px; line-height: 28px;">   <span style="font-size: 14px;">   (1)</span><span style="font-size: 14px;">when VM running,</span></b><span style="line-height: 28px;"> whether it can be used to modify snapshot's backingfile by qemu-img rebase<b>(can only be used in vm offline?)</b>? </span></div><div><span style="line-height: 28px;">       (2)when VM running,whether it can be used to </span><span style="line-height: 1.5; background-color: window;">commit the snapshot's changes by qemu-img commit<b>(can only be used in vm offline?)</b>?</span></div><div><b style="font-size: 19px; line-height: 28px;">       </b></div><div><span style="font-size: 16px; line-height: 1.5; background-color: window;"><br></span></div><div><b style="font-size: 19px; line-height: 28px;">二: Run normal(ok) test</b></div><div><b style="font-size: 19px; line-height: 28px;">1: test case</b></div><div><span style="font-size: 19px; line-height: 28px;"><b>      </b><span style="font-size: 14px;">in order to eliminate potential problems,we only </span></span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">use virsh blockcommit shorten snapshot chain.</span></div><div><b>(1)  the host machine control VM test</b></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" bold;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" bold;="" font-style:="" normal;text-decoration:="" none;'="">virsh snapshot-create-as length snap1 --diskspec vda,file=/tmp/testsnapshot/image/snap1-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap2 --diskspec vda,file=/tmp/testsnapshot/image/snap2-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap3 --diskspec vda,file=/tmp/testsnapshot/image/snap3-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap4 --diskspec vda,file=/tmp/testsnapshot/image/snap4-length.img --disk-only --atomic --quiesce<br>virsh blockcommit length vda --base /tmp/testsnapshot/image/length.img --top /tmp/testsnapshot/image/snap3-length.img --wait --verbose<br>virsh snapshot-delete length snap1 --metadata<br>rm -fr /tmp/testsnapshot/image/snap1-length.img<br>virsh snapshot-delete length snap2 --metadata<br>rm -fr /tmp/testsnapshot/image/snap2-length.img<br>virsh snapshot-delete length snap3 --metadata<br>rm -fr /tmp/testsnapshot/image/snap3-length.img<br>virsh snapshot-create-as length snap5 --diskspec vda,file=/tmp/testsnapshot/image/snap5-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap6 --diskspec vda,file=/tmp/testsnapshot/image/snap6-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap7 --diskspec vda,file=/tmp/testsnapshot/image/snap7-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap8 --diskspec vda,file=/tmp/testsnapshot/image/snap8-length.img --disk-only --atomic --quiesce<br>virsh blockcommit length vda --base /tmp/testsnapshot/image/length.img --top /tmp/testsnapshot/image/snap7-length.img --wait --verbose<br>virsh snapshot-delete length snap4 --metadata<br>rm -fr /tmp/testsnapshot/image/snap4-length.img<br>virsh snapshot-delete length snap5 --metadata<br>rm -fr /tmp/testsnapshot/image/snap5-length.img<br>virsh snapshot-delete length snap6 --metadata<br>rm -fr /tmp/testsnapshot/image/snap6-length.img<br>virsh snapshot-delete length snap7 --metadata<br>rm -fr /tmp/testsnapshot/image/snap7-length.img<br>virsh snapshot-create-as length snap9 --diskspec vda,file=/tmp/testsnapshot/image/snap9-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap10 --diskspec vda,file=/tmp/testsnapshot/image/snap10-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap11 --diskspec vda,file=/tmp/testsnapshot/image/snap11-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap12 --diskspec vda,file=/tmp/testsnapshot/image/snap12-length.img --disk-only --atomic --quiesce<br>virsh blockcommit length vda --base /tmp/testsnapshot/image/length.img --top /tmp/testsnapshot/image/snap11-length.img --wait --verbose<br>virsh snapshot-delete length snap8 --metadata<br>rm -fr /tmp/testsnapshot/image/snap8-length.img<br>virsh snapshot-delete length snap9 --metadata<br>rm -fr /tmp/testsnapshot/image/snap9-length.img<br>virsh snapshot-delete length snap10 --metadata<br>rm -fr /tmp/testsnapshot/image/snap10-length.img<br>virsh snapshot-delete length snap11 --metadata<br>rm -fr /tmp/testsnapshot/image/snap11-length.img<br>virsh snapshot-create-as length snap13 --diskspec vda,file=/tmp/testsnapshot/image/snap13-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap14 --diskspec vda,file=/tmp/testsnapshot/image/snap14-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap15 --diskspec vda,file=/tmp/testsnapshot/image/snap15-length.img --disk-only --atomic --quiesce<br>virsh snapshot-create-as length snap16 --diskspec vda,file=/tmp/testsnapshot/image/snap16-length.img --disk-only --atomic --quiesce<br>virsh blockcommit length vda --base /tmp/testsnapshot/image/length.img --top /tmp/testsnapshot/image/snap15-length.img --wait --verbose<br>virsh snapshot-delete length snap12 --metadata<br>rm -fr /tmp/testsnapshot/image/snap12-length.img<br>virsh snapshot-delete length snap13 --metadata<br>rm -fr /tmp/testsnapshot/image/snap13-length.img<br>virsh snapshot-delete length snap14 --metadata<br>rm -fr /tmp/testsnapshot/image/snap14-length.img<br>virsh snapshot-delete length snap15 --metadata<br>rm -fr /tmp/testsnapshot/image/snap15-length.im</span></div><div><br></div><div><span style="background-color: window; font-size: 10.5pt; line-height: 1.5;"> </span><b style="font-size: 10.5pt; line-height: 1.5; background-color: window;">(2)  the VM  test</b></div><div>in the VM,  loop write data and  delete data operations。</div><div><br></div><div><b style="font-size: 19px; line-height: 28px;">2: test result</b></div><div><span style="line-height: 28px;">the test run 200 hours, the test ok!!</span></div></div><div><span style="line-height: 28px;"><br></span></div><div><p class="ordinary-output target-output" style="font-size: 16px;"><span class="high-light-bg" space="" right-pos="0|18" left-pos="0|18"><b>Waiting for your reply, thank you very much!</b></span></p></div><div><br></div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>justlibvirt@gmail.com</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:kchamart@redhat.com">Kashyap Chamarthy</a></div><div><b>Date:</b> 2015-10-13 21:55</div><div><b>To:</b> <a href="mailto:justlibvirt@gmail.com">justlibvirt@gmail.com</a></div><div><b>CC:</b> <a href="mailto:libvir-list@redhat.com">libvir-list</a>; <a href="mailto:libvirt-users@redhat.com">libvirt-users</a>; <a href="mailto:eblake@redhat.com">eblake</a></div><div><b>Subject:</b> Re: [libvirt-users] virsh can't support VM offline blockcommit</div></div></div><div><div>On Tue, Oct 13, 2015 at 10:39:58AM +0800, justlibvirt@gmail.com wrote:</div>
<div>> Hi  everyone!</div>
<div> </div>
<div>Hi,</div>
<div> </div>
<div>Firstly, please don't post the same message multiple times in a row.  If</div>
<div>someone hasn't responded, they're either busy, or haven't noticed this</div>
<div>message.</div>
<div> </div>
<div>>      I use the libvirt(version: 1.2.2) and QEMU(version: 2.2.1) to</div>
<div>>      test qemu snapshot features:</div>
<div>>     </div>
<div>>      I tried virsh blockcommit when VM offline,  the virsh blockcommit</div>
<div>>      failed: the error messase as below: error: Requested operation is</div>
<div>>      not valid: domain is not running when I start the VM,  the virsh</div>
<div>>      blockcommit  work fine!  my question is:we need virsh support</div>
<div>>      blockcommit when VM offline。how do?</div>
<div> </div>
<div>As near as I know, 'blockcommit' hasn't yet gotten offline support.</div>
<div> </div>
<div>>     we  test qemu snapshot as follows: we need  create  snapshot of</div>
<div>>     the cycle,and  by virsh blockcommit merge snapshot chain,but</div>
<div>>     when VM offline, the virsh blockcommit will fail, someone</div>
<div>>     suggest me:when VM offline,may use qemu-img commit to submit</div>
<div>>     snapshot turn,but qemu-img can't modify snapshot chain backing</div>
<div>>     relation,it need we use qemu-img  rebase amend snapshot‘s</div>
<div>>     backingfile, </div>
<div> </div>
<div>As you note there's the 'qemu-img commit' primitive that allows you to</div>
<div>commit the changes in an overlay back into its base image:</div>
<div> </div>
<div>If you have:  base.qcow2 <-- overlay1.qcow2 <-- overlay2.qcow2</div>
<div> </div>
<div>And, if you do:</div>
<div> </div>
<div>    $ qemu-img commit overlay2.qcow2</div>
<div> </div>
<div>It'll commit the contents of overlay2.qcow2 into overlay1.qcow2.</div>
<div> </div>
<div>And, indeed use the 'qemu-img rebase' to modify the backing file is the</div>
<div>only method I know of, for offline operations.</div>
<div> </div>
<div>>     the main question is when we use qemu-img rebase</div>
<div>>     modify snapshot's backingfile, if someone start the VM, it  will</div>
<div>>     may lead to VM filesystem readonly。</div>
<div> </div>
<div>Though I haven't tested this recently, why would it lead to VM</div>
<div>filesystem becoming read-only?  </div>
<div> </div>
<div>>    we  should how to  solve the question?   thanks!  > </div>
<div> </div>
<div>-- </div>
<div>/kashyap</div>
</div></blockquote>
</body></html>