All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Damon Wang <damon.devops@gmail.com>
Cc: linux-lvm@redhat.com
Subject: Re: [linux-lvm] [lvmlockd] Refresh lvmlockd leases after sanlock changes
Date: Mon, 5 Mar 2018 10:59:27 -0600	[thread overview]
Message-ID: <20180305165926.GA20527@redhat.com> (raw)
In-Reply-To: <CABZYMH73Z+u05HrsqaOGighaav0Rb4TT4ttDmiB8Z6x1Xz20nA@mail.gmail.com>

On Mon, Mar 05, 2018 at 04:37:58PM +0800, Damon Wang wrote:
> to SAN and provide a lun as lvm pv. Each vm gets a thin lv from lvm as root
> volume, and maybe some other thin lvs as data volume. So lvmlockd will
> assurance only one host will change metadata at same time, and lvmthin will
> provide thin provision.

thin lv's from the same thin pool cannot be used from different hosts
concurrently.  It's not because of lvm metadata, it's because of the way
dm-thin manages blocks that are shared between thin lvs.  This block
sharing/unsharing occurs as each read/write happens on the block device,
not on LV activation or any lvm command.

lvmlockd uses locks on the thin pool to enforce the dm-thin limitations.
If you manually remove the locks, you'll get a corrupted thin pool.

> But if want to live migrate the vm, it could be difficult since thin lv can
> only be exclusive active on one host, if you want to active on another
> host, the only way I find is use sanlock to release it manually. If you
> have a better way, please tell me and thanks a loooot !!!

I suggest trying https://ovirt.org

You need to release the lock on the source host after the vm is suspended,
and acquire the lock on the destination host before the vm is resumed.
There are hooks in libvirt to do this.  The LV shouldn't be active on both
hosts at once.  

Dave

  reply	other threads:[~2018-03-05 16:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05  8:37 [linux-lvm] [lvmlockd] Refresh lvmlockd leases after sanlock changes Damon Wang
2018-03-05 16:59 ` David Teigland [this message]
2018-03-07  5:50   ` Damon Wang
2018-03-07  7:11     ` Damon Wang
2018-03-07  8:14   ` Damon Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180305165926.GA20527@redhat.com \
    --to=teigland@redhat.com \
    --cc=damon.devops@gmail.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.