lvmteam / lvm2

Mirror of upstream LVM2 repository
https://gitlab.com/lvmteam/lvm2
GNU General Public License v2.0
134 stars 72 forks source link

Thin-pool #115

Closed cnckh closed 1 year ago

cnckh commented 1 year ago

LVM version: 2.03.14(2) (2021-10-20) Command Lin 1.vgcreate vgtest3 /dev/sdd 2.lvcreate -L 1G -T vgtest3/thin_pool 3.vcreate -V 20M -T vgtest3/thin_pool -n tp_lv_user1

I created thin-pool with shared devices on both hosts and created thin volumes on thin-poo However, using thin volumes cannot be activated on all hosts. host A 155b398906fbdf0ab2436fde61e9ba21

host B image

Activate thin volumes on host B 1.lvchange -ay vgtest3/tp_lv_us1 Thin pool vgtest3-thin_pool2-tpool (253:8) transaction_id is 1, while expected 5. Failed to activate successfully

Excuse me, so that the thin volume can be used on both hosts. The thin pool can only be used on a host A, and it fails to create or activate thin volumes on host B. how to solve this problem?

teigland commented 1 year ago

1.vgcreate vgtest3 /dev/sdd

To use lvm on shared storage, you need to create a shared VG: vgcreate --shared See https://man7.org/linux/man-pages/man8/lvmlockd.8.html

2.lvcreate -L 1G -T vgtest3/thin_pool

Even in a shared VG, you can only use a thin pool on one host at a time; what you are attempting is not possible.

zkabelac commented 1 year ago

Thin-pool can be only activate only on a single host - there is no support for shared activation on thins on multiple nodes. You could probably check Gluster or CEPH whether it may help you with your task. Thin-pool and all its thin volume must be activated on a single host - other type of activation is not supported.