linstor-server
linstor-server copied to clipboard
LINSTOR should invoke LVM volumes activation
This problem related to piraeus, but I think it's correct way to solve it on linstor-server level:
When running linstor-satellite in a container, it depends on LVM configuration from a host. But host might have no all required packages installed. Eg. LVMthin activation might require thin-provisioning-tools, which are always persist in a container:
# lvchange -ay linstor_data/thindata
/usr/sbin/thin_check: execvp failed: No such file or directory
WARNING: Check is skipped, please install recommended missing binary /usr/sbin/thin_check!
root@hf-kubevirt-03:/# linstor sp l
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
┊ StoragePool ┊ Node ┊ Driver ┊ PoolName ┊ FreeCapacity ┊ TotalCapacity ┊ CanSnapshots ┊ State ┊ SharedName ┊
╞═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
┊ DfltDisklessStorPool ┊ hf-kubevirt-01 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ DfltDisklessStorPool ┊ hf-kubevirt-02 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ DfltDisklessStorPool ┊ hf-kubevirt-03 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-01 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-02 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-03 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-01 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 1.80 TiB ┊ 1.80 TiB ┊ True ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-02 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 1.80 TiB ┊ 1.80 TiB ┊ True ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-03 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 0 KiB ┊ 0 KiB ┊ True ┊ Error ┊ ┊
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ERROR:
Description:
Node: 'hf-kubevirt-03', storage pool: 'ssd-lvmthin' - Failed to query free space from storage pool
Cause:
Unable to parse free thin sizes
but after manual activation from the container, it works perfectly:
root@hf-kubevirt-03:/# lvchange -ay linstor_data/thindata
root@hf-kubevirt-03:/# linstor sp l
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
┊ StoragePool ┊ Node ┊ Driver ┊ PoolName ┊ FreeCapacity ┊ TotalCapacity ┊ CanSnapshots ┊ State ┊ SharedName ┊
╞═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
┊ DfltDisklessStorPool ┊ hf-kubevirt-01 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ DfltDisklessStorPool ┊ hf-kubevirt-02 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ DfltDisklessStorPool ┊ hf-kubevirt-03 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-01 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-02 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvm ┊ hf-kubevirt-03 ┊ LVM ┊ linstor_data ┊ 1.69 TiB ┊ 3.49 TiB ┊ False ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-01 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 1.80 TiB ┊ 1.80 TiB ┊ True ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-02 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 1.80 TiB ┊ 1.80 TiB ┊ True ┊ Ok ┊ ┊
┊ ssd-lvmthin ┊ hf-kubevirt-03 ┊ LVM_THIN ┊ linstor_data/thindata ┊ 1.80 TiB ┊ 1.80 TiB ┊ True ┊ Ok ┊ ┊
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/cc @WanzenBug
When running linstor-satellite in a container, it depends on LVM configuration from a host
Not true, at least for stuff managed by piraeus. We use a separate LVM config (and don't bind mount /etc/lvm/ from the host) by default. Relevant line in the dockerfiles:
- https://github.com/LINBIT/linstor-server/blob/master/Dockerfile.satellite#L102
- https://github.com/piraeusdatastore/piraeus/blob/master/dockerfiles/piraeus-server/Dockerfile#L60
@WanzenBug but none of both piraeus and linstor-server does not handle LVM volumes activation?
I mean that case when I was needed to run lvchange -ay manually from the container with linstor-satellite to activate LVMThin pools
So the issue is because of the missing thin tools the thinpool LV is never activated, which means LINSTOR also can't use it?
So a simple solution would be that the satellite runs lvchange -ay on the thinpool LV on startup?
Thin tools are missing on a host, but not in a container.
I think running lvchange -ay for all existing LV is wrong, those volumes might not be managed by linstor.
Linstor should handle only volumes managed by linstor.
Thus I think that best way would be to invoke the following by linstor-satellite on startup:
vgchange -ay <vg>for LVM storage poolslvchange -ay <vg/lv>for LVMThin storage pools
Just hit this issue myself in my test environment :facepalm:
@ghernadi opinion on adding activation commands when a satellite starts/a new storage pool is added?
Since Linstor already activates LVs, I don't see too many reasons to not also activate the pools themselves. Maybe we should figure out how to avoid checking the pool state on every single LV operation, since (I hope) we should assume that a pool stays active while Linstor is running. If not, the admin is working against us where it gets questionable if Linstor should fight back or not... I tend to not fighting back even if that means to generate a few error reports...
One of the issues here in particular is that an inactive thinpool does not report the free percentage, which is actually what trips up LINSTOR I believe