
11 Troubleshooting
REST API request returns HTTP code 401
Symptom
Getting unauthorized HTTP code 401 for REST calls to the controller.
Cause
The role-based access control (RBAC) role is not authorized with the token. HPE VAN SDN
Controller 2.5 enforces a single role. By default the single role is
sdn-admin
. A user must have
this role configured on the Keystone server for the domain (tenant) that the user belongs to.
Action
1.
Configure a user with the
sdn-admin
role on the Keystone server for the domain (tenant)
that the user belongs to. The domain name and role configured for the user on the controller
must match the domain name and role configured for that user in Keystone.
a.
Create a tenant:
curl –H "X-Auth-Token:ADMIN" –H "Contant-Type: application/json" –d '{"tenant": {"enabled": true,
"name": "test-tenant", "description": "Test Tenant"}}' http://<controller-ip>:35357/v2.0/tenants
b.
List tenants:
curl –H "X-Auth-Token:ADMIN" http://<controller-ip>:35357/v2.0/tenants
c.
Create a user:
curl –H "X-Auth-Token:ADMIN" –H "Contant-Type: application/json" –d '{"user": {"email":
"[email protected]", "password": "somepass", "enabled": true, "name": "test-user", "tenantId":
"2c851897a09f483fa452e2de11511f71"}}' http://<controller-ip>:35357/v2.0/users
d.
List users:
curl –H "X-Auth-Token:ADMIN" http://<controller-ip>:35357/v2.0/users
e.
Create a role:
curl –H "X-Auth-Token:ADMIN" –H "Contant-Type: application/json" –d '{"role": {"name": "test-role"}}'
http:// <controller-ip>:35357/v2.0/OS-KSADM/roles
f.
List users:
curl –H "X-Auth-Token:ADMIN" http://<controller-ip>:35357/v2.0/roles
g.
Assign role:
curl –X PUT –H "X-Auth-Token:ADMIN"
http://<controller-ip>:35357/v2.0/tenants/<tenant-id>/users/<user-id>/roles/OS-KSADM/<role-id>
h.
List roles for a user:
curl –H "X-Auth-Token:ADMIN" http://<controller-ip>:35357/v2.0/OS-KSADM/roles/<user-id>
2.
Use the
curl
command to request authentication using the default username and password.
You must include the keyword domain and the default domain name value, in this example
sdn
, as follows:
curl -sk -H 'Content-Type:application/json' -d '{"login":{"user":"sdn","password":"skyline","domain":"sdn"}}'
https://<controller-ip>:8443/sdn/v2.0/auth)
Controller not listening on port TCP/8443
Symptom
The SDN controller installed successfully but it is not listening on port TCP/8443.
Cause
You are running a version of Linux that is not supported.
REST API request returns HTTP code 401
155