OpenStack Bobcat : Add Users2023/10/24 |
Add User accounts in keystone who can use Openstack System.
|
|
[1] | Any names are OK you like for user-name or project-name. |
# add 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 | f4598dfd3b8a47149234b6892d18d5a4 | | is_domain | False | | name | hiroshima | | options | {} | | parent_id | default | | tags | [] | +-------------+----------------------------------+ # add a user [root@dlp ~(keystone)]# openstack user create --domain default --project hiroshima --password userpassword serverworld +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | f4598dfd3b8a47149234b6892d18d5a4 | | domain_id | default | | enabled | True | | id | d70a5f7908de4cd9aa8e189b725244a9 | | name | serverworld | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+[root@dlp ~(keystone)]# openstack role list +----------------------------------+---------+ | ID | Name | +----------------------------------+---------+ | 47337a4ce8bc428a8b39bb8e32ad6a22 | reader | | 6a0da2e6047d4fabb752ef05e628c19d | manager | | 6ae93bec02354a19a18d0cae975034fe | member | | b4b84af37fc34fc78efa5ab4b8595abe | service | | cacd2a524a2b47e1b8c4e4d6906ed2fd | 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. |
[cent@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)]\$ '
[cent@dlp ~]$
chmod 600 ~/keystonerc [cent@dlp ~]$ source ~/keystonerc [cent@dlp ~(keystone)]$ echo "source ~/keystonerc " >> ~/.bash_profile
# verify possible to run openstack command [cent@dlp ~(keystone)]$ openstack project list +----------------------------------+-----------+ | ID | Name | +----------------------------------+-----------+ | f4598dfd3b8a47149234b6892d18d5a4 | hiroshima | +----------------------------------+-----------+ |
Sponsored Link |
|