本帖最后由 pig2 于 2014-8-28 19:11 编辑
问题导读
1、如何使用keystone 命令帮助 ?
2、如何使用nova资源管理帮助?
3、怎样添加和列出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- 资源管理
配额可限制 tenants 用光资源, 如浮动 IP, 内存, CPU 等
资源管理帮助
- [root@station140 ~(keystone_admin)]# nova help | grep quota
- quota-class-show List the quotas for a quota class.
- quota-class-update Update the quotas for a quota class.
- quota-defaults List the default quotas for a tenant.
- quota-delete Delete quota for a tenant/user so their quota will
- quota-show List the quotas for a tenant/user.
- quota-update Update the quotas for a tenant/user.
复制代码
可管理资源
- fixed-ips 每个 project 可用固定 IP 地址, 必须大于等于实例可用的 IP 地址数量
- floating-ips 每个 project 可用的浮动 IP 地址
- injected-file-content-bytes 添加的文件最大可包含多少 bytes
- injected-file-path-bytes 指定的文件目录下最大可包含的文件 bytes
- injected-files 每个 project可以包含的文件数量
- instances 每个 project可包含的最多的 instances 数量
- key-pairs 每个用户可用的 key-pairs 的数量
- metadata-items 每个实例可拥有的 metadata-items 数量
- ram 允许每个 project 中的 instances 可用的 ram (MB) 数量
- security-group-rules 可用的安全组规则
- security-groups 每个 project 的安全组
- cores 每个 project可用的虚拟 CPU 个数
复制代码
显示
- [root@station140 ~(keystone_admin)]# nova quota-defaults
- +-----------------------------+-------+
- | Quota | Limit |
- +-----------------------------+-------+
- | instances | 10 |
- | cores | 20 |
- | ram | 51200 |
- | floating_ips | 10 |
- | fixed_ips | -1 |
- | metadata_items | 128 |
- | injected_files | 5 |
- | injected_file_content_bytes | 10240 |
- | injected_file_path_bytes | 255 |
- | key_pairs | 100 |
- | security_groups | 10 |
- | security_group_rules | 20 |
- +-----------------------------+-------+
复制代码
更新方法
- [root@station140 ~(keystone_admin)]# nova quota-class-update --instances 20 default
- [root@station140 ~(keystone_admin)]# nova quota-defaults
- +-----------------------------+-------+
- | Quota | Limit |
- +-----------------------------+-------+
- | instances | 20 |
复制代码
|