From f55af442deddb8a595a1437ec238dfdeaad61fbf Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Mon, 1 Feb 2021 21:14:00 -0800 Subject: [PATCH] Deploy multipathd using tripleo_multipathd ansible role The puppet and ansible tasks for deploying the Multipathd service have been moved to a new tripleo_multipathd ansible role. THT uses that role passing in parameter values via ansible variables. Two new THT parameters are supported: - MultipathdCustomConfigFile provides a way for the user to specify a custom multipath.conf file. This makes it easier for the user to manage custom settings that are unique to their deployment, such as vendor specific hardware tuning. - MultipathdSkipKpartx provides a means for overriding multipathd's default behavior whereby it automatically creates disk partitions on multipath devices. Partitions should be managed by VM servers accessing the device, not by the overcloud host itself. Depends-On: Icf9faff31d83f0ea77d00a59a53d6ad36b06da4f Depends-On: I3478312b5117da5c2e819e47c99f574246e84838 Change-Id: I934a1ae5bc0d77fd39b25f5039635e5df6e9004f (cherry picked from commit 80fcd33248c3861a427c0eabdfbff4d4e2622380) (cherry picked from commit a19a3c6aefc5d0212d6da39f29318b0bd207a5a1) --- ci/environments/scenario001-standalone.yaml | 3 + .../multipathd-container.yaml | 0 .../multipathd-container-ansible.yaml | 128 ++++++++++++++++++ environments/multipathd.yaml | 2 +- ...tipathd-with-ansible-f32f3ea627815191.yaml | 20 +++ 5 files changed, 152 insertions(+), 1 deletion(-) rename deployment/{multipathd => deprecated}/multipathd-container.yaml (100%) create mode 100644 deployment/multipathd/multipathd-container-ansible.yaml create mode 100644 releasenotes/notes/configure-multipathd-with-ansible-f32f3ea627815191.yaml diff --git a/ci/environments/scenario001-standalone.yaml b/ci/environments/scenario001-standalone.yaml index 77c96ae60f..abf14c21e0 100644 --- a/ci/environments/scenario001-standalone.yaml +++ b/ci/environments/scenario001-standalone.yaml @@ -21,6 +21,7 @@ resource_registry: OS::TripleO::Services::HeatApiCloudwatch: ../../deployment/heat/heat-api-cloudwatch-disabled-puppet.yaml OS::TripleO::Services::HeatEngine: ../../deployment/heat/heat-engine-container-puppet.yaml OS::TripleO::Services::MetricsQdr: ../../deployment/metrics/qdr-container-puppet.yaml + OS::TripleO::Services::Multipathd: ../../deployment/multipathd/multipathd-container-ansible.yaml OS::TripleO::Services::OsloMessagingRpc: ../../deployment/rabbitmq/rabbitmq-messaging-rpc-container-puppet.yaml OS::TripleO::Services::OsloMessagingNotify: ../../deployment/rabbitmq/rabbitmq-messaging-notify-shared-puppet.yaml OS::TripleO::Services::Redis: ../../deployment/database/redis-container-puppet.yaml @@ -196,3 +197,5 @@ parameter_defaults: - /dev/loop2 - /dev/loop3 - /dev/loop4 + MultipathdEnable: true + NovaLibvirtVolumeUseMultipath: true diff --git a/deployment/multipathd/multipathd-container.yaml b/deployment/deprecated/multipathd-container.yaml similarity index 100% rename from deployment/multipathd/multipathd-container.yaml rename to deployment/deprecated/multipathd-container.yaml diff --git a/deployment/multipathd/multipathd-container-ansible.yaml b/deployment/multipathd/multipathd-container-ansible.yaml new file mode 100644 index 0000000000..9bffe775ae --- /dev/null +++ b/deployment/multipathd/multipathd-container-ansible.yaml @@ -0,0 +1,128 @@ +heat_template_version: rocky + +description: > + OpenStack containerized Multipathd service + +parameters: + ContainerMultipathdImage: + description: image + type: string + ContainerMultipathdConfigImage: + description: The container image to use for the multipathd config_volume + type: string + MultipathdEnable: + default: false + description: Whether to enable the multipath daemon + type: boolean + MultipathdCustomConfigFile: + default: '' + description: Fully qualified path of a local multipath.conf file to be + installed on the overcloud nodes. By default, a minimal + multipath.conf file will be installed. NOTE - Other TripleO + multipath parameters will override any corresponding + value in the local custom config file. For example, if + MultipathdEnableUserFriendlyNames is False, the files on the + overcloud nodes will be updated match, even if the setting is + enabled in the local custom file. + type: string + MultipathdEnableUserFriendlyNames: + default: false + description: Whether to enable assigning a user friendly name to each path + type: boolean + MultipathdEnableFindMultipaths: + default: true + description: Whether to automatically create a multipath device for each path + type: boolean + MultipathdSkipKpartx: + default: true + description: Whether to skip automatically creating partitions on the device + type: boolean + EndpointMap: + default: {} + description: Mapping of service endpoint -> protocol. Typically set + via parameter_defaults in the resource registry. + type: json + ServiceData: + default: {} + description: Dictionary packing service data + type: json + ServiceNetMap: + default: {} + description: Mapping of service_name -> network name. Typically set + via parameter_defaults in the resource registry. This + mapping overrides those in ServiceNetMapDefaults. + type: json + RoleName: + default: '' + description: Role name on which the service is applied + type: string + RoleParameters: + default: {} + description: Parameters specific to the role + type: json + DefaultPasswords: + default: {} + type: json + +resources: + + ContainersCommon: + type: ../containers-common.yaml + +outputs: + role_data: + description: Role data for the Multipathd API role. + value: + service_name: multipathd + config_settings: {} + service_config_settings: {} + kolla_config: + /var/lib/kolla/config_files/multipathd.json: + command: /usr/sbin/multipathd -d + config_files: + - source: "/var/lib/kolla/config_files/src-iscsid/*" + dest: "/etc/iscsi/" + merge: true + preserve_properties: true + docker_config: + step_3: + multipathd: + start_order: 1 + image: {get_param: ContainerMultipathdImage} + net: host + privileged: true + restart: always + healthcheck: + test: /openstack/healthcheck + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/multipathd.json:/var/lib/kolla/config_files/config.json:ro + - /etc/iscsi:/var/lib/kolla/config_files/src-iscsid:ro + - /dev/:/dev/ + - /run/:/run/ + - /sys:/sys + - /lib/modules:/lib/modules:ro + - /var/lib/iscsi:/var/lib/iscsi:z + - /etc/multipath:/etc/multipath:z + - /etc/multipath.conf:/etc/multipath.conf:ro + environment: + KOLLA_CONFIG_STRATEGY: COPY_ALWAYS + deploy_steps_tasks: + - name: Configure multipathd + when: step|int == 2 + import_role: + name: tripleo_multipathd + vars: + tripleo_multipathd_enable: {get_param: MultipathdEnable} + tripleo_multipathd_custom_config_file: {get_param: MultipathdCustomConfigFile} + tripleo_multipathd_find_multipaths: {get_param: MultipathdEnableFindMultipaths} + tripleo_multipathd_skip_kpartx: {get_param: MultipathdSkipKpartx} + tripleo_multipathd_user_friendly_names: {get_param: MultipathdEnableUserFriendlyNames} + host_prep_tasks: + - name: Prep host for multipathd + import_role: + name: tripleo_multipathd + tasks_from: host_prep + upgrade_tasks: [] diff --git a/environments/multipathd.yaml b/environments/multipathd.yaml index 7b147f40c6..901fe3a242 100644 --- a/environments/multipathd.yaml +++ b/environments/multipathd.yaml @@ -1,5 +1,5 @@ resource_registry: - OS::TripleO::Services::Multipathd: ../deployment/multipathd/multipathd-container.yaml + OS::TripleO::Services::Multipathd: ../deployment/multipathd/multipathd-container-ansible.yaml parameter_defaults: MultipathdEnable: true diff --git a/releasenotes/notes/configure-multipathd-with-ansible-f32f3ea627815191.yaml b/releasenotes/notes/configure-multipathd-with-ansible-f32f3ea627815191.yaml new file mode 100644 index 0000000000..1719e58252 --- /dev/null +++ b/releasenotes/notes/configure-multipathd-with-ansible-f32f3ea627815191.yaml @@ -0,0 +1,20 @@ +--- +features: + - | + A new multipathd-container-ansible.yaml heat template replaces the + multipathd-container.yaml template. The new template adds support for + the following new parameters. + * MultipathdSkipKpartx + * MultipathdCustomConfigFile +upgrade: + - | + When upgrading from the multipathd-container.yaml template to the new + multipathd-container-ansible.yaml template, bear in mind the new + MultipathdSkipKpartx parameter will configure the corresponding skip_kpartx + setting in /etc/multipath.conf. +deprecations: + - | + The multipathd-container.yaml template is deprecated in favor of a new + multipathd-container-ansible.yaml template. The new template is backward + compatible with the old template, but see the features and upgrade notes + for additional details.