问题导读
1、怎样把用户添加到某个角色中?
2、如何使用服务管理的帮助命令?
3、如何关闭和重启某个服务?
帮助
- [root@station140 ~(keystone_admin)]# keystone help | grep role
- role-create Create new role.
- role-delete Delete role.
- role-get Display role details.
- role-list List all roles.
- user-role-add Add role to user
- user-role-list List roles granted to a user
- user-role-remove Remove role from user
- bootstrap Grants a new role to a new user on a new tenant, after
复制代码
创建方法
- [root@station140 ~(keystone_admin)]# keystone role-create --name vgroup
- +----------+----------------------------------+
- | Property | Value |
- +----------+----------------------------------+
- | id | 9ea4fb60241c4a12b3c89630cf3f087a |
- | name | vgroup |
- +----------+----------------------------------+
复制代码
把用户添加到某个角色中方法
- [root@station140 ~(keystone_admin)]# keystone user-role-add --user terry --role vgroup --tenant cloud
复制代码
显示角色中的用户方法
- [root@station140 ~(keystone_admin)]# keystone user-role-list --user terry --tenant cloud <- 必须的参数
- +----------------------------------+----------+----------------------------------+----------------------------------+
- | id | name | user_id | tenant_id |
- +----------------------------------+----------+----------------------------------+----------------------------------+
- | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | 8f6478593aa845b3b44eded4aade0f6f | 9467f30b8bba4770a06a687e4584636b |
- | 9ea4fb60241c4a12b3c89630cf3f087a | vgroup | 8f6478593aa845b3b44eded4aade0f6f | 9467f30b8bba4770a06a687e4584636b |
- +----------------------------------+----------+----------------------------------+----------------------------------+
复制代码
移除角色中的某个用户
- [root@station140 ~(keystone_admin)]# keystone user-role-remove --user terry --role vgroup --tenant cloud
复制代码
openstack 命令行管理:服务管理
帮助
- [root@station140 tmp(keystone_admin)]# keystone help | grep service
- service-create Add service to Service Catalog.
- service-delete Delete service from Service Catalog.
- service-get Display service from Service Catalog.
- service-list List all services in Service Catalog.
复制代码
列出当前的服务方法
- [root@station140 tmp(keystone_admin)]# keystone service-list
- +----------------------------------+------------+--------------+--------------------------------+
- | id | name | type | description |
- +----------------------------------+------------+--------------+--------------------------------+
- | 4db88c4e3efe4f188b6f08756d28c407 | ceilometer | metering | Openstack Metering Service |
- | e4ce5457b38e4a50a929af9b2b02b81c | cinder | volume | Cinder Service |
- | ab1e6db2a7b54a459f928075263a8b0f | cinder_v2 | volumev2 | Cinder Service v2 |
- | f025dc6a95db40f586b6975b154465b9 | glance | image | Openstack Image Service |
- | 04a34fae776c4573a4d26ccca9407ec9 | keystone | identity | OpenStack Identity Service |
- | 39f89e436d4942a1b2349e02cfddbed2 | neutron | network | Neutron Networking Service |
- | 60796518d55347f981ce319121c5e6bf | nova | compute | Openstack Compute Service |
- | 7867dcf1ec1647efa2287344c2f00775 | nova_ec2 | ec2 | EC2 Service |
- | 743203738a074f5bac198be5e52977d8 | swift | object-store | Openstack Object-Store Service |
- | 8b7b18fc6b7c4f169b10282252c0571c | swift_s3 | s3 | Openstack S3 Service |
- +----------------------------------+------------+--------------+--------------------------------+
复制代码
服务管理帮助
- [root@station140 tmp(keystone_admin)]# nova help | grep service
- [--service-type <service-type>] [--service-name <service-name>]
- [--volume-service-name <volume-service-name>]
- authenticate services.
- host-list List all hosts by service.
- service-disable Disable the service.
- service-enable Enable the service.
- service-list Show a list of all running services. Filter by host &
- --service-type <service-type>
- --service-name <service-name>
- --volume-service-name <volume-service-name>
复制代码
列出 openstack 当前可用的服务器
- [root@station140 tmp(keystone_admin)]# nova host-list
- +----------------------+-------------+----------+
- | host_name | service | zone |
- +----------------------+-------------+----------+
- | station140.cloud.com | consoleauth | internal |
- | station140.cloud.com | scheduler | internal |
- | station140.cloud.com | conductor | internal |
- | station140.cloud.com | compute | nova |
- | station140.cloud.com | cert | internal |
- +----------------------+-------------+----------+
复制代码
注: 当前使用 all in one 模式, 所以只返回一个 host_name 结果
列出主机上的服务状态
- [root@station140 tmp(keystone_admin)]# nova service-list
- +------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
- | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
- +------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
- | nova-consoleauth | station140.cloud.com | internal | enabled | up | 2014-02-14T08:40:37.000000 | None |
- | nova-scheduler | station140.cloud.com | internal | enabled | up | 2014-02-14T08:40:37.000000 | None |
- | nova-conductor | station140.cloud.com | internal | enabled | up | 2014-02-14T08:40:38.000000 | None |
- | nova-compute | station140.cloud.com | nova | enabled | up | 2014-02-14T08:40:29.000000 | None |
- | nova-cert | station140.cloud.com | internal | enabled | up | 2014-02-14T08:40:33.000000 | None |
- +------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
复制代码
关闭某个服务:
- nova service-disable localhost.localdomain nova-compute --reason 'trial log' <- just test
复制代码
重新启动服务
- nova service-enable localhost.localdomain nova-compute
复制代码
|