4.8. 使用 Compute 服务


要采用 Compute 服务(nova),您可以修补禁用 Compute 服务的现有 OpenStackControlPlane 自定义资源(CR)。补丁使用 Red Hat OpenStack Platform (RHOSP)环境提供的配置参数启动服务。以下流程描述了单单元设置。

先决条件

  • 您已完成了以前的采用步骤。
  • 您已定义以下 shell 变量:将以下示例值替换为您的环境的正确值:

    alias openstack="oc exec -t openstackclient -- openstack"
    
    DEFAULT_CELL_NAME="cell3"
    RENAMED_CELLS="cell1 cell2 $DEFAULT_CELL_NAME"
    Copy to Clipboard Toggle word wrap
    • 源云 默认单元 使用一个新的 $DEFAULT_CELL_NAME。在多单元采用场景中,默认的 单元可能会保留其原始名称DEFAULT_CELL_NAME=default,或者被重命名为免费使用的单元。除了默认的,请不要将其他现有的单元名称用于 DEFAULT_CELL_NAME
    • 如果您使用 默认单元 部署源云,并希望在采用过程中重命名它,请定义您要使用的新名称,如下例所示:

      DEFAULT_CELL_NAME="cell1"
      RENAMED_CELLS="cell1"
      Copy to Clipboard Toggle word wrap

流程

  1. OpenStackControlPlane CR 进行补丁来部署 Compute 服务:

    注意

    此流程假设 Compute 服务元数据部署在顶层,而不是在每个单元级别。如果 RHOSP 部署有每单元元数据部署,请根据需要调整以下补丁。您不能在 cell0 中运行元数据服务。要启用本地单元的元数据服务,请在 OpenStackControlPlane CR 中的 local cell 的 metadataServiceTemplate 字段中将 enabled 属性设置为 true

    $ rm -f celltemplates
    for CELL in $(echo $RENAMED_CELLS); do
     $ cat >> celltemplates << EOF
            ${CELL}:
              hasAPIAccess: true 
    1
    
              cellDatabaseAccount: nova-$CELL
              cellDatabaseInstance: openstack-$CELL 
    2
    
              cellMessageBusInstance: rabbitmq-$CELL 
    3
    
              metadataServiceTemplate:
                enabled: false
                override:
                    service:
                      metadata:
                        annotations:
                          metallb.universe.tf/address-pool: internalapi
                          metallb.universe.tf/allow-shared-ip: internalapi
                          metallb.universe.tf/loadBalancerIPs: 172.17.0.$(( 79 + ${CELL##*cell} ))
                      spec:
                        type: LoadBalancer
                customServiceConfig: |
                  [workarounds]
                  disable_compute_service_check_for_ffu=true
              conductorServiceTemplate:
                customServiceConfig: |
                  [workarounds]
                  disable_compute_service_check_for_ffu=true
    EOF
    done
    
    $ cat > oscp-patch.yaml << EOF
    spec:
      nova:
        enabled: true
        apiOverride:
          route: {}
        template:
          secret: osp-secret
          apiDatabaseAccount: nova-api
          apiServiceTemplate:
            override:
              service:
                internal:
                  metadata:
                    annotations:
                      metallb.universe.tf/address-pool: internalapi
                      metallb.universe.tf/allow-shared-ip: internalapi
                      metallb.universe.tf/loadBalancerIPs: 172.17.0.80 
    4
    
                  spec:
                    type: LoadBalancer
            customServiceConfig: |
              [workarounds]
              disable_compute_service_check_for_ffu=true
          metadataServiceTemplate:
            enabled: true
            override:
              service:
                metadata:
                  annotations:
                    metallb.universe.tf/address-pool: internalapi
                    metallb.universe.tf/allow-shared-ip: internalapi
                    metallb.universe.tf/loadBalancerIPs: 172.17.0.80
                spec:
                  type: LoadBalancer
            customServiceConfig: |
              [workarounds]
              disable_compute_service_check_for_ffu=true
          schedulerServiceTemplate:
            customServiceConfig: |
              [workarounds]
              disable_compute_service_check_for_ffu=true
          cellTemplates:
            cell0:
              hasAPIAccess: true
              cellDatabaseAccount: nova-cell0
              cellDatabaseInstance: openstack
              cellMessageBusInstance: rabbitmq
              conductorServiceTemplate:
                customServiceConfig: |
                  [workarounds]
                  disable_compute_service_check_for_ffu=true
    EOF
    $ cat celltemplates >> oscp-patch.yaml
    $ oc patch openstackcontrolplane openstack  --type=merge --patch-file=oscp-patch.yaml
    Copy to Clipboard Toggle word wrap
    1
    在源云中,单元总是配置有主要 Nova API 数据库访问。您可以通过将 hasAPIAccess 设置为 false 来禁用对 API 的 upcall 访问。但是,在采用过程中不要更改 API。
    2
    单元使用的数据库实例。在部署后端服务时,数据库实例名称必须与您在部署后端服务时创建的 OpenStackControlPlane CR 中定义的名称匹配,如 部署后端服务 中所述。
    3
    单元使用的消息总线实例。消息总线实例名称必须与 OpenStackControlPlane CR 中定义的名称匹配。
    4
    如果使用 IPv6,请将负载均衡器 IP 更改为环境中的负载均衡器 IP,如 metallb.universe.tf/loadBalancerIPs: fd00:bbbb::80
  2. 如果您使用 Compute 服务与 Bare Metal Provisioning 服务(ironic),请在 Compute 服务 CR 补丁中的每个单元格中附加 novaComputeTemplates 字段。例如:

            cell1:
              novaComputeTemplates:
                standalone:
                  customServiceConfig: |
                    [DEFAULT]
                    host = <hostname>
                    [workarounds]
                    disable_compute_service_check_for_ffu=true
                  computeDriver: ironic.IronicDriver
            ...
    Copy to Clipboard Toggle word wrap
    • &lt;hostname> 替换为在源云中运行 ironic Compute 驱动程序的节点主机名。
  3. 等待 CR 就绪计算 control plane 服务:

    $ oc wait --for condition=Ready --timeout=300s Nova/nova
    Copy to Clipboard Toggle word wrap
    注意

    每个单元启动本地 Conductor 服务,而超级编排器在 cell0 中运行。请注意, disable_compute_service_check_for_ffu 对所有导入的 Compute 服务是必须的,直到导入外部数据平面前,直到 Compute 服务被快速升级为止。如需更多信息,请参阅将 Compute 服务部署到 RHOSO 数据平面 ,并对计算服务执行快速升级

验证

  • 检查计算服务端点是否已定义并指向 control plane FQDN,并且 Nova API 是否响应:

    $ openstack endpoint list | grep nova
    $ openstack server list
    Copy to Clipboard Toggle word wrap
  • 查询超级编排器,以检查预期的单元是否存在,并将其与其预选项值进行比较:

    $ for CELL in $(echo $CELLS); do
      set +u
      . ~/.source_cloud_exported_variables_$CELL
      set -u
      RCELL=$CELL
      [ "$CELL" = "default" ] && RCELL=$DEFAULT_CELL_NAME
    
      echo "comparing $CELL to $RCELL"
      echo $PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS | grep -F "| $CELL |"
    $ oc rsh nova-cell0-conductor-0 nova-manage cell_v2 list_cells | grep -F "| $RCELL |"
    done
    Copy to Clipboard Toggle word wrap

    每个单元都应该有以下更改:

    • cellX nova 数据库和用户名变为 nova_cellX
    • 默认单元 重命名为 DEFAULT_CELL_NAME。如果有多个单元,默认单元 可能会保留原始名称。
    • RabbitMQ 传输 URL 不再使用 客户机
注意

此时,计算服务 control plane 服务不控制现有的计算服务工作负载。control plane 仅在数据采用过程完成后管理数据平面。如需更多信息,请参阅将 Compute 服务部署到 RHOSO 数据平面

重要

要将外部 Compute 服务导入到 RHOSO 数据平面,您必须首先升级它们。如需更多信息,请参阅将 Compute 服务部署到 RHOSO 数据平面,以及对 计算服务执行快速升级

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat