The 'openstacksdk' Version 0.39.0 is Required to Run Pf9-express To Onboard Host.

Problem

PF9-Express will exit with an error unauthorized request while onboarding a node.

TASK [pf9-auth : Obtain authentication token from Keystone] *************************************************************************************************************task path: /Users/employee/project/iso.virtualization.pf9-express/roles/pf9-auth/tasks/main.yml:23...Using module file /Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/ansible/modules/cloud/openstack/os_auth.py[localhost] ESTABLISH LOCAL CONNECTION FOR USER: [username][localhost] EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=naldnldqiymukuejcpjjybexyiljyqpi] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-naldnldqiymukuejcpjjybexyiljyqpi; /Users/employee/project/iso.virtualization.tools/venv/bin/python'"'"' && sleep 0'The full traceback is:Traceback (most recent call last):File "/tmp/ansible_os_auth_payload_OikK4f/__main__.py", line 61, in mainauth_token=cloud.auth_token,File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/openstack/cloud/openstackcloud.py", line 639, in auth_tokenreturn self.session.get_token()File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/session.py", line 1205, in get_tokenreturn (self.get_auth_headers(auth) or {}).get('X-Auth-Token')File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/session.py", line 1183, in get_auth_headersreturn auth.get_headers(self, **kwargs)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/plugin.py", line 95, in get_headerstoken = self.get_token(session)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 88, in get_tokenreturn self.get_access(session).auth_tokenFile "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 134, in get_accessself.auth_ref = self.get_auth_ref(session)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 208, in get_auth_refreturn self._plugin.get_auth_ref(session, **kwargs)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/identity/v2.py", line 63, in get_auth_refauthenticated=False, log=False)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/session.py", line 1131, in postreturn self.request(url, 'POST', **kwargs)File "/Users/employee/project/iso.virtualization.tools/venv/lib/python2.7/site-packages/keystoneauth1/session.py", line 968, in requestraise exceptions.from_response(resp, method, url)Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: [req-id])

Environment

  • Platform9 Managed OpenStack - v4.0 and Higher

  • Platform9 Express

Cause

The older version of pf9-express imports and uses a python module "shade" which is no longer supported.

Resolution

There are 2 options available to resolve this issue as highlighted in point no 2 and point no 3 below.

  1. Login to the machine you use to run the express code.

  2. Complete rebuild of the Express codebase by following the below two steps.

    1. The master branch of the pf9-express repository has the fix available.

    2. Do a complete rebuild with a 'git clone' of the current pf9-express repo

OR 3. Edit the Express code on the machine where it's installed by following below steps.

1. Edit the pf9-express code to replace 'shade' with 'openstacksdk==0.39.0'. Note the single quotes around this package. That will be needed as part of the bash script syntax. Also,

note that there will be two instances of this step within the code (one for Ubuntu and one

for Centos). Ensure you make the same change in both places.

2. Uninstall all previous versions of openstacksdk using the command pip uninstall openstack. It is important to note that there might be multiple versions of this in the system. The command needs to be repeated to ensure all remnants are gone.

3. Run pf9-express without bypassing the prereqs to pick the new changes. i.e without using the '-b' switch in your commands.

Last updated