<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Daniel,<br>
      <br>
      I thought migration might be the reason, but I'm still not seeing
      the behavior you describe with regards to pausing. I saw the
      following behavior:<br>
      <br>
      <ol>
        <li>Created VM on node 1</li>
        <li>Started VM on node 1</li>
        <li>Migrated VM to node 2, node 1 is now shutdown, node 2 is
          running</li>
        <li>I paused node 2</li>
        <li>I started node 1, no error</li>
        <li>Paused node 1</li>
        <li>Unpaused node 2, no err</li>
      </ol>
      <p>I thought maybe the original VM had to be paused first, so I
        tried that as well:<br>
      </p>
      <ol>
        <li>Created VM on node 1</li>
        <li>Started VM on node 1</li>
        <li>Migrated to node 2, node 1 is now shutdown, node 2 is
          running</li>
        <li>I shutdown node 2 instead of pausing</li>
        <li>I started node 1</li>
        <li>I paused node 1</li>
        <li>Started node 2</li>
        <li>Paused node 2</li>
        <li>Started node 1</li>
      </ol>
      <p>So sanlock is preventing both from running concurrently, but it
        seems to contradict your statement: <br>
        "Even if you now pause the VM on node 2, and try to resume node
        1,
        sanlock will still prevent node 1 from running again. It tracks
        a lock "version" number. The key is that once the original VM
        is paused, if any other VM runs on that disk, the orignal VM is
        never allowed to be unpaused again."<br>
      </p>
      <p>Am I mistaken?<br>
      </p>
      <p>Thanks,<br>
        Michael<br>
      </p>
      <br>
      On 1/31/2013 9:44 AM, Daniel P. Berrange wrote:<br>
    </div>
    <blockquote cite="mid:20130131174446.GV23534@redhat.com" type="cite">
      <pre wrap="">On Thu, Jan 31, 2013 at 09:34:47AM -0800, Michael Rodrigues wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello,

I'm using libvirt and sanlock on qemu-kvm guests. Each guest has
it's own Logical Volume for it's root filesystem. Sanlock is
configured and working and prevents me from starting the same VM
twice on multiple nodes and corrupting it's root filesystem. Each
VM's domain XML resides on 2 servers that share the LVM volume group
over fiber channel.

In testing, I noticed that if I pause a VM on node 1, the sanlock
lock is relinquished, and I am able to start the same VM, using the
same root filesystem, on node 2. I get a lock error when unpausing
node 1's VM if node 2's copy is still running, but by this point,
the disk may already be corrupted.
</pre>
      </blockquote>
      <pre wrap="">
The disk isn't corrupted - preventing node 1 VM from un-pausing
is explicitly what is preventing the disk from becoming corrupted.

Even if you now pause the VM on node 2, and try to resume node 1,
sanlock will still prevent node 1 from running again. It tracks
a lock "version" number. The key is that once the original VM
is paused, if any other VM runs on that disk, the orignal VM is
never allowed to be unpaused again.

</pre>
      <blockquote type="cite">
        <pre wrap="">Is it necessary that paused VMs don't get to keep their locks? Is
there a way to configure sanlock to lock when a VM is paused?
</pre>
      </blockquote>
      <pre wrap="">
No, it isn't something that's configurable - this behaviour is
required in order todo migration for example.

Regards,
Daniel
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Michael Rodrigues
Interim Help Desk Manager
Gevirtz Graduate School of Education
Education Building 4203
(805) 893-8031
<a class="moz-txt-link-abbreviated" href="mailto:help@education.ucsb.edu">help@education.ucsb.edu</a></pre>
  </body>
</html>