Bug 1497968

Summary: [RFE] rbd ls should support -h human format
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Tzach Shefi <tshefi>
Component: RBDAssignee: Jason Dillaman <jdillama>
Status: CLOSED ERRATA QA Contact: Parikshith <pbyregow>
Severity: medium Docs Contact: Bara Ancincova <bancinco>
Priority: unspecified    
Version: 3.0CC: ceph-eng-bugs, ceph-qe-bugs, hnallurv, jdillama, kdreyer, tserlin
Target Milestone: rcKeywords: FutureFeature
Target Release: 3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: ceph-12.2.8-3.el7cp Ubuntu: ceph_12.2.8-3redhat1 Doc Type: Enhancement
Doc Text:
.`rbd ls` now uses IEC units The `rbd ls` command now uses International Electrotechnical Commission (IEC) units to display image sizes.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-03 19:01:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1629656    

Description Tzach Shefi 2017-10-03 09:07:17 UTC
Description of problem: 
Not a bug but a minor RFE, add human size format option to rbd ls command.
As current inhuman bytes is less friendly for us lazy folk. 

Version-Release number of selected component (if applicable):
ceph version 10.2.7-32.el7cp
Not sure what^ translates to 2.X

How reproducible:
Every time

Steps to Reproduce:
1.  rbd -p [pool] ls -l
2.  Look at size, oh the h command format option is missing here 
3.  Google convert to M/G/T.

Actual results:

# rbd -p [pool] ls -l
NAME                                        SIZE PARENT FMT PROT LOCK 
007c3e4c-e584-48e6-a7fb-fcb07b663168      12957k          2           
007c3e4c-e584-48e6-a7fb-fcb07b663168@snap 12957k          2 yes  

Expected results:
Dunno maybe the good ol expected h
# rbd -p [pool] ls -lh  
NAME                                        SIZE PARENT FMT PROT LOCK 
007c3e4c-e584-48e6-a7fb-fcb07b663168      12M or what it rounds out to 12.6 13.      
..

Comment 3 Jason Dillaman 2018-10-22 20:37:47 UTC
Luminous received an improvement to display IEC units in v12.2.8. In the example above:

$ rbd create --size 12957K test
$ rbd ls -l
NAME SIZE   PARENT FMT PROT LOCK 
test 13 MiB          2

Comment 11 errata-xmlrpc 2019-01-03 19:01:20 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/RHBA-2019:0020