make show-disk-free and pool-statistics actions more readable

Bug #2026252 reported by Natalia Litvinova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph Monitor Charm
New
Undecided
Unassigned

Bug Description

Currently both actions show-disk-free and pool-statistics return a shifted output that is hard to read:

$ juju run ceph-mon/leader show-disk-free
Running operation 13 with 1 task
  - task 14 on unit-ceph-mon-2

Waiting for task 14...
message: "ID CLASS WEIGHT REWEIGHT SIZE RAW USE DATA OMAP META AVAIL
  \ %USE VAR PGS STATUS TYPE NAME \n -1 0.09357 -
  \ 96 GiB 929 MiB 11 MiB 0 B 918 MiB 95 GiB 0.94 1.00 - root
  default \n-12 0.03119 - 32 GiB 307 MiB 3.7 MiB
  \ 0 B 303 MiB 32 GiB 0.94 0.99 - rack us-east-1c \n-11
  \ 0.03119 - 32 GiB 307 MiB 3.7 MiB 0 B 303 MiB 32 GiB 0.94
  \ 0.99 - host ip-172-31-36-226\n 2 ssd 0.03119 1.00000
  \ 32 GiB 307 MiB 3.7 MiB 0 B 303 MiB 32 GiB 0.94 0.99 153 up osd.2
  \ \n -8 0.03119 - 32 GiB 311 MiB 3.7 MiB 0 B 307
  MiB 32 GiB 0.95 1.00 - rack us-east-1e \n -7 0.03119
  \ - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - host
  ip-172-31-63-78 \n 1 ssd 0.03119 1.00000 32 GiB 311 MiB 3.7 MiB 0 B
  \ 307 MiB 32 GiB 0.95 1.00 153 up osd.1 \n -4 0.03119
  \ - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - rack
  us-east-1f \n -3 0.03119 - 32 GiB 311 MiB 3.7 MiB 0
  B 307 MiB 32 GiB 0.95 1.00 - host ip-172-31-79-73 \n 0
  \ ssd 0.03119 1.00000 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95
  \ 1.00 153 up osd.0 \n TOTAL
  \ 96 GiB 929 MiB 11 MiB 0 B 918 MiB 95 GiB 0.94 \nMIN/MAX
  VAR: 0.99/1.00 STDDEV: 0.01\n"

$ juju run ceph-mon/leader pool-statistics
Running operation 15 with 1 task
  - task 16 on unit-ceph-mon-2

Waiting for task 16...
message: "--- RAW STORAGE ---\nCLASS SIZE AVAIL USED RAW USED %RAW USED\nssd
  \ 96 GiB 95 GiB 929 MiB 929 MiB 0.94\nTOTAL 96 GiB 95 GiB 929 MiB
  \ 929 MiB 0.94\n \n--- POOLS ---\nPOOL ID PGS STORED
  \ OBJECTS USED %USED MAX AVAIL\n.mgr 1 1 449 KiB
  \ 2 1.3 MiB 0 30 GiB\ndefault.rgw.buckets.data 2 64 0
  B 0 0 B 0 30 GiB\ndefault.rgw.control 3 2 0
  B 8 0 B 0 30 GiB\ndefault.rgw.data.root 4 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.gc 5 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.log 6 2 3.6 KiB
  \ 209 408 KiB 0 30 GiB\ndefault.rgw.intent-log 7 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.meta 8 2 1.2 KiB
  \ 10 84 KiB 0 30 GiB\ndefault.rgw.otp 9 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.usage 10 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.users.keys 11 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.users.email 12 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.users.swift 13 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.users.uid 14 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.buckets.extra 15 2 0
  B 0 0 B 0 30 GiB\ndefault.rgw.buckets.index 16 4 0
  B 0 0 B 0 30 GiB\n.rgw.root 17 2 1.3 KiB
  \ 4 48 KiB 0 30 GiB\nceph-nfs 18 4 20
  B 4 24 KiB 0 30 GiB\nceph-fs_data 19 4 0
  B 0 0 B 0 30 GiB\nceph-fs_metadata 20 16 12 KiB
  \ 22 120 KiB 0 30 GiB\ntest 21 32 133
  B 5 36 KiB 0 30 GiB\n"

If the message part will be removed from the output, it will make some difference:
https://github.com/openstack/charm-ceph-mon/blob/master/actions/show_disk_free.py#L26
https://github.com/openstack/charm-ceph-mon/blob/master/actions/pool_statistics.py#L24

More difference will appear if the line break can be removed from the charm output and the output becomes like the result of this command (this is on juju 3.1.5):
$ juju exec --unit ceph-mon/0 "sudo ceph osd df tree"
ID CLASS WEIGHT REWEIGHT SIZE RAW USE DATA OMAP META AVAIL %USE VAR PGS STATUS TYPE NAME
 -1 0.09357 - 96 GiB 929 MiB 11 MiB 0 B 918 MiB 95 GiB 0.94 1.00 - root default
-12 0.03119 - 32 GiB 307 MiB 3.7 MiB 0 B 303 MiB 32 GiB 0.94 0.99 - rack us-east-1c
-11 0.03119 - 32 GiB 307 MiB 3.7 MiB 0 B 303 MiB 32 GiB 0.94 0.99 - host ip-172-31-36-226
  2 ssd 0.03119 1.00000 32 GiB 307 MiB 3.7 MiB 0 B 303 MiB 32 GiB 0.94 0.99 153 up osd.2
 -8 0.03119 - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - rack us-east-1e
 -7 0.03119 - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - host ip-172-31-63-78
  1 ssd 0.03119 1.00000 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 153 up osd.1
 -4 0.03119 - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - rack us-east-1f
 -3 0.03119 - 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 - host ip-172-31-79-73
  0 ssd 0.03119 1.00000 32 GiB 311 MiB 3.7 MiB 0 B 307 MiB 32 GiB 0.95 1.00 153 up osd.0
                        TOTAL 96 GiB 929 MiB 11 MiB 0 B 918 MiB 95 GiB 0.94
MIN/MAX VAR: 0.99/1.00 STDDEV: 0.01

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.