openstack 命令行管理三 - tenant 管理 (备忘)



project 等同于 tenants
OpenStack Compute Service (nova) 作为认证时候, 称为 project
OpenStack Identity Service (keystone) 作为认证时候, 称为 tenants

添加用户前需要添加对应 project

keystone 命令帮助
    tenant-create       Create new tenant.
    tenant-delete       Delete tenant.
    tenant-get          Display tenant details.
    tenant-list         List all tenants.
    tenant-update       Update tenant name, description, enabled status.
    bootstrap           Grants a new role to a new user on a new tenant, after
  --os-tenant-name <auth-tenant-name>
  --os-tenant-id <tenant-id>


添加 tenant

[root@station140 ~(keystone_admin)]# keystone tenant-create --name cloud
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | 9467f30b8bba4770a06a687e4584636b |   <- 创建后, 使用 keystone tenant-get cloud 能够重新调回信息
|     name    |              cloud               |
+-------------+----------------------------------+

列出 tenant

[root@station140 ~(keystone_admin)]# keystone tenant-list
+----------------------------------+----------+---------+
|                id                |   name   | enabled |
+----------------------------------+----------+---------+
| e3a71a59840c4e88b8740b789c3afb9c |  admin   |   True  |
| fa30a4cd2eba46f0b58d591b7335d660 | alt_demo |   True  |
| 9467f30b8bba4770a06a687e4584636b |  cloud   |   True  |
| 87c63116e3b4440eaa9640494b53cd43 |   demo   |   True  |
| bc95edec7a674bb8873d067d9ddedaec | services |   True  |
+----------------------------------+----------+---------+

更新信息
[root@station140 ~(keystone_admin)]# keystone tenant-update --description="use for test." --enabled=true cloud
[root@station140 ~(keystone_admin)]# keystone tenant-get cloud
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |          use for test.           |
|   enabled   |               True               |
|      id     | 9467f30b8bba4770a06a687e4584636b |
|     name    |              cloud               |
+-------------+----------------------------------+


你可能感兴趣的:(openstack)