管理计算服务¶
您可以启用和禁用计算服务。以下示例禁用并启用 nova-compute 服务。
列出计算服务
$ openstack compute service list +----+----------------+------------+----------+---------+-------+----------------------------+ | ID | Binary | Host | Zone | Status | State | Updated At | +----+----------------+------------+----------+---------+-------+----------------------------+ | 4 | nova-scheduler | controller | internal | enabled | up | 2016-12-20T00:44:48.000000 | | 5 | nova-conductor | controller | internal | enabled | up | 2016-12-20T00:44:54.000000 | | 8 | nova-compute | compute | nova | enabled | up | 2016-10-21T02:35:03.000000 | +----+----------------+------------+----------+---------+-------+----------------------------+
禁用 nova 服务
$ openstack compute service set --disable --disable-reason "trial log" compute nova-compute +----------+--------------+----------+-------------------+ | Host | Binary | Status | Disabled Reason | +----------+--------------+----------+-------------------+ | compute | nova-compute | disabled | trial log | +----------+--------------+----------+-------------------+
检查服务列表
$ openstack compute service list +----+----------------+------------+----------+---------+-------+----------------------------+ | ID | Binary | Host | Zone | Status | State | Updated At | +----+----------------+------------+----------+---------+-------+----------------------------+ | 5 | nova-scheduler | controller | internal | enabled | up | 2016-12-20T00:44:48.000000 | | 6 | nova-conductor | controller | internal | enabled | up | 2016-12-20T00:44:54.000000 | | 9 | nova-compute | compute | nova | disabled| up | 2016-10-21T02:35:03.000000 | +----+----------------+------------+----------+---------+-------+----------------------------+
启用该服务
$ openstack compute service set --enable compute nova-compute +----------+--------------+---------+ | Host | Binary | Status | +----------+--------------+---------+ | compute | nova-compute | enabled | +----------+--------------+---------+