8.2. 启用统一限制
要启用统一限制,您必须为每个单元配置 nova-api 服务和 nova-conductor 服务。您还可以定义需要或忽略注册的限制的资源列表。
处于 ERROR 状态的服务器永远不会被调度到计算主机没有放置分配,因此它不会消耗内核和 RAM 的配额使用量。
SHELVED_OFFLOADED 状态的服务器没有放置分配,因此它不会消耗内核和 RAM 的配额使用量。因此,如果用户没有足够的配额支持服务器被取消缩小,则对服务器取消添加服务器的请求可能会被拒绝。
当您启用统一限制时,在服务器调整大小过程中会造成配额使用,直到调整大小完成为止。如需更多信息,请参阅 https://bugs.launchpad.net/nova/+bug/1790204。)
流程
对于每个项目配额的配额强制,请将
reader角色添加到 Compute 服务用户中:$ oc exec openstackclient -- openstack role add --user nova --user-domain <service_domain_name> --system all reader-
将
<service_domain_name> 替换为服务域名的名称。
-
将
检索 Compute 服务端点 ID。您需要这个值来配置
nova-api和nova-conductor服务:$ oc exec openstackclient -- openstack endpoint list --service nova -f value -c ID-
在工作站上打开
OpenStackControlPlane自定义资源(CR)文件openstack_control_plane.yaml。 在
openstack_control_plane.yaml中配置nova-api和nova-conductor服务。将driver参数设置为nova.quota.UnifiedLimitsDriver。您必须定义在apiServiceTemplate.customServiceConfig和每个单元的conductorServiceTemplate.customServiceConfig中上一步中检索的 Compute 服务endpoint_id。简单示例 :
apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane spec: nova: template: apiServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver [oslo_limit] endpoint_id = <service_endpoint_id> cellTemplates: cell0: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver [oslo_limit] endpoint_id = <service_endpoint_id> cell1: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver [oslo_limit] endpoint_id = <service_endpoint_id>将
<service_endpoint_id> 替换为您在上一步中检索的 Compute 服务端点 ID。注意如果添加单元,还必须配置新单元以统一限制。要添加新的单元,请参阅 自定义 Red Hat OpenStack Services on OpenShift 部署 指南中的将 计算单元添加到 control plane 中。
可选:通过设置
unified_limits_resource_list参数,将[quota]统一限制资源策略配置为忽略或要求注册的限制。默认策略是require,默认资源列表包含服务器:带有资源策略的示例配置示例
需要:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane spec: nova: template: apiServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = require # Do not allow allocation of a resource in this list unless it has # a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id> cellTemplates: cell0: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = require # Do not allow allocation of a resource in this list unless it has # a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id> cell1: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = require # Do not allow allocation of a resource in this list unless it has # a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id>带有资源策略的示例配置示例
忽略:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane spec: nova: template: apiServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = ignore # Allow unlimited allocation of a resource in this list unless it # has a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id> cellTemplates: cell0: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = ignore # Allow unlimited allocation of a resource in this list unless it # has a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id> cell1: conductorServiceTemplate: customServiceConfig: | [quota] driver = nova.quota.UnifiedLimitsDriver unified_limits_resource_strategy = ignore # Allow unlimited allocation of a resource in this list unless it # has a limit set in Keystone. unified_limits_resource_list = servers,class:VCPU,class:MEMORY_MB,class:DISK_GB [oslo_limit] endpoint_id = <service_endpoint_id>更新 control plane:
$ oc apply -f openstack_control_plane.yaml -n openstack等待 Red Hat OpenShift Container Platform (RHOCP)创建与
OpenStackControlPlaneCR 相关的资源。运行以下命令来检查状态:$ oc get openstackcontrolplane -n openstack当状态为
Setup complete时,会创建OpenStackControlPlane资源。提示将
-w选项附加到get命令的末尾,以跟踪部署进度。-
可选:查看您创建的每个单元的
openstack命名空间中的 pod,以确认部署了 control plane。当所有 pod 都已完成或运行时,会部署 control plane。
其他资源