8.2. 启用统一限制


要启用统一限制,您必须为每个单元配置 nova-api 服务和 nova-conductor 服务。您还可以定义需要或忽略注册的限制的资源列表。

重要

处于 ERROR 状态的服务器永远不会被调度到计算主机没有放置分配,因此它不会消耗内核和 RAM 的配额使用量。

SHELVED_OFFLOADED 状态的服务器没有放置分配,因此它不会消耗内核和 RAM 的配额使用量。因此,如果用户没有足够的配额支持服务器被取消缩小,则对服务器取消添加服务器的请求可能会被拒绝。

当您启用统一限制时,在服务器调整大小过程中会造成配额使用,直到调整大小完成为止。如需更多信息,请参阅 https://bugs.launchpad.net/nova/+bug/1790204。

流程

  1. 对于每个项目配额的配额强制,请将 reader 角色添加到 Compute 服务用户中:

    $ oc exec openstackclient -- openstack role add --user nova --user-domain <service_domain_name> --system all reader
    • <service_domain_name > 替换为服务域名的名称。
  2. 检索 Compute 服务端点 ID。您需要这个值来配置 nova-apinova-conductor 服务:

    $ oc exec openstackclient -- openstack endpoint list --service nova -f value -c ID
  3. 在工作站上打开 OpenStackControlPlane 自定义资源(CR)文件 openstack_control_plane.yaml
  4. openstack_control_plane.yaml 中配置 nova-apinova-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 中。

  5. 可选:通过设置 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>
  6. 更新 control plane:

    $ oc apply -f openstack_control_plane.yaml -n openstack
  7. 等待 Red Hat OpenShift Container Platform (RHOCP)创建与 OpenStackControlPlane CR 相关的资源。运行以下命令来检查状态:

    $ oc get openstackcontrolplane -n openstack

    当状态为 Setup complete 时,会创建 OpenStackControlPlane 资源。

    提示

    -w 选项附加到 get 命令的末尾,以跟踪部署进度。

  8. 可选:查看您创建的每个单元的 openstack 命名空间中的 pod,以确认部署了 control plane。当所有 pod 都已完成或运行时,会部署 control plane。

其他资源

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部