Incorrect documentation for property volume_type suggest name is volumes_type

Bug #1666621 reported by Fredrik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python client library for Sahara
Incomplete
Undecided
Unassigned

Bug Description

Both the help in the openstack client and web pages states that the property name for specifying a volume type is "volumes_type" and not "volume_type".

# openstack dataprocessing node group template create --help
  --volumes-type <volumes-type>
                        Type of the volumes. This parameter will be taken into
                        account only if volumes-per-node is set and non-zero

Using: "volumes_type": "my-cinder",

# openstack dataprocessing node group template create --json worker.json
create() got an unexpected keyword argument 'volumes_type'

Changing to: "volume_type": "my-cinder",

# openstack dataprocessing node group template create --json worker.json
Volume type 'my-cinder' not found

This document has 6 occurrences of the same typo.
https://docs.openstack.org/developer/python-saharaclient/cli.html

Revision history for this message
Vitalii Gridnev (vgridnev) wrote :

This document is auto-generated. So, volumes_type parameter exists, and it will be taken into account if volumes-per-node is present. Otherwise there is no sense to set that up.

Changed in sahara:
status: New → Incomplete
Revision history for this message
Fredrik (fredrik-tarnell) wrote :

The example was abbreviated.
I am setting up volumes for my worker nodes.

[root@openstack sahara-templates]# cat worker.json
{
    "plugin_name": "ambari",
    "hadoop_version": "2.4",
    "node_processes": [
        "DataNode",
        "NodeManager"
    ],
    "name": "ambari-worker",
    "floating_ip_pool": "6ae019fe-5670-4a4d-bd00-16b9e5d1ad3c",
    "flavor_id": "a7a473b7-8e42-4b9b-a763-c95197ad0a50",
    "volumes_per_node": 4,
    "volumes_size": 1,
    "volume_local_to_instance": true,
    "volume_mount_prefix": "/volumes/disk",
    "use_autoconfig": true,
    "auto_security_group": true,
    "is_public": true,
    "is_protected": false
}

I think you might have missed that small detail "s".
volumes_type should be volume_type with out the s

If it was coming from auto-doc why is it impossible to find "volumes_type" in the git repo and 27 occurances of "volume_type"?

Revision history for this message
Fredrik (fredrik-tarnell) wrote :

My example in the inital bug report shows that the openstack client think so as well.
create() got an unexpected keyword argument 'volumes_type'

And example after that ones changed to "volume_type" openstack client accepts that property.

Unfortunately I pasted an older json document which is missing the type parameter altogether.

It should have been:

{
    "plugin_name": "ambari",
    "hadoop_version": "2.4",
    "node_processes": [
        "DataNode",
        "NodeManager"
    ],
    "name": "ambari-worker",
    "floating_ip_pool": "6ae019fe-5670-4a4d-bd00-16b9e5d1ad3c",
    "flavor_id": "a7a473b7-8e42-4b9b-a763-c95197ad0a50",
    "volumes_per_node": 4,
    "volumes_size": 1,
    "volume_type": "ceph.osd",
    "volume_local_to_instance": true,
    "volume_mount_prefix": "/volumes/disk",
    "use_autoconfig": true,
    "auto_security_group": true,
    "is_public": true,
    "is_protected": false
}

Revision history for this message
Vitalii Gridnev (vgridnev) wrote :

When you use json to create node group you should use the following:

{
  'volume_type': ..

}
because that just exposes API interface: https://github.com/openstack/python-saharaclient/blob/master/saharaclient/api/node_group_templates.py#L32

but when you don't have json, you should use something like that:

openstack .. --volumes-type ceph --volumes-size 1

that was done to have the same prefix for arguments related to volumes.

https://github.com/openstack/python-saharaclient/blob/master/saharaclient/osc/v1/node_group_templates.py#L260

So, I agreed that this probably introduces some confusion and we should take a look on this and fix that in APIv2 (to have the same pattern of arguments in API).

affects: sahara → python-saharaclient
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.