Show ' 401 Unauthorized' when adding and editing Infrastructure Provider


#1

hi, guys,
I encountered a problem, asking for some help.

summary:
I created a new virtual machine from the ManageIQ template, and started it.
and then, I want to connect up with a Provider (Red Hat Enterprise Virtualization Manager).

Infrastructure Providers -> configuration -> edit this infrastructure provider:

Basic Information:
Name               RHEVM-193.168.253.163
Type             Red Hat Enterprise Virtualization Manager
Host Name       RHEVM
IP Address       193.168.253.163
API Port     
Zone                default

Credentials:
User ID            root
Password            ********
Verify Password  ********
    
when i push the ‘validate’ button, it shows me ‘401 Unauthorized’.
i’m sure of that the ip and password are right.

if i specify the API Port, API Port 5432, which shows ‘Connection refused - connect(2)’

who can tell me why, and what should i do to fix it?
Thank you in advance.


#2

You will need to use the admin@internal account when pulling in RHEV as a provider.


#3

Thank you.
your suggestion is effective, and the validation passed.


#4

Hi jcarter,

I have some questions to trouble you, :wink:

  1. Validation failed for 'Infrastructure Providers->Edit Infrastructure Providers ‘RHEVM’ -> C & U Database’
    I used ‘admin@internal’ as User ID , it showed like below,
    ERROR: ‘could not connect to server: Connection refused
    Is the server running on host “193.168.253.163” and accepting TCP/IP connections on port 5432 ?’

    but, The validation successed for ‘Default’ with ‘admin@internal’.
    @:Is there something wrong? what’s the correct form?

    BTW, The charts palced at Dashboard all shows ‘No data found’.
    I suspect of it’s relative to the above validation failed, is it ture?

  2. deploy the selected smartproxy to RHEV-KVM.

    Unexpected error encountered
    Errors in Management Engine can be caused by:
    ①Accessing Management Engine from multiple tabs or windows of the same browser on a single machine.Close any duplicate browser sessions, then select a menu option above.
    ②Pressing the back button during a session. Close any duplicate browser sessions, then select a menu option above.
    ③An internal system error. Please contact your administrator for assistance.

    Error text: The user is not authorized for this task or item. [miq_proxy/button]

    Q:what can i do to fix it ?


Problem about validation for C&U database and smartproxy
#5

You will have to perform the following task on the rhev manager before you can connect to the c&u database.

Procedure 5.2. To Collect Data for Red Hat Enterprise Virtualization Manager 3.1

  1. SSH into the history database server. Use the following commands substituting a user name of your choice for newuser and the user’s password for newuserpassword. Press enter after each line.
    psql -U postgres
    CREATE ROLE newuser LOGIN UNENCRYPTED PASSWORD ‘newuserpassword’ SUPERUSER VALID UNTIL ‘infinity’;
    \q
  2. Execute the following command on the Red Hat Enterprise Virtualization Manager History Database server and save the changes:
    "# iptables -I INPUT -p tcp -m tcp --dport 5432 -j ACCEPT"
    "# service iptables save"
  3. Enable for external md5 Authentication by editing /var/lib/pgsql/data/pg_hba.conf and changing the following line to look like:
    “host all all 0.0.0.0/0 md5”
  4. Enable PostgreSQL to listen for remote connections by editing /var/lib/pgsql/data/postgresql.conf and modifying the following line to look like:
    “listen_addresses = ‘*’”
  5. Reload PostgreSQL configuration by typing:
    service postgresql reload

Problem about validation for C&U database and smartproxy
#6

Thank you, jcarter.

Just make some supplement,
(1) we must specify the port number ,‘port=5432’, when perform the step 4.
(2) the command line “service postgresql reload” didn’t work. Instead, “service postgrepsql restart” is ok.

Although I have passed the Validation, it showd ‘database “rhevm_history” does not exist’,
do you know why?

and did you have experience on the problem ?
it showed “Error text: The user is not authorized for this task or item. [miq_proxy/button]” when i want to
deploy the selected smartproxy to RHVM-KVM.