How to create a default storage pool on LVM?

The expected

lxc storage create default lvm lvm.thinpool_name=lvdata lvm.vg_name=vghdd lvm.use_thinpool=true

fails with the

Error: LXD already uses volume group "vghdd" for pool "default"

while LXD certainly does not use it - it’s a new LXD installation and

lxd sql "select * from storage_pools_config"

certainly returns nothing.

vghdd volume group exists, lvdata thinpool exists. lvdata is not empty - there are couple volumes created there already, but it was not a problem for lxd v2.x

From the other hand, if I specify the non existing thinpool name:

# lxc storage create default lvm lvm.vg_name=vghdd lvm.thinpool_name=lvlxd lvm.use_thinpool=true
Error: volume group "vghdd" is not empty

What am I doing wrong?

Going to track this down in the github issue you filed.

And to answer my own question:

thanks to the project maintainers I could find that the original command is “wrong”

The correct one should use source as a volume group name.

lxc storage create pool1 lvm source=<vg_name> lvm.thinpool_name=<thinpool_name>