[linux-lvm] add_lockspace done -19

Moshe Lazarov Moshe.Lazarov at axxana.com
Mon Oct 16 18:40:17 UTC 2017

The command "vgcreate --shared global /dev/sdb2" creates a VG that
eventually is REMOVED with an error:


                VG global init failed: invalid parameters for sanlock

                    Removing global-lvmlock (252:0)

                  Failed to initialize lock args for lock type sanlock

                    Removing physical volume "/dev/sdb2" from volume group

                  Volume group "global" successfully removed


>From _init_vg_sanlock()

                _lockd_result flags_str (null)

                lockd_result 0xffffff2c flags none lm none


Any ideas?









-----Original Message-----
From: David Teigland [mailto:teigland at redhat.com] 
Sent: Friday, October 13, 2017 7:41 AM
To: LVM general discussion and development <linux-lvm at redhat.com>
Cc: Moshe Lazarov <Moshe.Lazarov at axxana.com>
Subject: Re: [linux-lvm] add_lockspace done -19


On Thu, Oct 12, 2017 at 06:30:24PM +0000, Moshe Lazarov wrote:

> I am using the following script to create shared VGs using SANLOCK. 

> However, I keep getting an error when trying to add the lock space.


The lvmlockd man page you mention lists the steps you should follow under
"Initial set up", but the commands you have shown are nothing at all like
that.  Please follow these steps.  I'm copying from the man page and adding
some of the commands you have used:



1. choose a lock manager


You have chosen sanlock.


2. configure hosts to use lvmlockd


You must edit /etc/lvm/lvm.conf on all of your nodes, setting global {
locking_type = 1  use_lvmlockd = 1  use_lvmetad = 1 (this is optional)


Then edit /etc/lvm/lvmlocal.conf on all of your nodes, setting local {
host_id = 1  (on the first host)  or  host_id = 2  (on the second host)  etc


3. start lvmlockd


# lvmlockd


4. start lock manager


# systemctl start sanlock


5. create VG on shared devices


I get the impression that you would like to create a special, small VG on

sdb2 to hold the sanlock global lock, and then a general purpose VG on sdc1.
To do that:


# vgcreate --shared global /dev/sdb2


# vgcreate --shared vg1 /dev/sdc1


(You are not required to create the special small VG for the global lock.

If you want to use a single general purpose VG, you could just leave out the
first vgcreate.)


6. start VG on all hosts


# vgchange --lock-start


(run that on all your hosts; they should all start "global" and "vg1")


7. create and activate LVs


lvcreate -n slowlv -L 150G vg1 /dev/sdc1


Once that works, please let me know what part of the man page was not clear
to you.  Thanks



> #Lock VG & LV


> vgcreate --verbose --config global/use_lvmlockd=0 vglock /dev/sdb2


> lvcreate --config global/use_lvmlockd=0 -n locklv -L 10MB vglock


> sanlock direct init -s lsgl:1:/dev/vglock/locklv:0


> sanlock client add_lockspace -s lsgl:1:/dev/vglock/locklv:0


I'm curious what led you to believe that you should use commands like these?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20171016/75e07f29/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5524 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20171016/75e07f29/attachment.p7s>

More information about the linux-lvm mailing list