get_osd_tree incorrectly parsing of ceph tree

Bug #1918721 reported by Robert Gildein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charms.ceph
Fix Released
Undecided
Robert Gildein

Bug Description

The function get_osd_tree are incorrectly parses data from the
`ceph osd tree --fromat=json` output.

The function searches for host with type==host, but wrongly assumes
that it's contains information about root/rack/row etc.

Sample of current information, where it can be seen that they do not
contain any information about the parents.
```bash
{
  "id": -5,
  "name": "juju-1ea5b4-bug1911006-0",
  "type": "host",
  "type_id": 1,
  "pool_weights": {},
  "children": [1]
}
```

This results in the CrushLocation object being created with the correct
name and id, but the other information is empty.

String representation of Crush Location from example above.
```bash
name: juju-1ea5b4-bug1911006-0 id: -5 host: None rack: None row: None datacenter: None chassis :None root: None
```

Changed in charm-ceph-osd:
status: New → In Progress
assignee: nobody → Robert Gildein (rgildein)
Revision history for this message
Robert Gildein (rgildein) wrote :
affects: charm-ceph-osd → charms.ceph
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charms.ceph (master)

Reviewed: https://review.opendev.org/c/openstack/charms.ceph/+/780280
Committed: https://opendev.org/openstack/charms.ceph/commit/5a6fbb88fd7e5bc444957c48263a1ee92bf80d2d
Submitter: "Zuul (22348)"
Branch: master

commit 5a6fbb88fd7e5bc444957c48263a1ee92bf80d2d
Author: Robert Gildein <email address hidden>
Date: Fri Mar 12 16:20:43 2021 +0100

    Fix parsing information from ceph tree output

    Add helper functions to parse information from the ceph tree and
    fix creating CrushLocation object in get_osd_tree function.

    Closes-Bug: #1918721
    Change-Id: I59c742e594042ad527e71c88404999459f0373c2

Changed in charms.ceph:
status: In Progress → Fix Released
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.