[root@openstack stack]# keystone --os-username=admin --os-password=stack --os-auth-url= --os-tenant-name=admin user-list
+----------------------------------+-------------------+---------+--------------------+
| id | name | enabled | email |
+----------------------------------+-------------------+---------+--------------------+
| b02cba4cbca643e59cfea4095854e696 | admin | True | admin@example.com |
| 18b170375d424491909fa7e2f8a71568 | alt_demo | True | |
| f409e63756144e56b6dc6a5295c38df9 | cinder | True | cinder@example.com |
| 86fe45628e2c4cd783baab4515542d1f | demo | True | demo@example.com |
| 6195a5152e5a4461898a769b4a130e2e | glance | True | |
| 9a4e832bf19e4709a41a3e935510da9b | heat | True | heat@example.com |
| 88df7565eac14b38821f875f7298711c | heat_domain_admin | True | |
| 0f49f86eb251461fbbb8adac52a655c6 | nova | True | nova@example.com |
+----------------------------------+-------------------+---------+--------------------+
[root@openstack stack]# keystone --os-username=admin --os-password=stack --os-auth-url= --os-tenant-name=admin tenant-list
[root@openstack stack]# keystone --os-username=admin --os-password=stack --os-auth-url= --os-tenant-name=admin role-list
[root@openstack stack]# keystone --os-username=admin --os-password=stack --os-auth-url= --os-tenant-name=admin user-role-list
+----------------------------------+------------------+----------------------------------+----------------------------------+
| id | name | user_id | tenant_id |
+----------------------------------+------------------+----------------------------------+----------------------------------+
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | b02cba4cbca643e59cfea4095854e696 | 3f9be5c47c7b467893f48304b5883a45 |
| 894f3f7e38a34312983cbd155f0b6e4c | admin | b02cba4cbca643e59cfea4095854e696 | 3f9be5c47c7b467893f48304b5883a45 |
| fb69983e0b5e4fe4a48cc64db1933775 | heat_stack_owner | b02cba4cbca643e59cfea4095854e696 | 3f9be5c47c7b467893f48304b5883a45 |
+----------------------------------+------------------+----------------------------------+----------------------------------+
简化:
[root@openstack stack]# vim /etc/keystone/keystonerc
输入:
export OS_USERNAME=admin
export OS_PASSWORD=stack
export OS_TENANT_NAME=admin
export OS_AUTH_URL=
export SERVICE_ENDPOINT=
[root@openstack stack]# source /etc/keystone/keystonerc
二、创建
[root@openstack stack]# keystone tenant-create --name openstackTest --description "MY TEST"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | MY TEST |
| enabled | True |
| id | 7c7c979a4ae54f6d96f4615ca79a7c7c |
| name | openstackTest |
+-------------+----------------------------------+
[root@openstack stack]# keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 3f9be5c47c7b467893f48304b5883a45 | admin | True |
| 8068a7ccd2d64320990439869931011c | alt_demo | True |
| d2db574840f94508846146d4b502d3f2 | demo | True |
| 407cc6cc24e047a4abe59d27e3f40c66 | invisible_to_admin | True |
| 7c7c979a4ae54f6d96f4615ca79a7c7c | openstackTest | True |
| cffbba2a075c43fdb9a9643c15e737b1 | service | True |
+----------------------------------+--------------------+---------+
[root@openstack stack]# keystone user-create --tenant-id 7c7c979a4ae54f6d96f4615ca79a7c7c --name mytest --pass mytest
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | |
| enabled | True |
| id | 7be3b4022b0241eb9c233fa5a9f7d52d |
| name | mytest |
| tenantId | 7c7c979a4ae54f6d96f4615ca79a7c7c |
| username | mytest |
+----------+----------------------------------+
[root@openstack stack]# keystone role-create --name mytest
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| id | 64ec1ecbcdfe4becbec3596ed1464f3a |
| name | mytest |
+----------+----------------------------------+
mysql> select * from keystone.role;
+----------------------------------+------------------+-------+
| id | name | extra |
+----------------------------------+------------------+-------+
| 4f7ec2f4eca24d4d8dbb92bd423cfd40 | anotherrole | {} |
| 64ec1ecbcdfe4becbec3596ed1464f3a | mytest | {} |
| 894f3f7e38a34312983cbd155f0b6e4c | admin | {} |
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | {} |
| a2b28672e2a7423a81f016ce2a64f340 | service | {} |
| d46cf832a75d4783894535583d2c0e54 | ResellerAdmin | {} |
| db2d67dea1524b45b56157d991db5da5 | Member | {} |
| fb273a4236474eb79cd57f2d297c5a28 | heat_stack_user | {} |
| fb69983e0b5e4fe4a48cc64db1933775 | heat_stack_owner | {} |
+----------------------------------+------------------+-------+
[root@openstack stack]# keystone user-role-add --user-id 7be3b4022b0241eb9c233fa5a9f7d52d --tenant-id 7c7c979a4ae54f6d96f4615ca79a7c7c --role-id 64ec1ecbcdfe4becbec3596ed1464f3a
[root@openstack stack]# keystone service-list
+----------------------------------+----------+----------------+-----------------------------+
| id | name | type | description |
+----------------------------------+----------+----------------+-----------------------------+
| a8a71c178a574c7e973be699bd416318 | cinder | volume | Cinder Volume Service |
| 51ae581ed2874098bdfe7e0e2183868f | cinderv2 | volumev2 | Cinder Volume Service V2 |
| f3ecd40c63f84350a44ab68d46bbd1a0 | ec2 | ec2 | EC2 Compatibility Layer |
| 84894a519e534913921eb3b10ad38a2e | glance | image | Glance Image Service |
| cc2f59b2e4f140b09a58cacae3cfebe3 | heat | orchestration | Heat Orchestration Service |
| d1e48d0500b341ccad61816eb1201c05 | heat | cloudformation | Heat CloudFormation Service |
| 97e366ec9a9841199427c602817b9813 | keystone | identity | Keystone Identity Service |
| 4cf845fcefd44e59aa908bb669bebad1 | nova | compute | Nova Compute Service |
| e961a94b4e254d01902fdca7a0a661ca | novav3 | computev3 | Nova Compute Service V3 |
| 9b539c4abfa749cab022de849568758e | s3 | s3 | S3 |
+----------------------------------+----------+----------------+-----------------------------+
[root@openstack stack]# keystone catalog
Service: compute
+-------------+------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------+
| adminURL | |
| id | 0145e03a94b847dbb18d857a7fe04c0c |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+------------------------------------------------------------+
Service: volumev2
+-------------+------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------+
| adminURL | |
| id | 1492978dd65847acb9f55f1c3d876174 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+------------------------------------------------------------+
Service: computev3
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | |
| id | 0d78edddc1b6414f845dd003f0ed73b9 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+----------------------------------+
Service: s3
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | |
| id | 1eb514943a4d42238577859c6a46b10e |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+----------------------------------+
Service: image
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | |
| id | 1492454713294420ac2920c8e631f748 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+----------------------------------+
Service: cloudformation
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | |
| id | 008038a70c5d4f149106aac58e12dd77 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+----------------------------------+
Service: volume
+-------------+------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------+
| adminURL | |
| id | 3ee42d86be034fa09a9a9d97a13a8091 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+------------------------------------------------------------+
Service: ec2
+-------------+---------------------------------------+
| Property | Value |
+-------------+---------------------------------------+
| adminURL | |
| id | b2715810826946b4bd06cff41bccd5ce |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+---------------------------------------+
Service: orchestration
+-------------+------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------+
| adminURL | |
| id | 51cdf31bfd6048638b36fc1ee8f4be76 |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+------------------------------------------------------------+
Service: identity
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | |
| id | 0a01abaf8d5d45568d992890cfe602bb |
| internalURL | |
| publicURL | |
| region | RegionOne |
+-------------+----------------------------------+
mysql> select * from service;
+----------------------------------+----------------+------------------------------------------------------------------+---------+
| id | type | extra | enabled |
+----------------------------------+----------------+------------------------------------------------------------------+---------+
| 4cf845fcefd44e59aa908bb669bebad1 | compute | {"name": "nova", "description": "Nova Compute Service"} | 1 |
| 51ae581ed2874098bdfe7e0e2183868f | volumev2 | {"name": "cinderv2", "description": "Cinder Volume Service V2"} | 1 |
| 84894a519e534913921eb3b10ad38a2e | image | {"name": "glance", "description": "Glance Image Service"} | 1 |
| 97e366ec9a9841199427c602817b9813 | identity | {"name": "keystone", "description": "Keystone Identity Service"} | 1 |
| 9b539c4abfa749cab022de849568758e | s3 | {"name": "s3", "description": "S3"} | 1 |
| a8a71c178a574c7e973be699bd416318 | volume | {"name": "cinder", "description": "Cinder Volume Service"} | 1 |
| cc2f59b2e4f140b09a58cacae3cfebe3 | orchestration | {"name": "heat", "description": "Heat Orchestration Service"} | 1 |
| d1e48d0500b341ccad61816eb1201c05 | cloudformation | {"name": "heat", "description": "Heat CloudFormation Service"} | 1 |
| e961a94b4e254d01902fdca7a0a661ca | computev3 | {"name": "novav3", "description": "Nova Compute Service V3"} | 1 |
| f3ecd40c63f84350a44ab68d46bbd1a0 | ec2 | {"name": "ec2", "description": "EC2 Compatibility Layer"} | 1 |
+----------------------------------+----------------+------------------------------------------------------------------+---------+
mysql> select * from endpoint \G;
*************************** 1. row ***************************
id: 008038a70c5d4f149106aac58e12dd77
legacy_endpoint_id: ea4a785f2d1a4aaf98653c850e0358da
interface: admin
region: RegionOne
service_id: d1e48d0500b341ccad61816eb1201c05
url:
extra: {}
enabled: 1
*************************** 2. row ***************************
id: 0145e03a94b847dbb18d857a7fe04c0c
legacy_endpoint_id: 38293000a78a4d27a213f5d67343310a
interface: public
region: RegionOne
service_id: 4cf845fcefd44e59aa908bb669bebad1
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 3. row ***************************
id: 0a01abaf8d5d45568d992890cfe602bb
legacy_endpoint_id: e1a814273e4d4c1faa557b941e93b11f
interface: admin
region: RegionOne
service_id: 97e366ec9a9841199427c602817b9813
url:
extra: {}
enabled: 1
*************************** 4. row ***************************
id: 0d78edddc1b6414f845dd003f0ed73b9
legacy_endpoint_id: 22a69162c91846518a0313641d9e891e
interface: admin
region: RegionOne
service_id: e961a94b4e254d01902fdca7a0a661ca
url:
extra: {}
enabled: 1
*************************** 5. row ***************************
id: 1492454713294420ac2920c8e631f748
legacy_endpoint_id: 7344549890e14ee6bbfe71c4f027e369
interface: internal
region: RegionOne
service_id: 84894a519e534913921eb3b10ad38a2e
url:
extra: {}
enabled: 1
*************************** 6. row ***************************
id: 1492978dd65847acb9f55f1c3d876174
legacy_endpoint_id: 08beff62a7ff49a286b66570870c33fc
interface: internal
region: RegionOne
service_id: 51ae581ed2874098bdfe7e0e2183868f
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 7. row ***************************
id: 1a4cc94b917a407bae356580d7b300c1
legacy_endpoint_id: 08beff62a7ff49a286b66570870c33fc
interface: admin
region: RegionOne
service_id: 51ae581ed2874098bdfe7e0e2183868f
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 8. row ***************************
id: 1eb514943a4d42238577859c6a46b10e
legacy_endpoint_id: 5679e207fe494a7282fd9de7de19049d
interface: admin
region: RegionOne
service_id: 9b539c4abfa749cab022de849568758e
url:
extra: {}
enabled: 1
*************************** 9. row ***************************
id: 3ee42d86be034fa09a9a9d97a13a8091
legacy_endpoint_id: 5cb29b7c669949f4bb5220d3800955e8
interface: admin
region: RegionOne
service_id: a8a71c178a574c7e973be699bd416318
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 10. row ***************************
id: 4f4969aab49d453d939b7fdda9df2e39
legacy_endpoint_id: ea4a785f2d1a4aaf98653c850e0358da
interface: public
region: RegionOne
service_id: d1e48d0500b341ccad61816eb1201c05
url:
extra: {}
enabled: 1
*************************** 11. row ***************************
id: 51cdf31bfd6048638b36fc1ee8f4be76
legacy_endpoint_id: 04bde83abd584976a73418c6ac6af475
interface: public
region: RegionOne
service_id: cc2f59b2e4f140b09a58cacae3cfebe3
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 12. row ***************************
id: 5d61009356c04d5eb1b66927d43ae131
legacy_endpoint_id: 5679e207fe494a7282fd9de7de19049d
interface: internal
region: RegionOne
service_id: 9b539c4abfa749cab022de849568758e
url:
extra: {}
enabled: 1
*************************** 13. row ***************************
id: 5f7df636d6674e55b0e02d67745f10b7
legacy_endpoint_id: 04bde83abd584976a73418c6ac6af475
interface: admin
region: RegionOne
service_id: cc2f59b2e4f140b09a58cacae3cfebe3
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 14. row ***************************
id: 64672f5adc1242c48aa0e91324ec7ecc
legacy_endpoint_id: 5679e207fe494a7282fd9de7de19049d
interface: public
region: RegionOne
service_id: 9b539c4abfa749cab022de849568758e
url:
extra: {}
enabled: 1
*************************** 15. row ***************************
id: 7893004b83ea48faaf953db5f345a872
legacy_endpoint_id: 38293000a78a4d27a213f5d67343310a
interface: internal
region: RegionOne
service_id: 4cf845fcefd44e59aa908bb669bebad1
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 16. row ***************************
id: 85e468f1ebbc45bbaca65497bf302df4
legacy_endpoint_id: 7344549890e14ee6bbfe71c4f027e369
interface: admin
region: RegionOne
service_id: 84894a519e534913921eb3b10ad38a2e
url:
extra: {}
enabled: 1
*************************** 17. row ***************************
id: 85faa43233d047b28c2c6a5f40c332b9
legacy_endpoint_id: 38293000a78a4d27a213f5d67343310a
interface: admin
region: RegionOne
service_id: 4cf845fcefd44e59aa908bb669bebad1
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 18. row ***************************
id: 8d272ca2bba14976afbbf43bf6d66b77
legacy_endpoint_id: ea4a785f2d1a4aaf98653c850e0358da
interface: internal
region: RegionOne
service_id: d1e48d0500b341ccad61816eb1201c05
url:
extra: {}
enabled: 1
*************************** 19. row ***************************
id: a10e6c3a870141cd8997379efc92a7f1
legacy_endpoint_id: 08beff62a7ff49a286b66570870c33fc
interface: public
region: RegionOne
service_id: 51ae581ed2874098bdfe7e0e2183868f
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 20. row ***************************
id: a14f2ed9886f4f35be71f41b7fb9ff9c
legacy_endpoint_id: 5cb29b7c669949f4bb5220d3800955e8
interface: internal
region: RegionOne
service_id: a8a71c178a574c7e973be699bd416318
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 21. row ***************************
id: ae89854dee3e40bbab0579c304d7ef0c
legacy_endpoint_id: 04bde83abd584976a73418c6ac6af475
interface: internal
region: RegionOne
service_id: cc2f59b2e4f140b09a58cacae3cfebe3
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 22. row ***************************
id: b2715810826946b4bd06cff41bccd5ce
legacy_endpoint_id: 82bef266b8054e799acfb4506cd38e9c
interface: internal
region: RegionOne
service_id: f3ecd40c63f84350a44ab68d46bbd1a0
url:
extra: {}
enabled: 1
*************************** 23. row ***************************
id: ba0a89d9229d45ed9ebe057a0e83184d
legacy_endpoint_id: 22a69162c91846518a0313641d9e891e
interface: public
region: RegionOne
service_id: e961a94b4e254d01902fdca7a0a661ca
url:
extra: {}
enabled: 1
*************************** 24. row ***************************
id: cbc1cf7ddf994024bdcde690ea4d893b
legacy_endpoint_id: 7344549890e14ee6bbfe71c4f027e369
interface: public
region: RegionOne
service_id: 84894a519e534913921eb3b10ad38a2e
url:
extra: {}
enabled: 1
*************************** 25. row ***************************
id: cc04af2376324ef990bd8d6f5b7f0d65
legacy_endpoint_id: 5cb29b7c669949f4bb5220d3800955e8
interface: public
region: RegionOne
service_id: a8a71c178a574c7e973be699bd416318
url: (tenant_id)s
extra: {}
enabled: 1
*************************** 26. row ***************************
id: d15b44ec3fd84266bc0d433e446c97ec
legacy_endpoint_id: e1a814273e4d4c1faa557b941e93b11f
interface: public
region: RegionOne
service_id: 97e366ec9a9841199427c602817b9813
url:
extra: {}
enabled: 1
*************************** 27. row ***************************
id: ef337626840b425690889a12cedc4e9f
legacy_endpoint_id: 82bef266b8054e799acfb4506cd38e9c
interface: public
region: RegionOne
service_id: f3ecd40c63f84350a44ab68d46bbd1a0
url:
extra: {}
enabled: 1
*************************** 28. row ***************************
id: f2e0a625db4b4a9485f1649fe7e38eb9
legacy_endpoint_id: 82bef266b8054e799acfb4506cd38e9c
interface: admin
region: RegionOne
service_id: f3ecd40c63f84350a44ab68d46bbd1a0
url:
extra: {}
enabled: 1
*************************** 29. row ***************************
id: f90b0ab397a340948cdf1d1c10d6b697
legacy_endpoint_id: e1a814273e4d4c1faa557b941e93b11f
interface: internal
region: RegionOne
service_id: 97e366ec9a9841199427c602817b9813
url:
extra: {}
enabled: 1
*************************** 30. row ***************************
id: fbfa8c3b91a34507bbe98c130bf89b06
legacy_endpoint_id: 22a69162c91846518a0313641d9e891e
interface: internal
region: RegionOne
service_id: e961a94b4e254d01902fdca7a0a661ca
url:
extra: {}
enabled: 1
30 rows in set (0.00 sec)