Bug 1342504

Summary: 2.0: crush_rule API: GET of crush rule lists some values as null for "steps"
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Harish NV Rao <hnallurv>
Component: CalamariAssignee: Christina Meno <gmeno>
Calamari sub component: Back-end QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Status: CLOSED NOTABUG Docs Contact: Bara Ancincova <bancinco>
Severity: medium    
Priority: unspecified CC: ceph-eng-bugs, gmeno, hnallurv
Version: 2.0   
Target Milestone: rc   
Target Release: 2.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.Calamari sometimes incorrectly outputs "null" as a value When the Calamari REST-based API is used to get details of a CRUSH rule in the Ceph cluster, the output contains "null" as a value for certain fields in the `steps` section of the CRUSH rule. The fields containing null values can be safely ignored for the respective steps in the CRUSH rule. However, do not use "null" as a value for any field when doing a PATCH operation. Using null values in such a case causes the operation to fail.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-04 18:21:48 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: 1322504, 1383917, 1412948    

Description Harish NV Rao 2016-06-03 11:56:11 UTC
Description of problem:
-----------------------

A GET of Crush rule lists some values as null for the "steps".
        "steps": [
            {
                "op": "take", 
                "type": null, 
                "num": null, 
                "item_name": "default", 
                "item": -1
            }, 
            {
                "op": "chooseleaf_firstn", 
                "type": "host", 
                "num": 0, 
                "item_name": null, 
                "item": null
            }, 
            {
                "op": "emit", 
                "type": null, 
                "num": null, 
                "item_name": null, 
                "item": null
            }

But the CLI the command " ceph osd crush rule dump" does not list that way. It lists as follows:

    "steps": [
        {
            "op": "take",
            "item": -1,
            "item_name": "default"
        },
        {
            "op": "chooseleaf_firstn",
            "num": 0,
            "type": "host"
        },
        {
            "op": "emit"
        }

Version-Release number of selected component (if applicable):
ceph version 10.2.1-7.el7cp (339d1fb5d73e5f113c8538a45e95b3777038da36)
calamari-server-1.4.0-0.10.rc13.el7cp.x86_64


How reproducible: always


Steps to Reproduce:
1. invoke https://<mon-ip>:8002/api/v2/cluster/<fs id>/crush_rule

Actual results:
Displays null for few values under "steps" section.

Expected results:
Should not display null values

Additional info:
The PATCH operation fails if we use null values

Comment 3 Christina Meno 2016-06-09 16:15:47 UTC
if you remove the values marked as null this will patch fine

Comment 8 Christina Meno 2016-07-13 16:08:28 UTC
I'll look at it today

Comment 9 Christina Meno 2016-08-17 16:35:23 UTC
Looks good