Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zhmc CLI: 'zhmc partition console' asks for password again although session already created #308

Closed
leopoldjuergen opened this issue Jun 8, 2017 · 4 comments
Assignees

Comments

@leopoldjuergen
Copy link
Contributor

Actual behavior

$ zhmc cpc list
+----------+------------------+
| name | status |
|----------+------------------|
| P000S67B | service-required |
+----------+------------------+
$ zhmc partition console P000S67B UbuntuDemo2
Enter password (for user pedebug at HMC 9.152.151.49):

Expected behavior

No password request

Execution environment

  • zhmcclient version: zhmc, version 0.13.1.dev40
  • Operating system (type+version): Ubuntu 14.04
  • HMC version: 2.13.1
  • CPC version:
@andy-maier
Copy link
Member

andy-maier commented Jun 13, 2017

I was able to verify this behavior (cpc list works without prompting for password, partition console asks for password) with zhmc v0.13.1.dev50 (branch andy/fix-find-partition) on RHEL 7.3, with ZHMC_HOST, ZHMC_USERID and ZHMC_SESSION env vars set.

@andy-maier
Copy link
Member

I investigated this and found that there is a reason for the password prompt:

The code establishes a notification listener for the OS message notifications. In order to do that, a password is needed for logging on to the Stomp connection (see NotificationReceiver.__init__()). Because the zhmc command was used with a session stored in the environment, a password was not available and needed to be prompted for.

If the zhmc partition console command is executed with the -p option instead of relying on the ZHMC_SESSION env var, that password is used and no password prompt occurs.

I believe it is not possible to use a saved session ID with Stomp, but it deserves further investigation to be sure.

@andy-maier
Copy link
Member

Reading the HMC API book 2.13.1 reveals this (CHapter 4, section "Connecting to the API message broker"):

In order to connect to the integrated message broker, clients must provide a valid HMC user name and
password in order to identify the HMC user making the connection. This information is validated using
the standard HMC user authentication mechanisms before allowing the connection to succeed. The
integrated message broker does not allow any anonymous or unauthenticated connections.

It does not mention session IDs, so I'm pretty sure it does not support them there.

@andy-maier andy-maier added this to the 1.0.0 milestone Jul 21, 2017
@andy-maier andy-maier changed the title 'zhmc partition console' asks for password again although session already created zhmc CLI: 'zhmc partition console' asks for password again although session already created Aug 31, 2017
@andy-maier
Copy link
Member

This issue has been copied to zhmcclient/zhmccli#11

@andy-maier andy-maier added the resolution: delegated Pursued elsewhere label Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants