From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20180305165926.GA20527@redhat.com> References: <20180305165926.GA20527@redhat.com> From: Damon Wang Date: Wed, 7 Mar 2018 13:50:24 +0800 Message-ID: Content-Type: multipart/alternative; boundary="94eb2c070628b2bb6a0566cc22e2" Subject: Re: [linux-lvm] [lvmlockd] Refresh lvmlockd leases after sanlock changes Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: David Teigland Cc: linux-lvm@redhat.com --94eb2c070628b2bb6a0566cc22e2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dave, Thank you for your reply! > 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. > My plan is one vm has one thin lv as root volume, and each thin lv get its own thin lv pool, Is this a way to avoid the problem of block share within thin lv pool? I suggest trying https://ovirt.org I did some research on ovirt, there are two designs now (https://github.com/oVirt/vdsm/blob/master/doc/thin-provisioning.md) and I found it really relies on SPM host, once SPM host fails, all vms' availability will be influenced, which is we don't want to see. > 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 bot= h > hosts at once. > I did some experiments on this since I have read the libvirt migrate hook page (https://libvirt.org/hooks.html#qemu_migration) and it seems useless. I wrote a simple script and confirm that the hook execute process is: 1. on dest host, do "migrate begin", "prepare begin", "start begin", "started begin" 2. after a while (usually a few seconds), on source host, do "stopped end" and "release end" In a word, it not provide a way to do some thing on the time of vm suspend and resume.=F0=9F=99=81 Thanks! Damon --94eb2c070628b2bb6a0566cc22e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave,

Thank you for your reply!
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

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

My plan is one vm has one thin lv as root volume, and each thin lv get it= s own
thin lv pool, Is this a way to avoid the problem of block s= hare within thin lv pool?

I suggest trying https://ovirt.org

I did some research on ovirt, there are two designs now
and I found it really relies on SPM host, once SPM host fails, = all vms'=C2=A0availability
= will be influenced, which is we don't want to see.=C2=A0
=C2= =A0
You need to release the lock on the source host after the vm is suspended,<= br> and acquire the lock on the destination host before the vm is resumed.
There are hooks in libvirt to do this.=C2=A0 The LV shouldn't be active= on both
hosts at once.

=C2=A0I did some experim= ents on this since I have read the libvirt migrate hook page=C2=A0
(https://libvir= t.org/hooks.html#qemu_migration) and it seems useless.
I wrot= e a simple script and confirm that the hook execute process is:
<= ol>
  • on dest host, do "migrate begin", "prepare begin"= ;, "start begin", "started begin"
  • after a while= (usually a few seconds), on source host, do "stopped end" and "release end"
  • In a word, it not provide a way to = do some thing on the time of vm suspend and resume.=F0=9F=99=81
    =

    Thanks!

    Damon
    --94eb2c070628b2bb6a0566cc22e2--