<div dir="ltr"><div>Worked perfectly!!! BIG thanks Omer!!! All my VM&#39;s are back up. Nothing lost!<br><br></div>SOLVED!!!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-31 9:53 GMT+02:00 Omer Frenkel <span dir="ltr">&lt;<a href="mailto:ofrenkel@redhat.com" target="_blank">ofrenkel@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Koen Vanoppen&quot; &lt;<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>&gt;<br>
&gt; To: &quot;Omer Frenkel&quot; &lt;<a href="mailto:ofrenkel@redhat.com">ofrenkel@redhat.com</a>&gt;, <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
</span><span class="">&gt; Sent: Tuesday, March 31, 2015 7:35:57 AM<br>
&gt; Subject: Re: [ovirt-users] Snapshot issue<br>
&gt;<br>
</span><span class="">&gt; I just wanted to remove the snapshots in ovirt... That&#39;s all... And now<br>
&gt; they are locked. Without the possibility to remove, reboot the vm or cancel<br>
&gt; the snapshots...<br>
&gt; So I&#39;m stuck... How can I change the status of the snapshot in the db, so<br>
&gt; that at least I can remove the VM? And what could be the impact , worst<br>
&gt; case?<br>
&gt;<br>
<br>
</span>i thought you want to save the vm, then the worst case might be data corruption,<br>
in case something is really wrong with the snapshots and you try to run the vm.<br>
<br>
more optimistic, in case snapshot is missing in storage but not deleted in db,<br>
vm would fail to start, then you might be able to just delete the snapshot (again probably only manually in db)<br>
and recover completely.<br>
<br>
if you just want to delete the vm, worst case would be that you have to clear manually stuff from the db/storage<br>
<br>
if you decide to change the db, better to have a backup :)<br>
also, i would recommend making it when the engine is down.<br>
<br>
ok, so, first to get the info in the db:<br>
select snapshot_id,description,status from snapshots where status = &#39;LOCKED&#39; and vm_id in (select vm_guid from vm_static where vm_name=&#39;&lt;vm name here&gt;&#39;);<br>
<br>
just update it to be &#39;OK&#39; :<br>
update snapshots set status = &#39;OK&#39; where snapshot_id = &#39;&lt;snapshot id from previous query&gt;&#39;;<br>
<br>
also, check there are locked images related to this snapshot:<br>
select image_guid,imagestatus from images where vm_snapshot_id = &#39;&lt;snapshot id from previous query&gt;&#39; and imagestatus != 1;<br>
<br>
if so, need to unlock it as well:<br>
updates images set imagestatus = 1 where image_guid = &#39;&lt;id of images from previous query&gt;&#39;;<br>
<br>
<br>
let me know how it went<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; Kind regards,<br>
&gt;<br>
&gt; 2015-03-30 13:46 GMT+02:00 Omer Frenkel &lt;<a href="mailto:ofrenkel@redhat.com">ofrenkel@redhat.com</a>&gt;:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ----- Original Message -----<br>
&gt; &gt; &gt; From: &quot;Koen Vanoppen&quot; &lt;<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>&gt;<br>
&gt; &gt; &gt; To: &quot;Omer Frenkel&quot; &lt;<a href="mailto:ofrenkel@redhat.com">ofrenkel@redhat.com</a>&gt;, <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
&gt; &gt; &gt; Sent: Monday, March 30, 2015 7:44:10 AM<br>
&gt; &gt; &gt; Subject: Re: [ovirt-users] Snapshot issue<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I can&#39;t even remove them... Something needs to be done... Any ideas?<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; not sure i understand what you tried?<br>
&gt; &gt; the &#39;broken&#39; snapshots are locked, so you can&#39;t remove them.<br>
&gt; &gt; as i said, there is no easy and safe way to fix this...<br>
&gt; &gt; you can try to change the status of the snapshot in the db - but i am not<br>
&gt; &gt; sure what will happen!<br>
&gt; &gt;<br>
&gt; &gt; &gt; 2015-03-25 8:45 GMT+01:00 Koen Vanoppen &lt;<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>&gt;:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Hi Omer,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Thanks for your reply.<br>
&gt; &gt; &gt; &gt; I was cleaning our snapshots on oVirt. So I started deleting snapshots<br>
&gt; &gt; one<br>
&gt; &gt; &gt; &gt; by one. In total in deleted 10 snapshots. 5 VM&#39;s came back up, without<br>
&gt; &gt; the<br>
&gt; &gt; &gt; &gt; error message, the rest of them are still down with this error message.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; 2015-03-25 7:36 GMT+01:00 Omer Frenkel &lt;<a href="mailto:ofrenkel@redhat.com">ofrenkel@redhat.com</a>&gt;:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; ----- Original Message -----<br>
&gt; &gt; &gt; &gt;&gt; &gt; From: &quot;Koen Vanoppen&quot; &lt;<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; To: <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; Sent: Wednesday, March 25, 2015 8:09:17 AM<br>
&gt; &gt; &gt; &gt;&gt; &gt; Subject: Re: [ovirt-users] Snapshot issue<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; I&#39;m still not able to start my VM&#39;s:<br>
&gt; &gt; &gt; &gt;&gt; &gt; Cannot run VM. The VM is performing an operation on a Snapshot.<br>
&gt; &gt; Please<br>
&gt; &gt; &gt; &gt;&gt; wait<br>
&gt; &gt; &gt; &gt;&gt; &gt; for the operation to finish, and try again...<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; I already restarted the vdsm deamons on the hypervisors and<br>
&gt; &gt; restarted<br>
&gt; &gt; &gt; &gt;&gt; the<br>
&gt; &gt; &gt; &gt;&gt; &gt; engine too... Does anybody has any clue how I can solve this state?<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Kind regards,<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Koen<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; 2015-03-24 7:45 GMT+01:00 Koen Vanoppen &lt; <a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a><br>
&gt; &gt; &gt; :<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; This is in the logs:<br>
&gt; &gt; &gt; &gt;&gt; &gt; 2015-03-24 07:41:50,436 WARN<br>
&gt; &gt; [org.ovirt.engine.core.bll.RunVmCommand]<br>
&gt; &gt; &gt; &gt;&gt; &gt; (ajp--127.0.0.1-8702-12) [686c18ce] CanDoAction of action RunVm<br>
&gt; &gt; failed<br>
&gt; &gt; &gt; &gt;&gt; for<br>
&gt; &gt; &gt; &gt;&gt; &gt; user Reasons:<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; VAR__ACTION__RUN,VAR__TYPE__VM,ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Can&#39;t I clear all this? Because I Still have several machines down<br>
&gt; &gt; due<br>
&gt; &gt; &gt; &gt;&gt; the<br>
&gt; &gt; &gt; &gt;&gt; &gt; reason he is still in the &quot;cannot run VM...&quot; state...<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; this happens because you have a snapshot in status locked,<br>
&gt; &gt; &gt; &gt;&gt; probably you did some operation on snapshot and something went wrong<br>
&gt; &gt; (it<br>
&gt; &gt; &gt; &gt;&gt; might have failed without clearing the state..)<br>
&gt; &gt; &gt; &gt;&gt; there is no easy and safe way to fix this (you can change the status<br>
&gt; &gt; of<br>
&gt; &gt; &gt; &gt;&gt; the snapshot in the db but i am not sure what will happen)<br>
&gt; &gt; &gt; &gt;&gt; what action did you do with snapshots on this vm?<br>
&gt; &gt; &gt; &gt;&gt; what was the result?<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; 2015-03-23 8:40 GMT+01:00 Koen Vanoppen &lt; <a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a><br>
&gt; &gt; &gt; :<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Dear all,<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; I have the following problem:<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Cannot run VM. The VM is performing an operation on a Snapshot.<br>
&gt; &gt; Please<br>
&gt; &gt; &gt; &gt;&gt; wait<br>
&gt; &gt; &gt; &gt;&gt; &gt; for the operation to finish, and try again.<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; It is like this since Friday... How can I resolve this? I really<br>
&gt; &gt; need<br>
&gt; &gt; &gt; &gt;&gt; this vm<br>
&gt; &gt; &gt; &gt;&gt; &gt; to be up again...<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Kind regards,<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Koen<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt; &gt; Users mailing list<br>
&gt; &gt; &gt; &gt;&gt; &gt; <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>