Bug 1542342 - [OSP 10] nova get-password returns blank line
Summary: [OSP 10] nova get-password returns blank line
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z8
: 10.0 (Newton)
Assignee: melanie witt
QA Contact: Archit Modi
URL:
Whiteboard:
Depends On:
Blocks: 1558701 1558706 1561762
TreeView+ depends on / blocked
 
Reported: 2018-02-06 06:27 UTC by Rahul Chincholkar
Modified: 2022-08-09 11:26 UTC (History)
13 users (show)

Fixed In Version: openstack-nova-14.1.0-16.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1558701 1558706 1558707 1561762 (view as bug list)
Environment:
Last Closed: 2018-05-17 15:33:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Nova commands debug output (46.84 KB, text/plain)
2018-02-06 06:29 UTC, Rahul Chincholkar
no flags Details
Nova logs from controller and nova config file (135.17 KB, application/x-gzip)
2018-02-08 20:43 UTC, Alex Stupnikov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1748544 0 None None None 2018-02-09 21:41:35 UTC
OpenStack gerrit 543032 0 None MERGED Save admin password to sysmeta in libvirt driver 2020-12-31 06:43:10 UTC
Red Hat Issue Tracker OSP-8794 0 None None None 2022-08-09 11:26:51 UTC
Red Hat Product Errata RHBA-2018:1595 0 None None None 2018-05-17 15:34:56 UTC

Description Rahul Chincholkar 2018-02-06 06:27:53 UTC
Description of problem:

I used `nova set-password` to set root password. Password has been set for root user, I could login with the root user with that password.

But when I try to execute `nova get-password`, It always returns a blank like.

I have attached the debug output of following commands:

# nova --debug set-password rhel2

# nova --debug get-password rhel2

# nova --debug get-password rhel2 my_key.pem 



Version-Release number of selected component (if applicable):
Red Hat Openstack Platform 10 (Packstack Environment)


How reproducible:
Always

Comment 1 Rahul Chincholkar 2018-02-06 06:29:50 UTC
Created attachment 1391843 [details]
Nova commands debug output

Comment 5 Alex Stupnikov 2018-02-08 20:42:00 UTC
Hello,

It turns out that this issue is reproducible at least in OSP10 and OSP11 environments. The picture is the same everywhere:

- it is possible to change root password with ``nova set-password INSTANCE_UUID`` command
- it is impossible to get updated password.

I have checked different articles on the internet and it seems that they are outdated:

- adminPass is not stored in DB anymore;
- adminPass is not printed in the instance's logs;
- SELinux no longer affects this feature;
- there is no openstack analogs.

It turns out that for some reason nova doesn't change admin password that is stored in metadata service during password update procedure anymore. But if you update this password manually, you will be able to get the password with ``nova get-password INSTANCE_UUID`` command. Please check the following output (I have used VM to change password in metadata service):

[root@stup-test1 ~]# curl -s http://169.254.169.254/openstack/latest/password
[root@stup-test1 ~]#
[root@stup-test1 ~]# PASSWORD='123456'; curl -X POST http://169.254.169.254/openstack/latest/password -d $PASSWORD || true
[root@stup-test1 ~]# 
[root@stup-test1 ~]# curl -s http://169.254.169.254/openstack/latest/password
123456[root@stup-test1 ~]#

Result:

[stack@undercloud-0 ~]$ nova get-password 6c923057-fd5c-4daa-ba63-7b7bd1eeb25d
123456

Comment 6 Alex Stupnikov 2018-02-08 20:43:16 UTC
Created attachment 1393424 [details]
Nova logs from controller and nova config file

Comment 8 melanie witt 2018-02-09 16:38:50 UTC
Thanks for all the detailed info. We had a look through the code and it looks like setting of the password in the metadata service for the libvirt driver is missing and has never been implemented (unlike the xen driver, which *does* set the password in the metadata service).

So, we need to fix that for the libvirt driver.

Comment 9 Alex Stupnikov 2018-03-13 09:53:16 UTC
It looks like patch was merged in upstream master and was backported to upstream queens and pike releases.

Comment 18 errata-xmlrpc 2018-05-17 15:33:13 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, 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/RHBA-2018:1595


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