Open dustymabe opened 7 years ago
Hmm.., looks like lvconvert
failed. And I suspect that it failed because it requires some free space (spare space) for thin pool. And as volume group is already full consumed, there is no free space, so lvconvert fails.
So short answer, is no, 100% data space will not work. Try 90% and that should work.
For more information do "man lvmthin" and look at section Spare metadata LV
Should d-s-s fail if the user specified 100%. And do we need to update docs.
TBH I would think the underlying lvm tools could accept 100%FREE
and be smart enough to figure out what to do. If it is creating the metadata LV and thin pool LV at the same time then it could easily adjust and make it so that size(metadata_lv) + size(thinpool_lv) == 100%FREE
That works also if we can figure this out. But the bottom line is we don't let the user end up in the state that you got into.
problem is lvm determines internally size of spare lv at lvconvert time. So it does not tell us in advance what should be size of spare logical volume.
If we don't want lvm internal magic, then we could think of creating spare logical volume ourselves and pass it to lvm during lvm convert time (The way we do for metadata lv).
So we will first create metadata lv, then spare lv and then rest of the free space is used for data lv and then we call lvconvert.
Issue here is what should be the size of spare lv. It is not clear to me. I will check with lvm folks and see if they have guidelines on how to select size of spare lv.
May be there is no way to pass in spare volume to lvconvert. Atleast I don't get that sense from reading man lvmthin
After a long discussion on IRC with zkabelac and vgoyal we now understand the problem more clearly:
In d-s-s we are creating the metalv and datalv separately and then converting them into a thinpool. Something like this from the lvthin
man page:
# lvcreate -n pool0 -L 10G vg
# lvcreate -n pool0meta -L 1G vg
# lvconvert --type thin-pool --poolmetadata vg/pool0meta vg/pool0
The problem is that the lvconvert
operation tries to create a small spare metadata LV which will fail if you specify 100%FREE to one of the earlier operations. This is not an issue if you just create the thin pool directly with lvcreate
rather than trying to set it all up manually.
@rhvgoyal and I propose that we start just passing in the size directly to lvcreate --thin
and have LVM manage the metadata size and the interpretation of the -l 100%FREE
.
On Fedora 25 atomic host I'm able to get errors from docker storage setup if I specify to use all free space in the VG.
I end up with a half set up system: