From b104c3f9fa4de4e2c478f797dbb7d769fea29d6e Mon Sep 17 00:00:00 2001 From: Alexandra Molnar Date: Wed, 5 Jun 2024 09:53:31 +0100 Subject: [PATCH] TELCODOCS-1707: Add Preparing/Configuring shared container dir --- _topic_maps/_topic_map.yml | 12 +-- ...cnf-understanding-image-based-upgrade.adoc | 2 +- .../_attributes | 1 + ...-based-upgrade-shared-container-image.adoc | 16 ++++ .../preparing_for_image_based_upgrade/images | 1 + .../preparing_for_image_based_upgrade/modules | 1 + .../snippets | 1 + ...sed-upgrade-share-container-directory.adoc | 68 +++++++++++++ ...sed-upgrade-share-container-directory.adoc | 95 ++----------------- 9 files changed, 105 insertions(+), 92 deletions(-) create mode 120000 edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/_attributes create mode 100644 edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc create mode 120000 edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/images create mode 120000 edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/modules create mode 120000 edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/snippets create mode 100644 modules/cnf-image-based-upgrade-share-container-directory.adoc diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index c7db7d3f04..e111797f60 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -3077,12 +3077,12 @@ Topics: Topics: - Name: Understanding the image-based upgrade for single-node OpenShift clusters File: cnf-understanding-image-based-upgrade -# - Name: Preparing for an image-based upgrade for single-node OpenShift clusters -# Dir: preparing_for_image_based_upgrade -# Distros: openshift-origin,openshift-enterprise -# Topics: -# - Name: Configuring a shared container directory for the image-based upgrade -# File: cnf-image-based-upgrade-shared-container-image + - Name: Preparing for an image-based upgrade for single-node OpenShift clusters + Dir: preparing_for_image_based_upgrade + Distros: openshift-origin,openshift-enterprise + Topics: + - Name: Configuring a shared container directory for the image-based upgrade + File: cnf-image-based-upgrade-shared-container-image # - Name: Installing Operators for the image-based upgrade # File: cnf-image-based-upgrade-install-operators # - Name: Generating a seed image for the image-based upgrade with Lifecycle Agent diff --git a/edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc b/edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc index 0a0babba56..f186713d6c 100644 --- a/edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc +++ b/edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc @@ -127,4 +127,4 @@ include::modules/ztp-image-based-upgrade-extra-manifests-guide.adoc[leveloffset= * xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.adoc#ztp-image-based-upgrade-creating-backup-resources-with-ztp_ztp-gitops[Creating ConfigMap objects for the image-based upgrade with GitOps ZTP] * xref:../../backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.adoc#about-installing-oadp[About installing OADP] -//// \ No newline at end of file +//// diff --git a/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/_attributes b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/_attributes new file mode 120000 index 0000000000..bf7c2529fd --- /dev/null +++ b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/_attributes @@ -0,0 +1 @@ +../../../_attributes/ \ No newline at end of file diff --git a/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc new file mode 100644 index 0000000000..33247cf38a --- /dev/null +++ b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc @@ -0,0 +1,16 @@ +:_mod-docs-content-type: ASSEMBLY +[id="cnf-image-based-upgrade-shared-varlibcontainers"] += Configuring a shared container directory for the image-based upgrade +include::_attributes/common-attributes.adoc[] +:context: shared-container-directory + +toc::[] + +Your {sno} clusters need to have a shared `var/lib/containers` partition for the image-based upgrade. +You can do this at install time. + +:FeatureName: The Lifecycle Agent + +include::modules/cnf-image-based-upgrade-share-container-directory.adoc[leveloffset=+1] + +include::modules/ztp-image-based-upgrade-share-container-directory.adoc[leveloffset=+1] \ No newline at end of file diff --git a/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/images b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/images new file mode 120000 index 0000000000..4399cbb3c0 --- /dev/null +++ b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/images @@ -0,0 +1 @@ +../../../images/ \ No newline at end of file diff --git a/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/modules b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/modules new file mode 120000 index 0000000000..7e8b50bee7 --- /dev/null +++ b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/modules @@ -0,0 +1 @@ +../../../modules/ \ No newline at end of file diff --git a/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/snippets b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/snippets new file mode 120000 index 0000000000..ce62fd7c41 --- /dev/null +++ b/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/snippets @@ -0,0 +1 @@ +../../../snippets/ \ No newline at end of file diff --git a/modules/cnf-image-based-upgrade-share-container-directory.adoc b/modules/cnf-image-based-upgrade-share-container-directory.adoc new file mode 100644 index 0000000000..62733cca6e --- /dev/null +++ b/modules/cnf-image-based-upgrade-share-container-directory.adoc @@ -0,0 +1,68 @@ +// Module included in the following assemblies: +// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc + +:_mod-docs-content-type: PROCEDURE +[id="cnf-image-based-upgrade-shared-container-directory_{context}"] += Configuring a shared container directory between ostree stateroots + +Apply a `MachineConfig` to both the seed and the target clusters during installation time to create a separate partition and share the `/var/lib/containers` directory between the two `ostree` stateroots that will be used during the upgrade process. + +[IMPORTANT] +==== +You must complete this procedure at installation time. +==== + +.Procedure + +* Apply a `MachineConfig` to create a separate partition: ++ +[source,yaml] +---- +apiVersion: machineconfiguration.openshift.io/v1 +kind: MachineConfig +metadata: + labels: + machineconfiguration.openshift.io/role: master + name: 98-var-lib-containers-partitioned +spec: + config: + ignition: + version: 3.2.0 + storage: + disks: + - device: /dev/disk/by-id/wwn- <1> + partitions: + - label: varlibcontainers + startMiB: <2> + sizeMiB: <3> + filesystems: + - device: /dev/disk/by-partlabel/varlibcontainers + format: xfs + mountOptions: + - defaults + - prjquota + path: /var/lib/containers + wipeFilesystem: true + systemd: + units: + - contents: |- + # Generated by Butane + [Unit] + Before=local-fs.target + Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service + After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service + + [Mount] + Where=/var/lib/containers + What=/dev/disk/by-partlabel/varlibcontainers + Type=xfs + Options=defaults,prjquota + + [Install] + RequiredBy=local-fs.target + enabled: true + name: var-lib-containers.mount +---- +<1> Specify the root disk. +<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail. +<3> Specify a minimum size for the partition of 500 GB to ensure adequate disk space for precached images. If the value is too small, the deployments after installation will fail. \ No newline at end of file diff --git a/modules/ztp-image-based-upgrade-share-container-directory.adoc b/modules/ztp-image-based-upgrade-share-container-directory.adoc index 4c11c2b9b4..759fabf8be 100644 --- a/modules/ztp-image-based-upgrade-share-container-directory.adoc +++ b/modules/ztp-image-based-upgrade-share-container-directory.adoc @@ -1,16 +1,11 @@ // Module included in the following assemblies: -// * scalability_and_performance/ztp-image-based-upgrade.adoc +// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc :_mod-docs-content-type: PROCEDURE [id="ztp-image-based-upgrade-shared-container-directory_{context}"] -= Sharing the container directory between `ostree` stateroots += Configuring a shared container directory between ostree stateroots when using {ztp} -You must apply a `MachineConfig` to both the seed and the target clusters during installation time to create a separate partition and share the `/var/lib/containers` directory between the two `ostree` stateroots that will be used during the upgrade process. - -[id="ztp-image-based-upgrade-shared-container-directory-acm_{context}"] -== Sharing the container directory between `ostree` stateroots when using {rh-rhacm} - -When you are using {rh-rhacm}, you must apply a `MachineConfig` to both the seed and target clusters. +When you are using the {ztp-first} workflow, you do the following procedure to create a separate disk partition on both the seed and target cluster and to share the `/var/lib/containers` directory. [IMPORTANT] ==== @@ -19,81 +14,11 @@ You must complete this procedure at installation time. .Prerequisites -* Log in as a user with `cluster-admin` privileges. - -.Procedure - -. Apply a `MachineConfig` to create a separate partition. -+ -[source,yaml] ----- -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - labels: - machineconfiguration.openshift.io/role: master - name: 98-var-lib-containers-partitioned -spec: - config: - ignition: - version: 3.2.0 - storage: - disks: - - device: /dev/disk/by-id/wwn- <1> - partitions: - - label: varlibcontainers - startMiB: <2> - sizeMiB: <3> - filesystems: - - device: /dev/disk/by-partlabel/varlibcontainers - format: xfs - mountOptions: - - defaults - - prjquota - path: /var/lib/containers - wipeFilesystem: true - systemd: - units: - - contents: |- - # Generated by Butane - [Unit] - Before=local-fs.target - Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service - After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service - - [Mount] - Where=/var/lib/containers - What=/dev/disk/by-partlabel/varlibcontainers - Type=xfs - Options=defaults,prjquota - - [Install] - RequiredBy=local-fs.target - enabled: true - name: var-lib-containers.mount ----- -<1> Specify the root disk. -<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail. -<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail. - -[id="ztp-image-based-upgrade-shared-container-directory-ztp_{context}"] -== Sharing the container directory between `ostree` stateroots when using GitOps ZTP - -When you are using the GitOps ZTP workflow, you can do the following procedure to create a separate disk partition on both the seed and target cluster and to share the `/var/lib/containers` directory. - -[IMPORTANT] -==== -You must complete this procedure at installation time. -==== - -.Prerequisites - -* Log in as a user with `cluster-admin` privileges. * Install Butane. .Procedure -. Create the `storage.bu` file. +. Create the `storage.bu` file: + [source,yaml] ---- @@ -105,8 +30,8 @@ storage: wipe_table: false partitions: - label: var-lib-containers - start_mib: <2> - size_mib: <3> + start_mib: <2> + size_mib: <3> filesystems: - path: /var/lib/containers device: /dev/disk/by-partlabel/var-lib-containers @@ -119,9 +44,9 @@ storage: ---- <1> Specify the root disk. <2> Specify the start of the partition in MiB. If the value is too small, the installation will fail. -<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail. +<3> Specify a minimum size for the partition of 500 GB to ensure adequate disk space for precached images. If the value is too small, the deployments after installation will fail. -. Convert the `storage.bu` to an Ignition file. +. Convert the `storage.bu` to an Ignition file: + -- [source,terminal] @@ -136,7 +61,7 @@ $ butane storage.bu ---- -- -. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR. +. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR: + [source,yaml] ---- @@ -150,7 +75,7 @@ spec: .Verification -. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation. +. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation: + -- [source,terminal]