您的位置:首页 > 运维架构

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

2014-02-18 18:14 816 查看
Openstack 中, 以租户作为云主机隔离的单位

project 等同于 tenant

OpenStack Compute Service (nova) 作为认证时候, 称为 project

OpenStack Identity Service (keystone) 作为认证时候, 称为 tenant

在管理 openstack 时候, 需要添加独立的 project, 然后每个 project 具有独立的用户, 网络, 云主机

添加用户前需要添加对应 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               |
+-------------+----------------------------------+


删除 tenant

keystone tenant-delete 9467f30b8bba4770a06a687e4584636b
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: