Chapter 3. Working with overcloud images
Red Hat OpenStack Platform (RHOSP) director provides images for the overcloud. The QCOW image in this collection contains a base set of software components that integrate to form various overcloud roles, such as Compute, Controller, and storage nodes. In some situations, you might aim to modify certain aspects of the overcloud image to suit your needs, such as installing additional components to nodes.
You can use the virt-customize tool to modify an existing overcloud image to augment an existing Controller node. For example, use the following procedures to install additional ml2
plugins, Cinder backends, or monitoring agents that do not ship with the initial image.
If you modify the overcloud image to include third-party software and report an issue, Red Hat might request that you reproduce the issue with an unmodified image in accordance with our general third-party support policy: https://access.redhat.com/articles/1067.
3.1. Obtaining the overcloud images Copy linkLink copied to clipboard!
Director requires several disk images to provision overcloud nodes:
- An introspection kernel and ramdisk - For bare metal system introspection over PXE boot.
- A deployment kernel and ramdisk - For system provisioning and deployment.
- An overcloud kernel, ramdisk, and full image - A base overcloud system that director writes to the hard disk of the node.
Procedure
To obtain these images, install the
rhosp-director-images
andrhosp-director-images-ipa
packages:sudo yum install rhosp-director-images rhosp-director-images-ipa
$ sudo yum install rhosp-director-images rhosp-director-images-ipa
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Extract the archives to the
images
directory on thestack
user home,/home/stack/images
:cd ~/images for i in /usr/share/rhosp-director-images/overcloud-full-latest-13.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-13.0.tar; do tar -xvf $i; done
$ cd ~/images $ for i in /usr/share/rhosp-director-images/overcloud-full-latest-13.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-13.0.tar; do tar -xvf $i; done
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Initrd: Modifying the initial ramdisks Copy linkLink copied to clipboard!
Some situations might require that you modify the initial ramdisk. For example, you might require that a certain driver is available when you boot the nodes during the introspection or provisioning processes. In the context of the overcloud, this includes one of the following ramdisks:
-
The introspection ramdisk -
ironic-python-agent.initramfs
-
The provisioning ramdisk -
overcloud-full.initrd
This procedure adds an additional RPM package to the ironic-python-agent.initramfs
ramdisk as an example.
Procedure
Log in as the
root
user and create a temporary directory for the ramdisk:mkdir ~/ipa-tmp cd ~/ipa-tmp
# mkdir ~/ipa-tmp # cd ~/ipa-tmp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
skipcpio
andcpio
commands to extract the ramdisk to the temporary directory:/usr/lib/dracut/skipcpio ~/images/ironic-python-agent.initramfs | zcat | cpio -ivd | pax -r
# /usr/lib/dracut/skipcpio ~/images/ironic-python-agent.initramfs | zcat | cpio -ivd | pax -r
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install an RPM package to the extracted contents:
rpm2cpio ~/RPMs/python-proliantutils-2.1.7-1.el7ost.noarch.rpm | pax -r
# rpm2cpio ~/RPMs/python-proliantutils-2.1.7-1.el7ost.noarch.rpm | pax -r
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Recreate the new ramdisk:
find . 2>/dev/null | cpio --quiet -c -o | gzip -8 > /home/stack/images/ironic-python-agent.initramfs chown stack: /home/stack/images/ironic-python-agent.initramfs
# find . 2>/dev/null | cpio --quiet -c -o | gzip -8 > /home/stack/images/ironic-python-agent.initramfs # chown stack: /home/stack/images/ironic-python-agent.initramfs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the new package now exists in the ramdisk:
lsinitrd /home/stack/images/ironic-python-agent.initramfs | grep proliant
# lsinitrd /home/stack/images/ironic-python-agent.initramfs | grep proliant
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. QCOW: Installing virt-customize to director Copy linkLink copied to clipboard!
The libguestfs-tools
package contains the virt-customize
tool.
Procedure
Install the
libguestfs-tools
from therhel-8-for-x86_64-appstream-eus-rpms
repository:sudo yum install libguestfs-tools
$ sudo yum install libguestfs-tools
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you install the libguestfs-tools
package on the undercloud, disable iscsid.socket
to avoid port conflicts with the tripleo_iscsid
service on the undercloud:
sudo systemctl disable --now iscsid.socket
$ sudo systemctl disable --now iscsid.socket
3.4. QCOW: Inspecting the overcloud image Copy linkLink copied to clipboard!
Before you can review the contents of the overcloud-full.qcow2
image, you must create a virtual machine that uses this image.
Procedure
To create a virtual machine instance that uses the
overcloud-full.qcow2
image, use theguestmount
command:mkdir ~/overcloud-full guestmount -a overcloud-full.qcow2 -i --ro ~/overcloud-full
$ mkdir ~/overcloud-full $ guestmount -a overcloud-full.qcow2 -i --ro ~/overcloud-full
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can review the contents of the QCOW2 image in
~/overcloud-full
.Alternatively, you can use virt-manager to create a virtual machine with the following boot options:
- Kernel path: /overcloud-full.vmlinuz
- initrd path: /overcloud-full.initrd
- Kernel arguments: root=/dev/sda
3.5. QCOW: Setting the root password Copy linkLink copied to clipboard!
Set the root password to provide administrator-level access for your nodes through the console.
Procedure
Set the password for the root user on image:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --root-password password:test
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --root-password password:test [ 0.0] Examining the guest ... [ 18.0] Setting a random seed [ 18.0] Setting passwords [ 19.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.6. QCOW: Registering the image Copy linkLink copied to clipboard!
Register your overcloud image to the Red Hat Content Delivery Network.
Procedure
Register your image temporarily to enable Red Hat repositories relevant to your customizations:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager register --username=[username] --password=[password]'
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager register --username=[username] --password=[password]' [ 0.0] Examining the guest ... [ 10.0] Setting a random seed [ 10.0] Running: subscription-manager register --username=[username] --password=[password] [ 24.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the [username] and [password] with your Red Hat customer account details. This runs the following command on the image:
subscription-manager register --username=[username] --password=[password]
subscription-manager register --username=[username] --password=[password]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.7. QCOW: Attaching a subscription and enabling Red Hat repositories Copy linkLink copied to clipboard!
Procedure
Find a list of pool ID from your account subscriptions:
sudo subscription-manager list
$ sudo subscription-manager list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Choose a subscription pool ID and attach it to the image:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager attach --pool [subscription-pool]'
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager attach --pool [subscription-pool]' [ 0.0] Examining the guest ... [ 12.0] Setting a random seed [ 12.0] Running: subscription-manager attach --pool [subscription-pool] [ 52.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the [subscription-pool] with your chosen subscription pool ID:
subscription-manager attach --pool [subscription-pool]
subscription-manager attach --pool [subscription-pool]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This adds the pool to the image so that you can enable the repositories.
Enable the Red Hat repositories:
subscription-manager repos --enable=[repo-id]
$ subscription-manager repos --enable=[repo-id]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.8. QCOW: Copying a custom repository file Copy linkLink copied to clipboard!
Adding third-party software to the image requires additional repositories. The following is an example repo file that contains configuration to use the OpenDaylight repository content.
Procedure
List the contents of the
opendaylight.repo
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the repository file on to the image:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --upload opendaylight.repo:/etc/yum.repos.d/
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --upload opendaylight.repo:/etc/yum.repos.d/ [ 0.0] Examining the guest ... [ 12.0] Setting a random seed [ 12.0] Copying: opendaylight.repo to /etc/yum.repos.d/ [ 13.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The --upload option copies the repository file to
/etc/yum.repos.d/
on the overcloud image.
Important: Red Hat does not offer support for software from non-certified vendors. Check with your Red Hat support representative that the software you want to install is supported.
3.9. QCOW: Installing RPMs Copy linkLink copied to clipboard!
Procedure
Use the
virt-customize
command to install packages to the image:virt-customize --selinux-relabel -a overcloud-full.qcow2 --install opendaylight
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --install opendaylight [ 0.0] Examining the guest ... [ 11.0] Setting a random seed [ 11.0] Installing packages: opendaylight [ 91.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
--install
option to specify a package to install.
3.10. QCOW: Cleaning the subscription pool Copy linkLink copied to clipboard!
Procedure
After you install the necessary packages to customize the image, remove the subscription pools and unregister the image:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager remove --all'
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager remove --all' [ 0.0] Examining the guest ... [ 12.0] Setting a random seed [ 12.0] Running: subscription-manager remove --all [ 18.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.11. QCOW: Unregistering the image Copy linkLink copied to clipboard!
Procedure
Unregister the image so that the overcloud deployment process can deploy the image to your nodes and register each of them individually:
virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager unregister'
$ virt-customize --selinux-relabel -a overcloud-full.qcow2 --run-command 'subscription-manager unregister' [ 0.0] Examining the guest ... [ 11.0] Setting a random seed [ 11.0] Running: subscription-manager unregister [ 17.0] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.12. QCOW: Reset the machine ID Copy linkLink copied to clipboard!
Procedure
Reset the machine ID for the image so that machines that use this image do not use duplicate machine IDs:
virt-sysprep --operation machine-id -a overcloud-full.qcow2
$ virt-sysprep --operation machine-id -a overcloud-full.qcow2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.13. Uploading the images to director Copy linkLink copied to clipboard!
After you modify the image, you need to upload it to director.
Procedure
Source the
stackrc
file so that you can access director from the command line:source stackrc
$ source stackrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the default director images to use for deploying the overcloud:
openstack overcloud image upload --image-path /home/stack/images/
$ openstack overcloud image upload --image-path /home/stack/images/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This uploads the following images into the director:
- bm-deploy-kernel
- bm-deploy-ramdisk
- overcloud-full
- overcloud-full-initrd
overcloud-full-vmlinuz
The script also installs the introspection images on the directors PXE server.
View a list of the images in the CLI:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This list does not show the introspection PXE images (agent.*). Director copies these files to
/httpboot
.Copy to Clipboard Copied! Toggle word wrap Toggle overflow