Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1700085

Summary: Ironic in OC - Adding rootpwd to pxe_append_params and restarting ironic_conductor fails
Product: Red Hat OpenStack Reporter: Alexander Chuzhoy <sasha>
Component: documentationAssignee: RHOS Documentation Team <rhos-docs>
Status: CLOSED WORKSFORME QA Contact: RHOS Documentation Team <rhos-docs>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: akaris, bfournie, chrisbro, mburns, sbaker
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-26 19:57:29 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 Alexander Chuzhoy 2019-04-15 19:56:00 UTC
Ironic in OC - Adding rootpwd to pxe_append_params and restarting ironic_conductor fails

Environment:
python2-ironic-neutron-agent-1.0.0-1.el7ost.noarch
puppet-ironic-12.4.0-5.el7ost.noarch
openstack-ironic-api-10.1.8-2.el7ost.noarch
openstack-ironic-inspector-7.2.3-1.el7ost.noarch
python2-ironicclient-2.2.2-1.el7ost.noarch
python-ironic-lib-2.12.2-1.el7ost.noarch
python-ironic-inspector-client-3.1.2-1.el7ost.noarch
instack-undercloud-8.4.7-2.el7ost.noarch
openstack-ironic-common-10.1.8-2.el7ost.noarch
openstack-ironic-staging-drivers-0.9.1-1.el7ost.noarch
openstack-ironic-conductor-10.1.8-2.el7ost.noarch


Steps to reproduce:

1. Deploy OC with BMaaS.
2. Edit /var/lib/config-data/puppet-generated/ironic/etc/ironic/ironic.conf and place the following line under [pxe] section:
pxe_append_params = rootpwd="$1$/M4TEgtJ$<string>" selinux=0

3. Try to stop/start ironic_conductor.

Result:
a4c8bcd9bd0f        192.168.24.1:8787/rhosp13/openstack-ironic-conductor:2019-04-10.1            "kolla_start"            3 days ago          Restarting (1) 33 minutes ago                       ironic_conductor



2019-04-15 19:21:37.874 1 DEBUG oslo_service.service [-] publish_errors                 = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2894
2019-04-15 19:21:37.924 1 CRITICAL ironic [-] Unhandled error: NoSuchOptError: no such option FqRANoZD1S0FUcWRqIPsH0 in group [DEFAULT]
2019-04-15 19:21:37.924 1 ERROR ironic Traceback (most recent call last):
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/bin/ironic-conductor", line 10, in <module>
2019-04-15 19:21:37.924 1 ERROR ironic     sys.exit(main())
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/ironic/cmd/conductor.py", line 85, in main
2019-04-15 19:21:37.924 1 ERROR ironic     launcher.wait()
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 329, in wait
2019-04-15 19:21:37.924 1 ERROR ironic     status, signo = self._wait_for_exit_or_signal()
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 304, in _wait_for_exit_or_signal
2019-04-15 19:21:37.924 1 ERROR ironic     self.conf.log_opt_values(LOG, logging.DEBUG)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2902, in log_opt_values
2019-04-15 19:21:37.924 1 ERROR ironic     _sanitize(opt, getattr(group_attr, opt_name)))
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 3382, in __getattr__
2019-04-15 19:21:37.924 1 ERROR ironic     return self._conf._get(name, self._group)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2944, in _get
2019-04-15 19:21:37.924 1 ERROR ironic     value = self._do_get(name, group, namespace)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2981, in _do_get
2019-04-15 19:21:37.924 1 ERROR ironic     return convert(opt._get_from_namespace(namespace, group_name))
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2972, in convert
2019-04-15 19:21:37.924 1 ERROR ironic     self._substitute(value, group, namespace), opt)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 3029, in _substitute
2019-04-15 19:21:37.924 1 ERROR ironic     self.StrSubWrapper(self, group=group, namespace=namespace))
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib64/python2.7/string.py", line 205, in safe_substitute
2019-04-15 19:21:37.924 1 ERROR ironic     return self.pattern.sub(convert, self.template)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib64/python2.7/string.py", line 190, in convert
2019-04-15 19:21:37.924 1 ERROR ironic     return '%s' % (mapping[named],)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 3471, in __getitem__
2019-04-15 19:21:37.924 1 ERROR ironic     value = self.conf._get(key, namespace=self.namespace)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2944, in _get
2019-04-15 19:21:37.924 1 ERROR ironic     value = self._do_get(name, group, namespace)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2961, in _do_get
2019-04-15 19:21:37.924 1 ERROR ironic     info = self._get_opt_info(name, group)
2019-04-15 19:21:37.924 1 ERROR ironic   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 3118, in _get_opt_info
2019-04-15 19:21:37.924 1 ERROR ironic     raise NoSuchOptError(opt_name, group)
2019-04-15 19:21:37.924 1 ERROR ironic NoSuchOptError: no such option FqRANoZD1S0FUcWRqIPsH0 in group [DEFAULT]
2019-04-15 19:21:37.924 1 ERROR ironic

Comment 1 Bob Fournier 2019-04-15 20:27:34 UTC
Sasha - are you trying to add a password to IPA?  Can you try this procedure which involves unpacking the image - https://mojo.redhat.com/people/dsorrent/blog/2016/08/13/inspecting-introspection.

I don't believe setting pxe_append_params with a new password will work.

Comment 2 Alexander Chuzhoy 2019-04-15 20:59:46 UTC
The procedure in comment#1  worked for me.

If the steps I tried in comment#0 shouldn't work - lets convert this into a doc bug for documenting the right way to set the password for ramdisk image. It's very useful for debugging.

Comment 4 Dmitry Tantsur 2019-04-16 09:34:55 UTC
Let's document setting SSH keys instead? The issue is in the $ symbol, which oslo.config interprets.

Sasha, could you try doubling all $$ symbols, i.e. 

 pxe_append_params = rootpwd="$$1$$/M4TEgtJ$$<string>" selinux=0

? According to https://docs.openstack.org/oslo.config/latest/reference/configuration-files.html#option-value-interpolation that's the way interpolation is avoided.

Note that it's a good idea to keep the default content of pxe_append_params, i.e. 

 pxe_append_params = nofb nomodeset vga=normal rootpwd="$$1$$/M4TEgtJ$$<string>" selinux=0

Comment 5 Alexander Chuzhoy 2019-04-16 16:32:00 UTC
Using double '$' worked. Below is an example with "redhat" as a password:
pxe_append_params = nofb nomodeset vga=normal rootpwd="$$1$$YTeWzzp7$$HVs0zv7yhLRA6.egigc9.1"

We could/should document both ways.

Comment 7 Andreas Karis 2020-02-27 15:07:30 UTC
*** Bug 1807871 has been marked as a duplicate of this bug. ***

Comment 8 Andreas Karis 2020-02-27 15:07:41 UTC
Hi docs team, please modify the ironic overcloud guide and incorporate this KCS into it:
https://access.redhat.com/solutions/4860841

Thanks,

Andreas

Comment 11 Steve Baker 2021-10-26 19:57:29 UTC
I'm going to close this on the basis that the KCS exists for those who need it, and putting it in the documentation will imply that it is a supported action, which we're not comfortable with encouraging.