From b9234069cbd2d58e2270d0e70581e67d90d80648 Mon Sep 17 00:00:00 2001 From: Jesse Dohmann Date: Wed, 30 Oct 2024 13:03:51 -0700 Subject: [PATCH] OCPBUGS-20134: update and rebase --- ...ing-bare-metal-network-customizations.adoc | 2 + .../installing-bare-metal.adoc | 2 + ...alling-restricted-networks-bare-metal.adoc | 2 + modules/rhcos-enabling-multipath.adoc | 14 ++- modules/rhcos-multipath-secondary-disk.adoc | 100 ++++++++++++++++++ 5 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 modules/rhcos-multipath-secondary-disk.adoc diff --git a/installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc b/installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc index 0ef9abc3b018..ced57e2cae95 100644 --- a/installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc +++ b/installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc @@ -160,6 +160,8 @@ include::modules/installation-user-infra-machines-static-network.adoc[leveloffse include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2] +include::modules/rhcos-multipath-secondary-disk.adoc[leveloffset=+3] + include::modules/installation-installing-bare-metal.adoc[leveloffset=+1] [role="_additional-resources"] diff --git a/installing/installing_bare_metal/installing-bare-metal.adoc b/installing/installing_bare_metal/installing-bare-metal.adoc index b16336507327..2fb5c67d7a6d 100644 --- a/installing/installing_bare_metal/installing-bare-metal.adoc +++ b/installing/installing_bare_metal/installing-bare-metal.adoc @@ -187,6 +187,8 @@ include::modules/installation-user-infra-machines-static-network.adoc[leveloffse include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2] +include::modules/rhcos-multipath-secondary-disk.adoc[leveloffset=+3] + [role="_additional-resources"] .Additional resources diff --git a/installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc b/installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc index 345d425f7c42..b02488a052ca 100644 --- a/installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc +++ b/installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc @@ -181,6 +181,8 @@ include::modules/installation-user-infra-machines-static-network.adoc[leveloffse include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2] +include::modules/rhcos-multipath-secondary-disk.adoc[leveloffset=+3] + include::modules/installation-installing-bare-metal.adoc[leveloffset=+1] [role="_additional-resources"] diff --git a/modules/rhcos-enabling-multipath.adoc b/modules/rhcos-enabling-multipath.adoc index 79f50e1c61b6..132a525a8c5f 100644 --- a/modules/rhcos-enabling-multipath.adoc +++ b/modules/rhcos-enabling-multipath.adoc @@ -27,6 +27,12 @@ The following procedure enables multipath at installation time and appends kerne {product-title} does not support enabling multipathing as a day-2 activity on nodes that have been upgraded from 4.6 or earlier. ==== +.Prerequisites + +* You have created the Ignition config files for your cluster. + +* You have reviewed _Installing {op-system} and starting the {product-title} bootstrap process_. + .Procedure . To enable multipath and start the `multipathd` daemon, run the following command on the installation host: @@ -43,7 +49,8 @@ $ mpathconf --enable && systemctl start multipathd.service + [source,terminal] ---- -$ coreos-installer install /dev/mapper/mpatha \ <1> +$ coreos-installer install /dev/mapper/mpatha \// <1> +--ignition-url=http://host/worker.ign \ --append-karg rd.multipath=default \ --append-karg root=/dev/disk/by-label/dm-mpath-root \ --append-karg rw @@ -54,7 +61,8 @@ $ coreos-installer install /dev/mapper/mpatha \ <1> + [source,terminal] ---- -$ coreos-installer install /dev/disk/by-id/wwn- \ <1> +$ coreos-installer install /dev/disk/by-id/wwn- \// <1> +--ignition-url=http://host/worker.ign \ --append-karg rd.multipath=default \ --append-karg root=/dev/disk/by-label/dm-mpath-root \ --append-karg rw @@ -63,6 +71,8 @@ $ coreos-installer install /dev/disk/by-id/wwn- \ <1> + This symlink can also be used as the `coreos.inst.install_dev` kernel argument when using special `coreos.inst.*` arguments to direct the live installer. For more information, see "Installing {op-system} and starting the {product-title} bootstrap process". +. Reboot into the installed system. + . Check that the kernel arguments worked by going to one of the worker nodes and listing the kernel command line arguments (in `/proc/cmdline` on the host): + [source,terminal] diff --git a/modules/rhcos-multipath-secondary-disk.adoc b/modules/rhcos-multipath-secondary-disk.adoc new file mode 100644 index 000000000000..d712318faffe --- /dev/null +++ b/modules/rhcos-multipath-secondary-disk.adoc @@ -0,0 +1,100 @@ +// Module included in the following assemblies: +// +// * installing/installing_bare_metal/upi/installing-bare-metal.adoc +// * installing/installing_bare_metal/upi/installing-bare-metal-network-customizations.adoc +// * installing/installing_bare_metal/upi/installing-restricted-networks-bare-metal.adoc + +:_mod-docs-content-type: PROCEDURE +[id="rhcos-multipath-secondary-disk_{context}"] += Enabling multipathing on secondary disks + +{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. + +.Prerequisites + +* You have read the section _Disk partitioning_. +* You have read _Enabling multipathing with kernel arguments on {op-system}_. +* You have installed the Butane utility. + +.Procedure + +. Create a Butane config with information similar to the following: ++ +.Example `multipath-config.bu` +[source,yaml] +---- +variant: openshift +version: {product-version}.0 +systemd: + units: + - name: mpath-configure.service + enabled: true + contents: | + [Unit] + Description=Configure Multipath on Secondary Disk + ConditionFirstBoot=true + ConditionPathExists=!/etc/multipath.conf + Before=multipathd.service <1> + DefaultDependencies=no + + [Service] + Type=oneshot + ExecStart=/usr/sbin/mpathconf --enable <2> + + [Install] + WantedBy=multi-user.target + - name: mpath-var-lib-container.service + enabled: true + contents: | + [Unit] + Description=Set Up Multipath On /var/lib/containers + ConditionFirstBoot=true <3> + Requires=dev-mapper-mpatha.device + After=dev-mapper-mpatha.device + After=ostree-remount.service + Before=kubelet.service + DefaultDependencies=no + + [Service] <4> + Type=oneshot + ExecStart=/usr/sbin/mkfs.xfs -L containers -m reflink=1 /dev/mapper/mpatha + ExecStart=/usr/bin/mkdir -p /var/lib/containers + + [Install] + WantedBy=multi-user.target + - name: var-lib-containers.mount + enabled: true + contents: | + [Unit] + Description=Mount /var/lib/containers + After=mpath-var-lib-containers.service + Before=kubelet.service <5> + + [Mount] <6> + What=/dev/disk/by-label/dm-mpath-containers + Where=/var/lib/containers + Type=xfs + + [Install] + WantedBy=multi-user.target +---- +<1> The configuration must be set before launching the multipath daemon. +<2> Starts the `mpathconf` utility. +<3> This field must be set to the value `true`. +<4> Creates the filesystem and directory `/var/lib/containers`. +<5> The device must be mounted before starting any nodes. +<6> Mounts the device to the `/var/lib/containers` mount point. This location cannot be a symlink. + +. Create the Ignition configuration by running the following command: ++ +[source,terminal] +---- +$ butane --pretty --strict multipath-config.bu > multipath-config.ign +---- + +. Continue with the rest of the first boot {op-system} installation process. ++ +[IMPORTANT] +==== +Do not add the `rd.multipath` or `root` kernel arguments on the command-line during installation unless the primary disk is also multipathed. +====