Questo contenuto non è disponibile nella lingua selezionata.
Chapter 3. Overcloud Images
The Red Hat OpenStack Platform director provides images for the Overcloud. The QCOW image in this collection contains a base set of software components that integrate together 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 installing additional components to nodes.
This document describes a series of actions to use the virt-customize tool to modify an existing Overcloud image to augment an existing Controller node. For example, you can use these procedures to install additional ml2 plugins, Cinder backends, or monitoring agents not shipped with the initial image.
If you modify the Overcloud image to include third-party software and report an issue, Red Hat may request you reproduce the issue using an unmodified image in accordance with our general third-party support policy: https://access.redhat.com/articles/1067.
3.1. Obtaining the Overcloud Images Copia collegamentoCollegamento copiato negli appunti!
The director requires several disk images for provisioning Overcloud nodes. This includes:
- A introspection kernel and ramdisk - Used for bare metal system introspection over PXE boot.
- A deployment kernel and ramdisk - Used for system provisioning and deployment.
- An Overcloud kernel, ramdisk, and full image - A base Overcloud system that is written to the node’s hard disk.
Obtain these images from the rhosp-director-images
and rhosp-director-images-ipa
packages:
sudo yum install rhosp-director-images rhosp-director-images-ipa
$ sudo yum install rhosp-director-images rhosp-director-images-ipa
Extract the archives to the images
directory on the stack
user’s home (/home/stack/images
):
cd ~/images for i in /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar; do tar -xvf $i; done
$ cd ~/images
$ for i in /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar; do tar -xvf $i; done
3.2. Initrd: Modifying the Initial Ramdisks Copia collegamentoCollegamento copiato negli appunti!
Some situations might require you to modify the initial ramdisk. For example, you might require a certain driver available when you boot the nodes during the introspection or provisioning processes. The following procedure shows how to modify an initial ramdisk. In the context of the Overcloud, this includes either:
-
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.
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
Use the skipcpio
and `cpio 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
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
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
Verify 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
3.3. QCOW: Installing virt-customize to the director Copia collegamentoCollegamento copiato negli appunti!
The libguestfs-tools package contains the virt-customize tool. Install the libguestfs-tools from the rhel-7-server-rpms repository:
sudo yum install libguestfs-tools
$ sudo yum install libguestfs-tools
3.4. QCOW: Inspecting the Overcloud Image Copia collegamentoCollegamento copiato negli appunti!
You might aim to explore the contents of the overcloud-full.qcow2. Create a virtual machine instance using either the qemu-system-x86_64 command:
sudo qemu-system-x86_64 --kernel overcloud-full.vmlinuz --initrd overcloud-full.initrd -m 1024 --append root=/dev/sda --enable-kvm overcloud-full.qcow2
$ sudo qemu-system-x86_64 --kernel overcloud-full.vmlinuz --initrd overcloud-full.initrd -m 1024 --append root=/dev/sda --enable-kvm overcloud-full.qcow2
Or using the following boot options in virt-manager:
- Kernel path: /overcloud-full.vmlinuz
- initrd path: /overcloud-full.initrd
- Kernel arguments: root=/dev/sda
3.5. QCOW: Setting the Root Password Copia collegamentoCollegamento copiato negli appunti!
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
This provides administration-level access for your nodes through the console.
3.6. QCOW: Registering the Image Copia collegamentoCollegamento copiato negli appunti!
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
Make sure to 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]
This registers your Overcloud image to the Red Hat Content Delivery Network:
3.7. QCOW: Attaching a Subscription and Enabling Red Hat Repositories Copia collegamentoCollegamento copiato negli appunti!
Find a list of pool ID from your account’s subscriptions:
sudo subscription-manager list
$ sudo subscription-manager list
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
Make sure to replace the [subscription-pool] with your chosen subscription pool ID. This runs the following command on the image:
subscription-manager attach --pool [subscription-pool]
subscription-manager attach --pool [subscription-pool]
This adds the pool to the image, which allows you to enable Red Hat repositories with the following command:
subscription-manager repos --enable=[repo-id]
$ subscription-manager repos --enable=[repo-id]
3.8. QCOW: Copying a Custom Repository File Copia collegamentoCollegamento copiato negli appunti!
Adding third-party software to the image requires additional repositories. For example, the following is an example repo file that contains configuration to use the OpenDaylight repository content:
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
The --copy-in 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 aim to install is supported.
3.9. QCOW: Installing RPMs Copia collegamentoCollegamento copiato negli appunti!
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
The --install option allows you to specify a package to install.
3.10. QCOW: Cleaning the Subscription Pool Copia collegamentoCollegamento copiato negli appunti!
After installing the necessary packages to customize the image, we now remove our subscriptions 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
This removes all subscription pools from the image.
3.11. QCOW: Unregistering the Image Copia collegamentoCollegamento copiato negli appunti!
Finally, unregister the image. This is so 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
3.12. Uploading the Images to the Director Copia collegamentoCollegamento copiato negli appunti!
After modifying the image, upload it to the director. Make sure to source the stackrc file so that you can access the director from the command line:
source stackrc openstack overcloud image upload --image-path /home/stack/images/
$ source stackrc
$ openstack overcloud image upload --image-path /home/stack/images/
This uploads the following images into the director: bm-deploy-kernel, bm-deploy-ramdisk, overcloud-full, overcloud-full-initrd, and overcloud-full-vmlinuz. These are the images for deployment and the Overcloud. The script also installs the introspection images on the director’s PXE server. View a list of the images in the CLI using the following command:
This list will not show the introspection PXE images (agent.*). The director copies these files to /httpboot.