Skip to content

Commit fdf739b

Browse files
committed
edpm_multipathd: Move multipathd from container to host
Update the edpm_multipathd tasks to (re)deploy the multipathd daemon on the EDPM host instead of running it in a container. This follows the pattern of moving iscsid to the host, which helps avoid a number of historical customer support issues and facilitates booting an EDPM host from an iSCSI or Fibre Channel SAN volume. The new tasks support the following deployment scenarios: - Greenfield - Brownfield, where multipathd was previously running in a container. - Adoption, where multipathd was previsouly running in a container that was managed by tripleo. Closes: OSPRH-21668
1 parent ab51977 commit fdf739b

File tree

19 files changed

+187
-225
lines changed

19 files changed

+187
-225
lines changed

roles/edpm_download_cache/tasks/container_images.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@
5252
- edpm_neutron_ovn
5353
- download_cache
5454

55-
- name: Download images for edpm_multipathd role
56-
when: '"nova" in edpm_download_cache_running_services'
57-
ansible.builtin.include_role:
58-
name: osp.edpm.edpm_multipathd
59-
tasks_from: download_cache.yml
60-
tags:
61-
- edpm_multipathd
62-
- download_cache
63-
6455
- name: Download images for edpm_nova role
6556
when: '"nova" in edpm_download_cache_running_services'
6657
ansible.builtin.include_role:

roles/edpm_download_cache/tasks/packages.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@
7676
tags:
7777
- edpm_iscsid
7878
- download_cache
79+
80+
- name: Download packages for edpm_multipathd role
81+
# multipathd is part of the "nova" EDPM service
82+
when: '"nova" in edpm_download_cache_running_services'
83+
ansible.builtin.include_role:
84+
name: osp.edpm.edpm_multipathd
85+
tasks_from: download_cache.yml
86+
tags:
87+
- edpm_multipathd
88+
- download_cache

roles/edpm_multipathd/defaults/main.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,13 @@ edpm_container_cli: "{{ container_cli | default('podman') }}"
1818

1919
# All variables intended for modification should be placed in this file.
2020

21-
edpm_multipathd_image: "quay.io/podified-antelope-centos9/openstack-multipathd:current-podified"
22-
edpm_multipathd_image_download_delay: "{{ edpm_download_delay | default(60) }}"
23-
edpm_multipathd_image_download_retries: "{{ edpm_download_retries | default(5) }}"
24-
25-
edpm_multipathd_command: "/usr/sbin/multipathd -d"
26-
edpm_multipathd_volumes:
27-
- /var/lib/kolla/config_files/multipathd.json:/var/lib/kolla/config_files/config.json:ro
28-
- /dev:/dev
29-
- /run/udev:/run/udev
30-
- /sys:/sys
31-
- /lib/modules:/lib/modules:ro
32-
- /etc/iscsi:/etc/iscsi:ro
33-
- /var/lib/iscsi:/var/lib/iscsi
34-
- /etc/multipath:/etc/multipath:z
35-
- /etc/multipath.conf:/etc/multipath.conf:ro
21+
edpm_multipathd_download_delay: "{{ edpm_download_delay | default(60) }}"
22+
edpm_multipathd_download_retries: "{{ edpm_download_retries | default(5) }}"
23+
24+
edpm_multipathd_packages:
25+
- device-mapper-multipath
3626

3727
# These should not need to be overridden except in unique situations.
38-
edpm_multipathd_restart_sentinel: /etc/multipath/.multipath_restart_required
3928
edpm_multipathd_custom_config_dir: /runner/multipath
4029
edpm_multipathd_enable: true
4130

@@ -47,5 +36,7 @@ edpm_multipathd_user_friendly_names: false
4736

4837
# This may be overridden to deploy a custom multipath.conf file.
4938
edpm_multipathd_custom_config_file: ''
50-
# If container health check should be enabled
51-
edpm_multipathd_healthcheck: true
39+
40+
edpm_multipathd_legacy_services:
41+
- tripleo_multipathd.service
42+
- edpm_multipathd.service

roles/edpm_multipathd/files/healthchecks/multipathd/healthcheck

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
3+
- name: Restart the multipath subsystem
4+
ansible.builtin.include_tasks: restart_multipath.yml

roles/edpm_multipathd/meta/argument_specs.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ argument_specs:
44
main:
55
short_description: The main entry point for the edpm_multipathd role.
66
options:
7-
edpm_multipathd_image:
8-
default: 'quay.io/podified-antelope-centos9/openstack-multipathd:current-podified'
9-
description: 'URL of the multipathd image.'
10-
type: str
117
edpm_multipathd_image_download_delay:
128
type: int
139
default: 5
@@ -16,29 +12,11 @@ argument_specs:
1612
type: int
1713
default: 5
1814
description: The number of retries for failed download tasks
19-
edpm_multipathd_command:
20-
default: '/usr/sbin/multipathd -d'
21-
description: 'The command to start the multipathd daemon.'
22-
type: str
23-
edpm_multipathd_volumes:
24-
default:
25-
- /var/lib/kolla/config_files/multipathd.json:/var/lib/kolla/config_files/config.json:ro
26-
- /dev:/dev
27-
- /run/udev:/run/udev
28-
- /sys:/sys
29-
- /lib/modules:/lib/modules:ro
30-
- /etc/iscsi:/etc/iscsi:ro
31-
- /var/lib/iscsi:/var/lib/iscsi:z
32-
- /etc/multipath:/etc/multipath:z
33-
- /etc/multipath.conf:/etc/multipath.conf:ro
34-
description: List of volumes in a mount point format.
15+
edpm_multipathd_packages:
3516
type: list
36-
edpm_multipathd_restart_sentinel:
37-
default: '/etc/multipath/.multipath_restart_required'
38-
description: >-
39-
Path to the sentinel file that is used to signal when the multipath
40-
daemon needs to be restarted.
41-
type: str
17+
description: The list of packages to install for multipathd.
18+
default:
19+
- device-mapper-multipath
4220
edpm_multipathd_custom_config_dir:
4321
default: '/runner/multipath'
4422
description: >-
@@ -81,8 +59,11 @@ argument_specs:
8159
overcloud nodes will be updated match, even if the setting is
8260
enabled in the local custom file.
8361
type: str
84-
edpm_multipathd_healthcheck:
85-
type: bool
86-
default: true
62+
edpm_multipathd_legacy_services:
63+
type: list
8764
description: |
88-
Enable container health check injection
65+
The list of legacy containerized services associated with adoption
66+
and brownfield deployment scenarios.
67+
default:
68+
- tripleo_multipathd.service
69+
- edpm_multipathd.service
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Copyright 2025 Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Gather services facts
18+
ansible.builtin.service_facts:
19+
20+
- name: Identify legacy multipathd containerized services
21+
ansible.builtin.set_fact:
22+
legacy_multipathd_services: "{{ edpm_multipathd_legacy_services | intersect(ansible_facts.services.keys()) }}"
23+
24+
- name: Clean up legacy multipathd containerized services
25+
become: true
26+
when: legacy_multipathd_services | default([]) | length > 0
27+
block:
28+
- name: Stop and disable legacy multipathd containerized services
29+
# The edpm_tripleo_cleanup role works for stopping and disabling the
30+
# legacy tripleo_multipathd.service (adoption scenario) or the
31+
# edpm_multipathd.service (update scenario).
32+
ansible.builtin.include_role:
33+
role: osp.edpm.edpm_tripleo_cleanup
34+
vars:
35+
edpm_old_tripleo_services: "{{ legacy_multipathd_services }}"
36+
37+
- name: Delete containerized multipathd healthcheck script
38+
ansible.builtin.file:
39+
path: /var/lib/openstack/healthchecks/multipathd
40+
state: absent

roles/edpm_multipathd/tasks/configure.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,13 @@
3535
when:
3636
- edpm_multipathd_custom_config_file|length == 0
3737
block:
38-
- name: Check for existing /etc/multipath.conf
39-
ansible.builtin.stat:
40-
path: /etc/multipath.conf
41-
register: result
42-
check_mode: false
4338
- name: Create /etc/multipath.conf if file is missing
4439
ansible.builtin.copy:
4540
src: "{{ role_path }}/files/multipath.conf"
4641
dest: /etc/multipath.conf
4742
mode: "0644"
4843
when:
49-
- not result.stat.exists or result.stat.size == 0
44+
- not stat_before.stat.exists or stat_before.stat.size == 0
5045

5146
- name: Check if a blacklist section is present
5247
ansible.builtin.shell: grep -q '^blacklist\s*{' /etc/multipath.conf
@@ -68,7 +63,6 @@
6863
regexp: '^(blacklist {)'
6964
replace: '\1\n}'
7065

71-
7266
- name: Remove global blacklist if multipathd is enabled
7367
ansible.builtin.replace:
7468
path: /etc/multipath.conf
@@ -107,10 +101,11 @@
107101
register: stat_after
108102
check_mode: false
109103

110-
- name: Record multipath containers require a restart
104+
- name: Notify the multipath configuration changed
111105
when:
112106
- not stat_before.stat.exists or stat_after.stat.checksum != stat_before.stat.checksum
113-
ansible.builtin.file:
114-
path: "{{ edpm_multipathd_restart_sentinel }}"
115-
state: touch
116-
mode: "0644"
107+
# Use 'true' as a no-op command for what's essentially a conditional notify
108+
ansible.builtin.command: /usr/bin/true
109+
changed_when: true
110+
notify:
111+
- Restart the multipath subsystem
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22

3-
- name: Download needed container
4-
containers.podman.podman_image:
5-
name: "{{ edpm_multipathd_image }}"
6-
auth_file: "{{ edpm_download_cache_podman_auth_file }}"
3+
- name: Download multipathd packages
4+
ansible.builtin.dnf:
5+
name: "{{ edpm_multipathd_packages }}"
6+
download_only: true
77
become: true
8-
register: edpm_multipathd_image_download
9-
until: edpm_multipathd_image_download.failed == false
10-
retries: "{{ edpm_multipathd_image_download_retries }}"
11-
delay: "{{ edpm_multipathd_image_download_delay }}"
8+
register: edpm_multipathd_packages_install
9+
until: edpm_multipathd_packages_install is succeeded
10+
retries: "{{ edpm_multipathd_download_retries }}"
11+
delay: "{{ edpm_multipathd_download_delay }}"

roles/edpm_multipathd/tasks/healthchecks.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)