Bug 2184779 - Filesystem: create systemd unit files for filesystems that are considered network filesystems by systemd
Summary: Filesystem: create systemd unit files for filesystems that are considered net...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: resource-agents
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 9.3
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-05 17:34 UTC by Shane Bradley
Modified: 2023-08-10 15:40 UTC (History)
6 users (show)

Fixed In Version: resource-agents-4.10.0-38.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-6704 0 None None None 2023-05-17 11:14:38 UTC
Red Hat Issue Tracker RHELPLAN-154113 0 None None None 2023-04-05 17:37:39 UTC
Red Hat Knowledge Base (Solution) 3259321 0 None None None 2023-04-05 17:34:02 UTC

Description Shane Bradley 2023-04-05 17:34:02 UTC
Description of problem:

A customer was seeing his gfs2 filesystem managed by pacemaker shutting down before pacemaker started the shutdown process when doing a "shutdown -h now". This should not occur if the filesystem is managed by pacemaker. 

We should create systemd unit files for filesystems that are considered network filesystems by systemd for our `Filesystem` resource-agent. 

Any filesystem that is supported by the `Filesystem` resource-agent that is considered a `network` filesystem by systemd [1] should be include a unit file system to make sure that those filesystem are not shutdown before pacemaker. 


Version-Release number of selected component (if applicable):
resource-agents-4.9.0-16.el8.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Configure a gfs2 filesystem that is managed by pacemaker.
2. Do: shutdown -h now

Actual results:
The gfs2 filesystems managed by pacemaker are shutdown before pacemaker starts the shutdown process.

Expected results:
The gfs2 filesystem should NOT be shutdown by systemd and unmounted. They should only be unmounted when pacemaker begins
its shutdown.

Additional info:

We should add a check on Filesystem type for the 'Filesystem' resource-agent then create a unit file similar to what we do with "LVM-activate" resource. We should do this for any type that "Filesystem" resource-agent supports and which is considered a network filesystem by systemd. 

Create the following file:
  # touch /etc/systemd/system/resource-agents-deps.target.d/gfs2.conf

Then add the following to the file /etc/systemd/system/resource-agents-deps.target.d/gfs2.conf:
  [Unit]
  After=remote-fs.target

Then reload systemd
  # systemctl daemon-reload

Comment 1 Reid Wahl 2023-04-05 17:41:11 UTC
The systemd_drop_in() function can do this. See lvm_start() in LVM-activate.

This would be something like
```
            # if this is a remote filesystem (https://github.com/systemd/systemd/blob/v253/src/basic/filesystems.c#L115-L132)
            systemd_drop_in "99-Filesystem-remote" "After" \
                    "remote-fs.target"
```

We should think about whether Wants= or Requires= is also necessary. I think After= is sufficient.

Comment 2 Oyvind Albrigtsen 2023-05-17 10:35:07 UTC
https://github.com/ClusterLabs/resource-agents/pull/1869


Note You need to log in before you can comment on or make changes to this bug.