<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="WordSection1">
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">I'm still trying to improve my snapshot behavior.  I was reading through the RedHat documentation and found this, "</span><b><span style="">Important
</span></b><span style="">Red Hat recommends the use of external snapshots”<span style=""> 
</span>Actually external snapshots sound great.<span style="">  </span>Then on a later page I found this: “</span>However, external snapshots are currently not fully implemented on Red Hat Enterprise Linux 7, and are not available when using
<span class="SpellE"><strong><span style="font-family:"Calibri",sans-serif">virt</span></strong></span><strong><span style="font-family:"Calibri",sans-serif">-manager</span></strong>.”<span style=""> 
</span><span class="SpellE">Hrm</span>.<span style="">  </span>Well, that’s for RHEL 7 and I’m using RHEL 8.<span style=""> 
</span>Maybe it has been fixed?<span style="">  </span>Apparently no.<span style=""> 
</span>When I tried to take the external snapshot it crashed with “<span class="SpellE"><span style="font-size:12.0pt; color:black">libvirt.libvirtError</span></span><span style="font-size:12.0pt; color:black">: internal error: unable to execute QEMU command
 '<span class="SpellE">cont</span>': Failed to get shared "write" lock.”<span style=""> 
</span>It created a new disk.qcow2, but the memory was not saved.<span style=""> 
</span>Worse, when I tried to reboot my VM it was locked to the new disk.<span style=""> 
</span>I changed it back to my original disk, but it says it can’t get the lock.<span style=""> 
</span>Even if it doesn’t work, I didn’t expect taking a snapshot to be destructive!<span style=""> 
</span>So, a couple of questions:</span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"> </span></p>
<ol type="1" style="margin-bottom: 0in;margin-top:0in">
<li class="MsoListParagraph" style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;color:black; margin-left:0in">
<span style="font-size:12.0pt">Is there any way to get external snapshots to work?<span style=""> 
</span></span></li><li class="MsoListParagraph" style="margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;color:black; margin-left:0in">
<span style="font-size:12.0pt">How do I clear the lock on my disk?<span style=""> 
</span>There aren’t any VMs alive to be using it, so I just need to clear the lock.</span></li></ol>
<p><span style=""> </span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">Below is what I was trying to do:</span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">$ <span class="SpellE">virsh</span> snapshot-create-as centos8_1
<span class="SpellE">externsnap</span> --atomic --<span class="SpellE">diskspec</span>
<span class="SpellE">vda,file</span>=$PWD/disk.qcow2,snapshot=external --<span class="SpellE">memspec</span> file=$PWD/mem.qcow2,snapshot=external
</span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">error: internal error: unable to execute QEMU command '<span class="SpellE">cont</span>': Failed to get shared "write" lock</span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">$ ls *.qcow2</span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">disk.qcow2</span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">$  #Noite there is no mem.qcow2</span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"> </span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black">Then when trying to restart I first had to point
<span class="SpellE">virt</span>-manager back to my original VM disk, I got this error about the disk lock:</span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"><br>
</span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"> Error starting domain: internal error: qemu unexpectedly closed the monitor: 2021-09-13T14:12:42.409301Z qemu-kvm: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":"libvirt-3-format"}:
 Failed to get "write" lock</p>
<div>Is another process using the image [/home/leek2/qemu/rhel8_1.qcow2]?</div>
<div><br>
</div>
<div>Traceback (most recent call last):</div>
<div>  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper</div>
<div>    callback(asyncjob, *args, **kwargs)</div>
<div>  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb</div>
<div>    callback(*args, **kwargs)</div>
<div>  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn</div>
<div>    ret = fn(self, *args, **kwargs)</div>
<div>  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1280, in startup</div>
<div>    self._backend.create()</div>
<div>  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1234, in create</div>
<div>    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)</div>
<div>libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2021-09-13T14:12:42.409301Z qemu-kvm: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":"libvirt-3-format"}: Failed
 to get "write" lock</div>
<span>Is another process using the image [/home/leek2/qemu/rhel8_1.qcow2]?</span></span>
<p></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"><span><br>
</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"><span>Thanks,</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size:12.0pt; color:black"><span>Jim</span></span></p>
</div>
</div>
</body>
</html>