Bug 1848824 - "--config-drive" option of "openstack server create" command doesn't accept non-boolean value
Summary: "--config-drive" option of "openstack server create" command doesn't accept n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstackclient
Version: 16.0 (Train)
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ga
: 17.0
Assignee: Stephen Finucane
QA Contact: nlevinki
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-19 03:29 UTC by Masayuki Igawa
Modified: 2023-10-06 20:43 UTC (History)
7 users (show)

Fixed In Version: python-openstackclient-5.5.1-0.20220427021748.53f1efa.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:10:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack Storyboard 2005468 0 None None None 2020-06-19 03:46:19 UTC
OpenStack gerrit 738182 0 None master: MERGED python-openstackclient: Add 'openstack server create --use-config-drive' (If9cce0ad4094cc9cef1c9136b80c3b0f35a82c7a) 2022-06-13 19:36:06 UTC
Red Hat Issue Tracker OSP-15664 0 None None None 2022-06-13 23:38:08 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:11:51 UTC

Description Masayuki Igawa 2020-06-19 03:29:20 UTC
Description of problem:

The help of "openstack server create" says that --config-drive option accepts a volume.
~~~
(overcloud) [stack@undercloud-0 ~]$ openstack server create -h
usage: openstack server create [-h] [-f {json,shell,table,value,yaml}]
 :
  --config-drive <config-drive-volume>|True
                        Use specified volume as the config drive, or 'True' to
                        use an ephemeral drive
~~~

However, it fails when a non-boolean value is specified like this.
~~~
(overcloud) [stack@undercloud-0 ~]$ openstack server create --config-drive testvol1 --flavor m1.nano --image cirros-0.4.0-x86_64-disk.img "testvm1"
Invalid input for field/attribute config_drive. Value: testvol1. 'testvol1' is not one of [True, 'True', 'TRUE', 'true', '1', 'ON', 'On', 'on', 'YES', 'Yes', 'yes', False, 'False', 'FALSE', 'false', '0', 'OFF', 'Off', 'off', 'NO', 'No', 'no'] (HTTP 400) (Request-ID: req-UUID)
~~~

Version-Release number of selected component (if applicable):
* RHOSP13
* RHOSP16

How reproducible:

Steps to Reproduce:
1. Specify a non-boolean value to the --config-drive option for `openstack server create` command

Actual results:
An error occurs.

Expected results:
The help message should be updated like this because it's not implemented in nova-api:
~~~
  --config-drive True
                        'True' to use an ephemeral drive
~~~

Additional info:
According to the nova-api doc, it only accepts a boolean value.

https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#id11
~~~
config_drive (Optional) body boolean
Indicates whether a config drive enables metadata injection. The config_drive setting provides information about a drive that the instance can mount at boot time. The instance reads files from the drive to get information that is normally available through the metadata service. This metadata is different from the user data. Not all cloud providers enable the config_drive. Read more in the OpenStack End User Guide.
~~~

Comment 1 Bob Fournier 2020-06-19 19:04:20 UTC
This isn't really an area that HardwareProvisioning covers. It looks like nova has been involved with the upstream bug and is aware of the problem.  Sending this to Compute DFG.

Comment 2 Stephen Finucane 2020-06-26 09:59:03 UTC
This is a mistake in openstackclient. While nova did allow non-boolean values in the past, this was only for use with a never-merged feature for the XenAPI driver used by Rackspace and support was removed when API 2.1 was added way back in OSP7 or so.

Comment 13 errata-xmlrpc 2022-09-21 12:10:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543


Note You need to log in before you can comment on or make changes to this bug.