|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing/installing_bare_metal/upi/installing-bare-metal.adoc |
| 4 | +// * installing/installing_bare_metal/upi/installing-bare-metal-network-customizations.adoc |
| 5 | +// * installing/installing_bare_metal/upi/installing-restricted-networks-bare-metal.adoc |
| 6 | + |
| 7 | +:_mod-docs-content-type: PROCEDURE |
| 8 | +[id="rhcos-multipath-secondary-disk_{context}"] |
| 9 | += Enabling multipathing on secondary disks |
| 10 | + |
| 11 | +{op-system} also supports multipathing on a secondary disk. Instead of kernel arguments, you use Ignition to enable multipathing for the secondary disk at installation time. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You have read the section _Disk partitioning_. |
| 16 | +* You have read _Enabling multipathing with kernel arguments on {op-system}_. |
| 17 | +* You have installed the Butane utility. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. Create a Butane config with information similar to the following: |
| 22 | ++ |
| 23 | +.Example `multipath-config.bu` |
| 24 | +[source,yaml] |
| 25 | +---- |
| 26 | +variant: openshift |
| 27 | +version: {product-version}.0 |
| 28 | +systemd: |
| 29 | + units: |
| 30 | + - name: mpath-configure.service |
| 31 | + enabled: true |
| 32 | + contents: | |
| 33 | + [Unit] |
| 34 | + Description=Configure Multipath on Secondary Disk |
| 35 | + ConditionFirstBoot=true |
| 36 | + ConditionPathExists=!/etc/multipath.conf |
| 37 | + Before=multipathd.service <1> |
| 38 | + DefaultDependencies=no |
| 39 | + |
| 40 | + [Service] |
| 41 | + Type=oneshot |
| 42 | + ExecStart=/usr/sbin/mpathconf --enable <2> |
| 43 | + |
| 44 | + [Install] |
| 45 | + WantedBy=multi-user.target |
| 46 | + - name: mpath-var-lib-container.service |
| 47 | + enabled: true |
| 48 | + contents: | |
| 49 | + [Unit] |
| 50 | + Description=Set Up Multipath On /var/lib/containers |
| 51 | + ConditionFirstBoot=true <3> |
| 52 | + Requires=dev-mapper-mpatha.device |
| 53 | + After=dev-mapper-mpatha.device |
| 54 | + After=ostree-remount.service |
| 55 | + Before=kubelet.service |
| 56 | + DefaultDependencies=no |
| 57 | + |
| 58 | + [Service] <4> |
| 59 | + Type=oneshot |
| 60 | + ExecStart=/usr/sbin/mkfs.xfs -L containers -m reflink=1 /dev/mapper/mpatha |
| 61 | + ExecStart=/usr/bin/mkdir -p /var/lib/containers |
| 62 | + |
| 63 | + [Install] |
| 64 | + WantedBy=multi-user.target |
| 65 | + - name: var-lib-containers.mount |
| 66 | + enabled: true |
| 67 | + contents: | |
| 68 | + [Unit] |
| 69 | + Description=Mount /var/lib/containers |
| 70 | + After=mpath-var-lib-containers.service |
| 71 | + Before=kubelet.service <5> |
| 72 | + |
| 73 | + [Mount] <6> |
| 74 | + What=/dev/disk/by-label/dm-mpath-containers |
| 75 | + Where=/var/lib/containers |
| 76 | + Type=xfs |
| 77 | + |
| 78 | + [Install] |
| 79 | + WantedBy=multi-user.target |
| 80 | +---- |
| 81 | +<1> The configuration must be set before launching the multipath daemon. |
| 82 | +<2> Starts the `mpathconf` utility. |
| 83 | +<3> This field must be set to the value `true`. |
| 84 | +<4> Creates the filesystem and directory `/var/lib/containers`. |
| 85 | +<5> The device must be mounted before starting any nodes. |
| 86 | +<6> Mounts the device to the `/var/lib/containers` mount point. This location cannot be a symlink. |
| 87 | +
|
| 88 | +. Create the Ignition configuration by running the following command: |
| 89 | ++ |
| 90 | +[source,terminal] |
| 91 | +---- |
| 92 | +$ butane --pretty --strict multipath-config.bu > multipath-config.ign |
| 93 | +---- |
| 94 | +
|
| 95 | +. Continue with the rest of the first boot {op-system} installation process. |
| 96 | ++ |
| 97 | +[IMPORTANT] |
| 98 | +==== |
| 99 | +Do not add the `rd.multipath` or `root` kernel arguments on the command-line during installation unless the primary disk is also multipathed. |
| 100 | +==== |
0 commit comments