Ubuntu 24.04
Sponsored Link

OpenStack Caracal : ユーザーを新規追加する2024/05/21

 

Openstack が利用可能な任意のユーザーを Keystone に新規追加します。

[1] ユーザー名やプロジェクト名は任意の名称で OK です。
# 任意のプロジェクト追加

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

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

# 任意のユーザー追加

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

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 18ede7365bdc430093e8fd4a90f77369 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | b9371d015e0d43dca74f29161448ffd2 |
| name                | serverworld                      |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

root@dlp ~(keystone)#
openstack role list

+----------------------------------+---------+
| ID                               | Name    |
+----------------------------------+---------+
| 434c72643a134d18afd1d12094cfc75d | service |
| b5c98a36bb6e4258a76a76bc96727fac | reader  |
| d7e77a716fd34ac2b6e8a91c19d5d91d | member  |
| d8f785820bf545f897e1fb2f35adefca | manager |
| eccdad43835c44ad80be889f658236f3 | admin   |
+----------------------------------+---------+

# ユーザーを [member] ロールに加える

root@dlp ~(keystone)#
openstack role add --project hiroshima --user serverworld member
[2] 任意の OS ユーザーに、Openstack システムが利用できるように、追加した Openstack ユーザー用の環境変数を設定します。
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
# openstack コマンドが利用できるか確認

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

+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| 18ede7365bdc430093e8fd4a90f77369 | hiroshima |
+----------------------------------+-----------+
関連コンテンツ