From cb6bef56159a451ed6eba9e6e3141fb847d7c5b7 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Mon, 4 Apr 2022 11:25:09 +1200 Subject: [PATCH] Replace existing virt-customize usage with tripleo-mount-image The `tripleo-mount-image` tool was created as an alternative for kpartx-based customizations which do not support the multiple mount points of overcloud-hardened-uefi-full.qcow2. virt-customize sets a machine-id in the image, which results in all overcloud nodes having the same machine-id [1]. virt-customize can also be very slow on virtualized underclouds. This change replaces virt-customize usage with tripleo-mount-image+chroot as the recommended tool for overcloud image customizations. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1554546 Change-Id: I3f65479777cc3dfa1ed3c396dbfbe182288ae65b --- deploy-guide/source/deployment/3rd_party.rst | 24 ++++++++++++----- deploy-guide/source/features/ops_tools.rst | 27 ++++++++++++-------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/deploy-guide/source/deployment/3rd_party.rst b/deploy-guide/source/deployment/3rd_party.rst index ba833fec..a404e38a 100644 --- a/deploy-guide/source/deployment/3rd_party.rst +++ b/deploy-guide/source/deployment/3rd_party.rst @@ -370,18 +370,28 @@ kernel module is deployed on the host ..................................... The kernel module is deployed on the base Operating System via RPM or DKMS. -It is suggested to deploy the module via virt-customize. -The libguestfs-tools package contains the virt-customize tool. Install the libguestfs-tools:: +Deploy the module by using the ``tripleo-mount-image`` tool and create a +``chroot``. - sudo yum install libguestfs-tools +First you need to create a repository file where the module will be downloaded from, and copy the repo file into the image:: -Then you need to create a repository file where the module will be downloaded from, and uplaod the repo into the image:: + temp_dir=$(mktemp -d) + sudo tripleo-mount-image -a /path/to/overcloud-full.qcow2 -m $temp_dir + sudo cp my-repo.repo $temp_dir/etc/yum.repos.d/ - virt-customize --selinux-relabel -a overcloud-full.qcow2 --upload my-repo.repo:/etc/yum.repos.d/ +You can now start a chroot and install the rpm that contains the kernel module:: -Once the repository is deployed, you can now install the rpm that contains the kernel module:: + sudo mount -o bind /dev $temp_dir/dev/ + sudo cp /etc/resolv.conf $temp_dir/etc/resolv.conf + sudo chroot $temp_dir /bin/bash + dnf install my-rpm + exit - virt-customize --selinux-relabel -a overcloud-full.qcow2 --install my-rpm +Then unmount the image:: + + sudo rm $temp_dir/etc/resolv.conf + sudo umount $temp_dir/dev + sudo tripleo-unmount-image -m $temp_dir Now that the rpm is deployed with the kernel module, we need to configure TripleO to load it. To configure an extra kernel module named "dpdk_module" for a specific role, we would add:: diff --git a/deploy-guide/source/features/ops_tools.rst b/deploy-guide/source/features/ops_tools.rst index 70d63cb0..dd37a82b 100644 --- a/deploy-guide/source/features/ops_tools.rst +++ b/deploy-guide/source/features/ops_tools.rst @@ -71,20 +71,25 @@ Before deploying the Overcloud 1. Install client packages on overcloud-full image: - - Prepare installation script:: + - Mount the image and create a chroot:: - cat >install.sh<