4.15. 从 director 部署拉取配置
在启动 data plane 采用工作流前,从 Red Hat OpenStack Platform (RHOSP)服务和 director 备份配置。然后,您可以在配置所采用的服务期间使用文件,以确保不会丢失或错误配置。
先决条件
- 已安装并配置 os-diff 工具。如需更多信息,请参阅 对比部署之间的配置文件。
流程
根据您的环境在
os-diff.cfg中更新您的 ssh 参数。os-diff 使用 ssh 参数连接到 director 节点,然后查询并下载配置文件:ssh_cmd=ssh -F ssh.config standalone container_engine=podman connection=ssh remote_config_path=/tmp/tripleo确保您在
ssh_cmd参数中提供的 ssh 命令正确,并包含密钥身份验证。启用您要包含在
/etc/os-diff/config.yaml文件中的服务,并禁用您要从文件中排除的服务。确保具有编辑文件的正确权限:$ chown ospng:ospng /etc/os-diff/config.yaml以下示例允许默认 Identity 服务(keystone)包含在
/etc/os-diff/config.yaml文件中:# service name and file location services: # Service name keystone: # Bool to enable/disable a service (not implemented yet) enable: true # Pod name, in both OCP and podman context. # It could be strict match or will only just grep the podman_name # and work with all the pods which matched with pod_name. # To enable/disable use strict_pod_name_match: true/false podman_name: keystone pod_name: keystone container_name: keystone-api # pod options # strict match for getting pod id in TripleO and podman context strict_pod_name_match: false # Path of the config files you want to analyze. # It could be whatever path you want: # /etc/<service_name> or /etc or /usr/share/<something> or even / # @TODO: need to implement loop over path to support multiple paths such as: # - /etc # - /usr/share path: - /etc/ - /etc/keystone - /etc/keystone/keystone.conf - /etc/keystone/logging.conf对您要禁用或启用的每个 RHOSP 服务重复此步骤。
如果您使用非容器化服务,如
ovs-external-ids,请拉取配置或命令输出。例如:services: ovs_external_ids: hosts:1 - standalone service_command: "ovs-vsctl list Open_vSwitch . | grep external_ids | awk -F ': ' '{ print $2; }'"2 cat_output: true3 path: - ovs_external_ids.json config_mapping:4 ovn-bridge-mappings: edpm_ovn_bridge_mappings5 ovn-bridge: edpm_ovn_bridge ovn-encap-type: edpm_ovn_encap_type ovn-monitor-all: ovn_monitor_all ovn-remote-probe-interval: edpm_ovn_remote_probe_interval ovn-ofctrl-wait-before-clear: edpm_ovn_ofctrl_wait_before_clear注意您必须正确配置 SSH 配置文件或相当于非标准服务,如 OVS。
ovs_external_ids服务不在容器中运行,并且 OVS 数据存储在云的每个主机上,如controller_1/controller_2/等。- 1
- 主机列表,如
compute-1、compute-2。 - 2
- 针对主机运行的命令。
- 3
- os-diff 获取命令的输出,并将输出存储在由密钥路径指定的文件中。
- 4
- 在这个示例中,在 data plane 自定义资源定义和
ovs-vsctl输出之间提供一个映射。 - 5
edpm_ovn_bridge_mappings变量必须是字符串列表,如["datacentre:br-ex"]。比较值:
$ os-diff diff ovs_external_ids.json edpm.crd --crd --service ovs_external_ids例如,要在每台主机上检查
/etc/yum.conf,您必须将以下语句放在config.yaml文件中。以下示例使用一个名为yum_config的文件:services: yum_config: hosts: - undercloud - controller_1 - compute_1 - compute_2 service_command: "cat /etc/yum.conf" cat_output: true path: - yum.conf
拉取配置:
注意以下命令拉取
/etc/os-diff/config.yaml文件中包含的所有配置文件。您可以使用--update 或--update-only 选项,将 os-diff 配置为根据运行的环境自动更新此文件。这些选项将 podman 信息设置为所有正在运行的容器的config.yaml中。当所有 Red Hat OpenStack Platform 服务都已关闭时,podman 信息可能会很有用。请注意,当
config.yaml文件自动填充时,您必须手动为每个服务提供配置路径。# will only update the /etc/os-diff/config.yaml os-diff pull --update-only# will update the /etc/os-diff/config.yaml and pull configuration os-diff pull --update# will update the /etc/os-diff/config.yaml and pull configuration os-diff pull配置默认拉取并存储在以下目录中:
/tmp/tripleo/
验证
验证您是否在本地路径中都有每个服务配置的目录:
▾ tmp/ ▾ tripleo/ ▾ glance/ ▾ keystone/