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"-
源云
默认单元使用一个新的$DEFAULT_CELL_NAME。在多单元采用场景中,默认的 单元可能会保留其原始名称DEFAULT_CELL_NAME=default,或者被重命名为免费使用的单元。除了默认的,请不要将其他现有的单元名称用于DEFAULT_CELL_NAME。 如果您使用
默认单元部署源云,并希望在采用过程中重命名它,请定义您要使用的新名称,如下例所示:DEFAULT_CELL_NAME="cell1" RENAMED_CELLS="cell1"
-
源云
流程
对
OpenStackControlPlaneCR 进行补丁来部署 Compute 服务:注意此流程假设 Compute 服务元数据部署在顶层,而不是在每个单元级别。如果 RHOSP 部署有每单元元数据部署,请根据需要调整以下补丁。您不能在
cell0中运行元数据服务。要启用本地单元的元数据服务,请在OpenStackControlPlaneCR 中的 local cell 的metadataServiceTemplate字段中将enabled属性设置为true。$ rm -f celltemplates $ for CELL in $(echo $RENAMED_CELLS); do $ cat >> celltemplates << EOF ${CELL}: hasAPIAccess: true1 cellDatabaseAccount: nova-$CELL cellDatabaseInstance: openstack-$CELL2 cellMessageBusInstance: rabbitmq-$CELL3 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.804 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- 1
- 在源云中,单元总是配置有主要 Nova API 数据库访问。您可以通过将
hasAPIAccess设置为false来禁用对 API 的 upcall 访问。但是,在采用过程中不要更改 API。 - 2
- 单元使用的数据库实例。在部署后端服务时,数据库实例名称必须与您在部署后端服务时创建的
OpenStackControlPlaneCR 中定义的名称匹配,如 部署后端服务 中所述。 - 3
- 单元使用的消息总线实例。消息总线实例名称必须与
OpenStackControlPlaneCR 中定义的名称匹配。 - 4
- 如果使用 IPv6,请将负载均衡器 IP 更改为环境中的负载均衡器 IP,如
metallb.universe.tf/loadBalancerIPs: fd00:bbbb::80。
如果您使用 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 ...-
将
<hostname> 替换为在源云中运行ironicCompute 驱动程序的节点主机名。
-
将
等待 CR 就绪计算 control plane 服务:
$ oc wait --for condition=Ready --timeout=300s Nova/nova注意每个单元启动本地 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- 将输出与 Retrieving topology-specific service configuration 中的特定于拓扑的配置进行比较。
查询超级编排器,以检查预期的单元是否存在,并将其与其预选项值进行比较:
$ 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每个单元都应该有以下更改:
-
cellXnova数据库和用户名变为nova_cellX。 -
默认单元重命名为DEFAULT_CELL_NAME。如果有多个单元,默认单元可能会保留原始名称。 -
RabbitMQ 传输 URL 不再使用
客户机。
-
此时,计算服务 control plane 服务不控制现有的计算服务工作负载。control plane 仅在数据采用过程完成后管理数据平面。如需更多信息,请参阅将 Compute 服务部署到 RHOSO 数据平面。
要将外部 Compute 服务导入到 RHOSO 数据平面,您必须首先升级它们。如需更多信息,请参阅将 Compute 服务部署到 RHOSO 数据平面,以及对 计算服务执行快速升级。