openebs / openebsctl

`openebsctl` is a kubectl plugin to manage OpenEBS storage components.
Apache License 2.0
29 stars 21 forks source link

Update cstor volume describe replica details heading to accurately specifiy underlying properties in an easy-to-grok way #135

Closed vharsh closed 2 years ago

vharsh commented 3 years ago

The term Total and Free aren't super indicative of the spaces used by actual data or snapshots or metadata or at the application level and it does pop eyeballs when Total < Free.

The Output

root@test-pcl4004:~# kubectl openebs describe volume pvc-7d5944e9-XXXXXXXXXXXX

pvc-7d5944e9-XXXXXXXXXXXX Details :
-----------------
NAME            : XXXXX
ACCESS MODE     : ReadWriteOnce
CSI DRIVER      : cstor.csi.openebs.io
STORAGE CLASS   : XXXX
VOLUME PHASE    : Bound
VERSION         : 2.10.0
CSPC            : XXXXXXXX
SIZE            : 2.0GiB
STATUS          : Healthy
REPLICA COUNT   : 1

Portal Details :
------------------
IQN              :  iqn.2016-09.com.openebs.cstor:XXXX
VOLUME NAME      :  XXXX
TARGET NODE NAME :  ABCD
PORTAL           :  XXXXX:3260
TARGET IP        :  XXXXX

Replica Details :
-----------------
NAME                                                            TOTAL     USED       STATUS    AGE
XXXXXXXXXXXXXXXXXXXXXXXXXSDJHFSHGHGHXXXXXXXXXXXXXXX-YYYYYYYZZZ   33.6MiB   126.8MiB   Healthy   67d1h

In the above output example, with the above headings it sort of becomes imperative that, Total = Free + Used, so in practice Used shouldn't exceed Total(unless Free is negative, which is absurd), but here the above values total means actual data written to disk & used means how much data got referenced.

At the nuts and bolts level, TOTAL comes from cvr.spec.capacity.Total which is USED property at the zfs level and used comes from cvr.spec.capacity.Used which is the logicalreferenced property at the zfs level.

Tl; dr: What needs to be done?

  1. The underlying ZFS metric needs to be understood well enough(this isn't super straightforward)
  2. The understanding of the above metric should be conveyed properly via simple English phrases/words, such as space used by data with compression, metadata, etc or something simple such as actual size on disk, logical size written by tenants, etc.