Bug 1418828 - [RFE] [director] Add "export OS_PROJECT_NAME=admin" line to the generated stackrc file
Summary: [RFE] [director] Add "export OS_PROJECT_NAME=admin" line to the generated sta...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: instack-undercloud
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Upstream M3
: 11.0 (Ocata)
Assignee: Ben Nemec
QA Contact: Gurenko Alex
URL:
Whiteboard:
Depends On:
Blocks: 1426480
TreeView+ depends on / blocked
 
Reported: 2017-02-02 20:06 UTC by Alexander Chuzhoy
Modified: 2017-05-30 05:42 UTC (History)
10 users (show)

Fixed In Version: instack-undercloud-6.0.0-6.el7ost
Doc Type: Bug Fix
Doc Text:
The undercloud stack rc file is a Keystone v2 rc. Previously, when switching from a v3 rc file (such as the v3 overcloudrc), some of the v3 environment variables would still be present. As a result, Keystone authentication may not work correctly. With this release, all OpenStack-related environment variables are cleared in stackrc before the undercloud values are set. As a result, variables from a previous rc file can no longer be present in the environment after sourcing stackrc, so Keystone authentication works correctly.
Clone Of:
Environment:
Last Closed: 2017-05-17 19:44:34 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1245 normal SHIPPED_LIVE Red Hat OpenStack Platform 11.0 Bug Fix and Enhancement Advisory 2017-05-17 23:01:50 UTC
OpenStack gerrit 428821 None None None 2017-02-03 17:20:32 UTC

Description Alexander Chuzhoy 2017-02-02 20:06:42 UTC
rhosp-director:  [RFE] - to add "export OS_PROJECT_NAME=admin" line to the generated stackrc  file


Here's what the stackrc  looks now:
NOVA_VERSION=1.1
export NOVA_VERSION
OS_PASSWORD=$(sudo hiera admin_password)
export OS_PASSWORD
OS_AUTH_URL=http://192.168.24.1:5000/v2.0
export OS_AUTH_URL
OS_USERNAME=admin
OS_TENANT_NAME=admin
COMPUTE_API_VERSION=1.1
OS_BAREMETAL_API_VERSION=1.15
OS_NO_CACHE=True
OS_CLOUDNAME=undercloud
export OS_USERNAME
export OS_TENANT_NAME
export COMPUTE_API_VERSION
export OS_BAREMETAL_API_VERSION
export OS_NO_CACHE
export OS_CLOUDNAME


[stack@undercloud-0 ~]$ . stackrc 
[stack@undercloud-0 ~]$ nova list
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| ID                                   | Name         | Status | Task State | Power State | Networks               |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| a08cd3f5-22ba-4d5b-b331-ede4e56b6081 | ceph-0       | ACTIVE | -          | Running     | ctlplane=192.168.24.18 |
| ee66176f-ac95-44f4-9c30-68dada32888d | ceph-1       | ACTIVE | -          | Running     | ctlplane=192.168.24.8  |
| 15762f57-57f4-4a09-87bf-9e633f1bbe5e | compute-0    | ACTIVE | -          | Running     | ctlplane=192.168.24.10 |
| e8ea1150-86be-4cb5-93a9-021cee7fcf79 | compute-1    | ACTIVE | -          | Running     | ctlplane=192.168.24.7  |
| 9df99e67-70ae-4a6d-bed0-be594f9fe8b7 | controller-0 | ACTIVE | -          | Running     | ctlplane=192.168.24.9  |
| 72f97993-048a-49d9-b056-f4570a7d2c93 | controller-1 | ACTIVE | -          | Running     | ctlplane=192.168.24.16 |
| b51b633a-6719-49f6-9c9e-88ba016f6b36 | controller-2 | ACTIVE | -          | Running     | ctlplane=192.168.24.19 |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+



[stack@undercloud-0 ~]$ export OS_PROJECT_NAME=admin1
[stack@undercloud-0 ~]$ nova list
ERROR (Unauthorized): The request you have made requires authentication. (HTTP 401) (Request-ID: req-f2290e46-d2c1-4f19-bd15-57d58076feae)
[stack@undercloud-0 ~]$ export OS_PROJECT_NAME=admin
[stack@undercloud-0 ~]$ nova list
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| ID                                   | Name         | Status | Task State | Power State | Networks               |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| a08cd3f5-22ba-4d5b-b331-ede4e56b6081 | ceph-0       | ACTIVE | -          | Running     | ctlplane=192.168.24.18 |
| ee66176f-ac95-44f4-9c30-68dada32888d | ceph-1       | ACTIVE | -          | Running     | ctlplane=192.168.24.8  |
| 15762f57-57f4-4a09-87bf-9e633f1bbe5e | compute-0    | ACTIVE | -          | Running     | ctlplane=192.168.24.10 |
| e8ea1150-86be-4cb5-93a9-021cee7fcf79 | compute-1    | ACTIVE | -          | Running     | ctlplane=192.168.24.7  |
| 9df99e67-70ae-4a6d-bed0-be594f9fe8b7 | controller-0 | ACTIVE | -          | Running     | ctlplane=192.168.24.9  |
| 72f97993-048a-49d9-b056-f4570a7d2c93 | controller-1 | ACTIVE | -          | Running     | ctlplane=192.168.24.16 |
| b51b633a-6719-49f6-9c9e-88ba016f6b36 | controller-2 | ACTIVE | -          | Running     | ctlplane=192.168.24.19 |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+

Comment 1 Alexander Chuzhoy 2017-02-02 21:25:52 UTC
before running commands on undercloud, we source the stackrc and expect things to work and apparently it relies on having OS_PROJECT_NAME set to admin


I created another user/pass/project and tried to operate on overcloud
then, when I wanted to switch back to working on undercloud - I got: ERROR (Unauthorized): The request you have made requires authentication. (HTTP 401) (Request-ID: req-7804f2bc-9207-4c98-88ff-e2d8cf95ad46)

Comment 2 Ben Nemec 2017-02-03 17:08:08 UTC
We can add project name, although since we don't generate a v3 stackrc I'm not sure whether that's the best approach.  I think the short-term solution is to add something like https://github.com/openstack/tripleo-common/blob/8affc8aafecc74c49af6593e4ec9ce1723845925/tripleo_common/utils/overcloudrc.py#L62 to stackrc so we don't end up with remnants of a previous rc file in the current env.

Comment 3 Alexander Chuzhoy 2017-02-03 17:37:37 UTC
Ben, sounds good,
Thanks.

Comment 8 Ben Nemec 2017-02-27 18:46:47 UTC
I'm pretty sure Angus has no specific interest in this bug. :-)

Comment 10 errata-xmlrpc 2017-05-17 19:44:34 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/RHEA-2017:1245


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