5.3. 在计算服务上执行快速升级
您必须完成以下任务,将 control plane 和数据平面上的 Red Hat OpenStack Platform 17.1 升级到 OpenShift (RHOSO) 18.0 上的 Compute 服务:
- 更新 cell1 Compute data plane 服务版本。
- 从 Compute control plane 服务和计算数据平面服务中删除前向升级临时解决方案。
- 运行 Compute 数据库在线迁移以更新实时数据。
先决条件
定义为每个 Compute 服务单元应用快速转发升级命令所需的 shell 变量。
DEFAULT_CELL_NAME="cell1" RENAMED_CELLS="$DEFAULT_CELL_NAME" declare -A PODIFIED_DB_ROOT_PASSWORD for CELL in $(echo "super $RENAMED_CELLS"); do PODIFIED_DB_ROOT_PASSWORD[$CELL]=$(oc get -o json secret/osp-secret | jq -r .data.DbRootPassword | base64 -d) done- 完成 将计算服务到 RHOSO 数据平面 的步骤。
流程
等待 Compute 服务数据平面服务版本为所有单元更新:
$ for CELL in $(echo $RENAMED_CELLS); do > oc exec openstack-$CELL-galera-0 -c galera -- mysql -rs -uroot -p"${PODIFIED_DB_ROOT_PASSWORD[$CELL]}" \ > -e "select a.version from nova_${CELL}.services a join nova_${CELL}.services b where a.version!=b.version and a.binary='nova-compute' and a.deleted=0;" > done注意更新完成后,查询会返回空结果。对于虚拟机工作负载,预计不会停机。
查看 data plane 上的 nova Compute 代理日志中的任何错误,以及 control plane 上的
nova-conductor日志记录。对
OpenStackControlPlaneCR 进行补丁,以删除 Compute control plane 服务中的前向升级临时解决方案:$ rm -f celltemplates $ for CELL in $(echo $RENAMED_CELLS); do $ cat >> celltemplates << EOF ${CELL}: metadataServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false conductorServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false EOF done $ cat > oscp-patch.yaml << EOF spec: nova: template: apiServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false metadataServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false schedulerServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false cellTemplates: cell0: conductorServiceTemplate: customServiceConfig: | [workarounds] disable_compute_service_check_for_ffu=false EOF $ cat celltemplates >> oscp-patch.yaml如果您使用 Compute 服务与裸机置备服务(ironic),请在 Compute 服务 CR 补丁的
cell<X> 部分中追加以下novaComputeTemplates:cell<X>: novaComputeTemplates: <hostname>:1 customServiceConfig: | [DEFAULT] host = <hostname> [workarounds] disable_compute_service_check_for_ffu=true computeDriver: ironic.IronicDriver ...- 1
- 将
<hostname> 替换为在cell<X> 源云中运行。ironicCompute 驱动程序的节点主机名
应用补丁文件:
$ oc patch openstackcontrolplane openstack --type=merge --patch-file=oscp-patch.yaml等待 Compute control plane 服务 CR 就绪:
$ oc wait --for condition=Ready --timeout=300s Nova/nova从 Compute data plane 服务中删除预先转发的升级临时解决方案:
$ oc patch cm nova-cells-global-config --type=json -p='[{"op": "replace", "path": "/data/99-nova-compute-cells-workarounds.conf", "value": "[workarounds]\n"}]' $ for CELL in $(echo $RENAMED_CELLS); do $ oc get Openstackdataplanenodeset openstack-${CELL} || continue $ oc apply -f - <<EOF --- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: openstack-nova-compute-ffu-$CELL spec: nodeSets: - openstack-${CELL} servicesOverride: - nova-${CELL} backoffLimit: 3 EOF done等待 Compute data plane 服务准备所有单元:
$ oc wait --for condition=Ready openstackdataplanedeployments --all --timeout=5m运行 Compute 数据库在线迁移来完成升级:
$ oc exec -it nova-cell0-conductor-0 -- nova-manage db online_data_migrations $ for CELL in $(echo $RENAMED_CELLS); do $ oc exec -it nova-${CELL}-conductor-0 -- nova-manage db online_data_migrations done在单元格中发现 Compute 主机:
$ oc rsh nova-cell0-conductor-0 nova-manage cell_v2 discover_hosts --verbose验证现有测试虚拟机实例是否正在运行:
${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test 2>&1 || echo FAIL验证 Compute 服务是否可以停止现有的测试虚拟机实例:
${BASH_ALIASES[openstack]} server list -c Name -c Status -f value | grep -qF "test ACTIVE" && ${BASH_ALIASES[openstack]} server stop test || echo PASS ${BASH_ALIASES[openstack]} server list -c Name -c Status -f value | grep -qF "test SHUTOFF" || echo FAIL ${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test 2>&1 || echo PASS验证 Compute 服务是否可以启动现有的测试虚拟机实例:
${BASH_ALIASES[openstack]} server list -c Name -c Status -f value | grep -qF "test SHUTOFF" && ${BASH_ALIASES[openstack]} server start test || echo PASS ${BASH_ALIASES[openstack]} server list -c Name -c Status -f value | grep -qF "test ACTIVE" && \ ${BASH_ALIASES[openstack]} server --os-compute-api-version 2.48 show --diagnostics test --fit-width -f json | jq -r '.state' | grep running || echo FAIL
后续步骤
在 data plane 采用后,计算主机将继续运行 Red Hat Enterprise Linux (RHEL) 9.2。要利用 RHEL 9.4,请在完成采用过程后执行次要更新过程。