Bug 1613855

Summary: [RFE] Display space savings when a VDO volume is used.
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Sahina Bose <sabose>
Component: rhhiAssignee: Sahina Bose <sabose>
Status: CLOSED ERRATA QA Contact: bipin <bshetty>
Severity: medium Docs Contact:
Priority: high    
Version: rhhiv-1.5CC: bshetty, bugs, dchaplyg, dkeefe, rhs-bugs, sabose, sankarshan, sasundar, seamurph
Target Milestone: ---Keywords: FutureFeature, Regression
Target Release: RHHI-V 1.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
The space saved by using Virtual Disk Optimization is displayed on the Brick and Volume detail pages of the Cockpit UI.
Story Points: ---
Clone Of: 1590967 Environment:
Last Closed: 2018-11-08 05:39:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Gluster RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1590967    
Bug Blocks: 1520833, 1548985    
Attachments:
Description Flags
Verified_UI_Screenshot_Space_Savings none

Description Sahina Bose 2018-08-08 12:25:09 UTC
+++ This bug was initially created as a clone of Bug #1590967 +++

Description of problem:

When a VDO volume is used as a storage domain, the user needs to be presented with the space savings that he/she is getting

Version-Release number of selected component (if applicable):
4.2

How reproducible:
NA

Additional info:
Space savings should be presented at the brick level as well as the gluster volume/storage domain level

--- Additional comment from Denis Chaplygin on 2018-06-14 04:30:17 EDT ---

What should we do in case same VDO volume is used for several storage domains?

What information should we provide in case of (multiple) vdo-thinp layers?

--- Additional comment from Sahina Bose on 2018-06-15 14:22:46 EDT ---

(In reply to Denis Chaplygin from comment #1)
> What should we do in case same VDO volume is used for several storage
> domains?
> 

I think the same space saving can be reported.

> What information should we provide in case of (multiple) vdo-thinp layers?

Adding Dennis for inputs.

--- Additional comment from Dennis Keefe on 2018-06-15 14:39 EDT ---



--- Additional comment from Dennis Keefe on 2018-06-15 18:18:41 EDT ---

Savings for 2.0
Cockpit will display the VDO savings per node. See attachment.

Savings for 2.0+
Storage Domain

Each storage domain should display the storage savings by averaging each
VDO's volume savings on each gluster's volume bricks.

example:
the brick for vmstore on host-rhhi1 (/dev/sdb)
has space savings of 49% (vdo command: vdostats --hum)

the brick for vmstore on host-rhhi2 (/dev/sdb)
has space savings of 57%

the brick for vmstore on host-rhhi3 (/dev/sdb)
has space savings of 87%

(49+57+87)/3 = 64% space savings

64% space savings should be displayed for the storage domain after "Guaranteed Free Space" and before "Description" 
--------------------------------

Savings for 2.0+
Dashboard

The Dashboard could show the savings either in the storage "circle" as part of the ring or just as text in the center of the 
ring.  I would normally say that the savings would be green, but that is used already, so blue might work.  The savings 
here should report the savings for the cluster not just per storage domain.  

The stats can come from either VDO manager by using "vdostats --verbose" 
Command: vdostats --verbose|egrep "logical blocks used|physical blocks used"

  data blocks used                    : 17275885
  logical blocks used                 : 33712693

Or from sysfs

Sysfs does not hold a percent savings, which means you have to calculate it yourself.
 
1. capture the output of /sys/kvdo/<vdo volume name>/statistics/{logical_blocks_used|physical_blocks_used}
2. add the physical blocks used for all volumes in the cluster together
3. add the logical blocks used for all volumes in the cluster together 
4. subtract the total logical blocks used by total physical blocks used (this is the total number of blocks saved by VDO)
5. then divide the total saved blocks by the total logical blocks, multiplied by 100 to get the savings percent


ls /sys/kvdo/vdo_sdb/statistics/|egrep "logical blocks used|physical blocks used"
logical_blocks_used
data_blocks_used

cat $(ls -d /sys/kvdo/*/statistics/*|egrep "logical_blocks_used|data_blocks_used")
33712680
17275871

Math
33712680 - 17275871 = 16436059  (saved blocks)
16436059 / 33712680 = 0.4875 *100 = 48% (savings percentage)
0.4875 *100 = 48%

Comment 4 Dennis Keefe 2018-08-28 17:37:45 UTC
Without discards there will be no accuracy.  Discards is needed to report accurate space used and space savings.

Comment 6 Sahina Bose 2018-10-17 11:50:25 UTC
Please provide doc_text

Comment 7 bipin 2018-10-22 11:53:13 UTC
Tested the bug on rhvm-4.2.7.4. The fix seems to be working as expected.
The space savings is reflecting in the RHV-M corresponding to the CLI output.


[root@rhsqa-abc ~]# vdostats --human-readable
Device                    Size      Used Available Use% Space saving%
/dev/mapper/vdo_sdc     223.1G     60.0G    163.0G  26%           62%
/dev/mapper/vdo_sdd     931.0G      4.2G    926.8G   0%           77%


Attaching the screenshot of the RHV-M

Comment 8 bipin 2018-10-22 11:53:53 UTC
Created attachment 1496373 [details]
Verified_UI_Screenshot_Space_Savings

Comment 9 SATHEESARAN 2018-10-24 09:07:39 UTC
The dependent bug https://bugzilla.redhat.com/show_bug.cgi?id=1590967#c13 has undergone a phase change, where the bug was reopened. Reflecting the status on this bug too

Comment 12 errata-xmlrpc 2018-11-08 05:39:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3523