Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Fs usage should filter to all known fs #2421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fs usage should filter to all known fs #2421

wants to merge 2 commits into from

Conversation

johnsonw
Copy link
Contributor

@johnsonw johnsonw commented Dec 8, 2020

When fetching data on FS usage, we should filter to only the known filesystems

Signed-off-by: johnsonw [email protected]


This change is Reviewable

When fetching data on FS usage, we should filter to only the known filesystems

Signed-off-by: johnsonw <[email protected]>
@johnsonw johnsonw self-assigned this Dec 8, 2020
Signed-off-by: johnsonw <[email protected]>
@johnsonw
Copy link
Contributor Author

johnsonw commented Dec 9, 2020

image

The query being sent to influx:

SELECT SUM(bytes_total) as bytes_total, SUM(bytes_free) as bytes_free, SUM("bytes_avail") as bytes_avail FROM (    SELECT LAST("bytes_total") AS bytes_total,    LAST("bytes_free") as bytes_free,    LAST("bytes_avail") as bytes_avail    FROM "target" WHERE "kind" = 'OST' AND "fs" =~ /fs2|fs/ GROUP BY target    )

Notice the where clause requires that a filesystem be specified for the OST.

Filesystem data:

[root@mds1 ~]# lfs df -h
UUID                       bytes        Used   Available Use% Mounted on
fs-MDT0000_UUID             2.8G        2.1M      288.8M   1% /mnt/fs[MDT:0]
fs-MDT0001_UUID             2.8G        2.0M      288.9M   1% /mnt/fs[MDT:1]
fs-OST0000_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:0]
fs-OST0001_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:1]
fs-OST0002_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:2]
fs-OST0003_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:3]
fs-OST0004_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:4]
fs-OST0005_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:5]
fs-OST0006_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:6]
fs-OST0007_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:7]
fs-OST0008_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:8]
fs-OST0009_UUID             4.6G       21.5M        3.9G   1% /mnt/fs[OST:9]

filesystem_summary:        45.8G      214.6M       38.8G   1% /mnt/fs

UUID                       bytes        Used   Available Use% Mounted on
fs2-MDT0000_UUID            2.8G        1.9M        2.5G   1% /mnt/fs2[MDT:0]
fs2-OST0000_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:0]
fs2-OST0001_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:1]
fs2-OST0002_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:2]
fs2-OST0003_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:3]
fs2-OST0004_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:4]
fs2-OST0005_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:5]
fs2-OST0006_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:6]
fs2-OST0007_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:7]
fs2-OST0008_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:8]
fs2-OST0009_UUID            4.6G        1.2M        4.3G   1% /mnt/fs2[OST:9]

filesystem_summary:        45.8G       12.3M       43.1G   1% /mnt/fs2

214.6MB + 12.3MB = 226.9MB, which matches what's in the chart.

I also have two snapshots mounted:

[root@mds1 ~]# mount -t lustre
/dev/mapper/mpatha on /mnt/mgs type lustre (ro,svname=MGS,nosvc,mgs,osd=osd-ldiskfs,user_xattr,errors=remount-ro,data=ordered)
/dev/mapper/mpathb on /mnt/mdt0 type lustre (ro,svname=fs-MDT0000,mgsnode=10.73.20.11@tcp:10.73.20.12@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro,data=ordered)
10.73.20.11@tcp:10.73.20.12@tcp:/fs on /mnt/fs type lustre (rw,flock,lazystatfs)
10.73.20.11@tcp:10.73.20.12@tcp:/fs2 on /mnt/fs2 type lustre (rw,flock,lazystatfs)
/dev/loop0 on /mnt/test2_MDT0000 type lustre (ro,svname=11c6255d-MDT0000,nomgs,rdonly_dev,mgsnode=10.73.20.11@tcp:10.73.20.12@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro,data=ordered,noload)
/dev/loop2 on /mnt/test1_MDT0000 type lustre (ro,svname=07310bad-MDT0000,nomgs,rdonly_dev,mgsnode=10.73.20.11@tcp:10.73.20.12@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro,data=ordered,noload)

[root@adm ~]# iml snapshot list fs
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs         | test1    | Tue, 08 Dec 2020 10:14:49 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+
| fs         | test2    | Tue, 08 Dec 2020 10:42:15 +0000 | mounted |         |
+------------+----------+---------------------------------+---------+---------+

@johnsonw
Copy link
Contributor Author

Copy link
Member

@jgrund jgrund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs to be moved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants