Using LVM, I need to have some logical volumes which are fully-allocated (reserved space) and others which are thin-provisioned. My challenge is that the balance between them will shift dynamically. How can this be achieved?
For example, I might want 20% of the VG to be fully-provisioned LVs and the remaining 80% allocated to a thin pool. But this balance might change to 40/60, and the thin pool cannot shrink from 80% to 60% after it is created.
It seems the only answer is to allocate 100% of the VG to the thin pool. Then either
- Fully-allocate some LVs inside the thin pool. I found a comment that this was "planned", but couldn't find references on how to do it.
- Create two LVs inside the thin pool with the appropriate split (e.g. 20/80), use
btrfs
on the 80% and apply quotas to subvolumes. This seems the most concrete option. - Use nested/stacked LVs, e.g. thin volumes are nested inside the 80% LV. I found an older document from RedHat about LVM stacking but it isn't clear to me whether this can be done with thin-provisioned LVs and there's no examples.
Can anyone explain how to achieve the goal? It doesn't have to be one of the above approaches (that's just my background investigation), could be something else I haven't considered.