Bug 1848824

Summary: "--config-drive" option of "openstack server create" command doesn't accept non-boolean value
Product: Red Hat OpenStack Reporter: Masayuki Igawa <migawa>
Component: python-openstackclientAssignee: Stephen Finucane <stephenfin>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: low    
Version: 16.0 (Train)CC: apevec, bfournie, jpichon, jschluet, lhh, mbultel, stephenfin
Target Milestone: gaKeywords: Patch, Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-openstackclient-5.5.1-0.20220427021748.53f1efa.el9ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:10:46 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:

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