Confusing exception when providing invalid driver to node-create

Bug #1398286 reported by Haomeng,Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Triaged
Low
Unassigned

Bug Description

If user run node-create with a driver which is not enabled and activated, we will get below message:

"No valid host was found. Reason: No conductor service registered which supports driver xxxxxxxxx. (HTTP 400)"

I think this message is not clear, and user will confuse why no valid host was found and how to register conductor service to support the input driver.

We should return to user to identify if the input driver is valid or enabled, or guide to user to run driver-list subcommand to show the current supported drivers.

[root@localhost ~]# ironic node-create -d xxxxxxxxx
No valid host was found. Reason: No conductor service registered which supports driver xxxxxxxxx. (HTTP 400)
[root@localhost ~]# ironic driver-list
+---------------------+-----------------------+
| Supported driver(s) | Active host(s) |
+---------------------+-----------------------+
| pxe_ipmitool | localhost.localdomain |
| pxe_ssh | localhost.localdomain |
+---------------------+-----------------------+
[root@localhost ~]#

Haomeng,Wang (whaom)
summary: - the error message of node-create is not clear
+ node-create should valid the input driver
Dmitry Tantsur (divius)
Changed in ironic:
status: New → Triaged
importance: Undecided → Low
jiangfei (jiangfei0622)
Changed in ironic:
assignee: nobody → jiangfei (jiangfei0622)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/141703

Changed in ironic:
status: Triaged → In Progress
Revision history for this message
aeva black (tenbrae) wrote : Re: node-create should validate the input driver

This bug seems to assume that users and operators are the same, which they are not.

A user of the API may not have any ability to control what drivers are loaded. They can already discover the list of drivers which are supported by that Ironic installation via the driver-list command (as you pointed out). And, at the time of node-create and node-update, the supplied driver_name is validated already; an invalid / unsupported driver will result in the error message you already included.

So, I'm unclear on what the problem actually is. The bug title (which I fixed a grammatical nit in just now) is incorrect -- drivers *are* validated at node-create.

summary: - node-create should valid the input driver
+ node-create should validate the input driver
Revision history for this message
Haomeng,Wang (whaom) wrote :

Deva, I mean we input the invalid driver but get the "No valid host was found" exception, which is confusing, should we validate the input driver and raise "Invalid driver" exception if the driver is not enabled, make sense?

Dmitry Tantsur (divius)
summary: - node-create should validate the input driver
+ Confusing exception when providing invalid driver to node-create
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by jiangfei (<email address hidden>) on branch: master
Review: https://review.openstack.org/141703

Revision history for this message
Dmitry Tantsur (divius) wrote :

I'd personally only append "Maybe driver xxxxxx is not enabled in configuration?" to the error message. Maybe we should also provide a list of enabled drivers (aka the output of driver-list). But I'm against changing the current error: it's technically correct.

description: updated
Changed in ironic:
status: In Progress → Triaged
assignee: jiangfei (jiangfei0622) → nobody
tags: added: api low-hanging-fruit
Vasyl Saienko (vsaienko)
Changed in ironic:
assignee: nobody → Vasyl Saienko (vsaienko)
Dmitry Tantsur (divius)
Changed in ironic:
assignee: Vasyl Saienko (vsaienko) → nobody
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.