Ubuntu 22.04
Sponsored Link

OpenStack Caracal : Add Openstack Users2024/04/05

 
Add User accounts in keystone who can use Openstack System.
[1] Any names are OK you like for user-name or project-name.
# create a project

root@dlp ~(keystone)#
openstack project create --domain default --description "Hiroshima Project" hiroshima

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Hiroshima Project                |
| domain_id   | default                          |
| enabled     | True                             |
| id          | d45d0cefc6724cfe95103e729e265015 |
| is_domain   | False                            |
| name        | hiroshima                        |
| options     | {}                               |
| parent_id   | default                          |
| tags        | []                               |
+-------------+----------------------------------+

# create a user

root@dlp ~(keystone)#
openstack user create --domain default --project hiroshima --password userpassword serverworld

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | d45d0cefc6724cfe95103e729e265015 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | f7a19fba25e84e63bf885722de49c269 |
| name                | serverworld                      |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

root@dlp ~(keystone)#
openstack role list

+----------------------------------+---------+
| ID                               | Name    |
+----------------------------------+---------+
| 4100a1dd9f3142bfb6c57a2005bbac0e | reader  |
| 809881ed55434491b01ac2a295f9458f | member  |
| aec6869163924636b073e11c3b5ce933 | manager |
| f43a7c7f69c645ea8a001beb58a5187d | service |
| f97b7be4729d4f7b8bbab9993b7673e5 | admin   |
+----------------------------------+---------+

# add a user to the [member] role

root@dlp ~(keystone)#
openstack role add --project hiroshima --user serverworld member
[2] Set environment variables for Openstack to an OS user that makes it be able to use Openstack system.
ubuntu@dlp:~$
vi ~/keystonerc
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=hiroshima
export OS_USERNAME=serverworld
export OS_PASSWORD=userpassword
export OS_AUTH_URL=https://dlp.srv.world:5000
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export PS1='\u@\h \W(keystone)\$ '
ubuntu@dlp:~$
chmod 600 ~/keystonerc

ubuntu@dlp:~$
source ~/keystonerc

ubuntu@dlp ~(keystone)$
echo "source ~/keystonerc " >> ~/.bash_profile
# verify possible to run openstack command

[cent@dlp ~(keystone)]$
openstack project list

+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| d45d0cefc6724cfe95103e729e265015 | hiroshima |
+----------------------------------+-----------+
Matched Content