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

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Terry_Tsang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值