Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 6. Deploying a RHEL for Edge image in a network-based environment
You can deploy a RHEL for Edge image using the RHEL installer graphical user interface or a Kickstart file. The overall process for deploying a RHEL for Edge image depends on whether your deployment environment is network-based or non-network-based.
To deploy the images on bare metal, use a Kickstart file.
Network-based deployments
Deploying a RHEL for Edge image in a network-based environment involves the following high-level steps:
- Extract the image file contents.
- Set up a web server
- Install the image
6.1. Extracting the RHEL for Edge image commit Copier lienLien copié sur presse-papiers!
After you download the commit, extract the .tar file and note the ref name and the commit ID.
The downloaded commit file consists of a .tar file with an OSTree repository. The OSTree repository has a commit and a compose.json file.
The compose.json file has information metadata about the commit with information such as the "Ref", the reference ID and the commit ID. The commit ID has the RPM packages.
To extract the package contents, perform the following the steps:
Prerequisites
- Create a Kickstart file or use an existing one.
Procedure
Extract the downloaded image
.tarfile:tar xvf <UUID>-commit.tar
# tar xvf <UUID>-commit.tarCopy to Clipboard Copied! Toggle word wrap Toggle overflow Go to the directory where you have extracted the
.tarfile.It has a
compose.jsonfile and an OSTree directory. Thecompose.jsonfile has the commit number and theOSTreedirectory has the RPM packages.Open the
compose.jsonfile and note the commit ID number. You need this number handy when you proceed to set up a web server.If you have the
jqJSON processor installed, you can also retrieve the commit ID by using thejqtool:jq '.["ostree-commit"]' < compose.json
# jq '.["ostree-commit"]' < compose.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the RPM packages in the commit.
rpm-ostree db list rhel/8/x86_64/edge --repo=repo
# rpm-ostree db list rhel/8/x86_64/edge --repo=repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use a Kickstart file to run the RHEL installer. Optionally, you can use any existing file or can create one by using the Kickstart Generator tool.
In the Kickstart file, ensure that you include the details about how to provision the file system, create a user, and how to fetch and deploy the RHEL for Edge image. The RHEL installer uses this information during the installation process.
The following is a Kickstart file example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The OStree-based installation uses the
ostreesetupcommand to set up the configuration. It fetches the OSTree commit, by using the following flags:-
--nogpg- Disable GNU Privacy Guard (GPG) key verification. -
--osname- Management root for the operating system installation. -
--remote- Management root for the operating system installation -
--url- URL of the repository to install from. -
--ref- Name of the branch from the repository that the installation uses. --url=http://mirror.example.com/repo/- is the address of the host system where you extracted the edge commit and served it overnginx. You can use the address to reach the host system from the guest computer.For example, if you extract the commit image in the
/var/www/htmldirectory and serve the commit overnginxon a computer whose hostname iswww.example.com, the value of the--urlparameter ishttp://www.example.com/repo.NoteUse the http protocol to start a service to serve the commit, because https is not enabled on the Apache HTTP Server.
-
6.2. Setting up a web server to install RHEL for Edge images Copier lienLien copié sur presse-papiers!
After you have extracted the RHEL for Edge image contents, set up a web server to provide the image commit details to the RHEL installer by using HTTPd.
Prerequisites
- You have root access to the RHEL system.
Procedure
Install the HTTPd server package:
dnf install httpd
$ dnf install httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the extracted RHEL for Edge image content to the web server document root:
cp kickstart.ks /var/www/html/ cp -r repo /var/www/html/ cp <uuid_commit>.tar /var/www/html/
# cp kickstart.ks /var/www/html/ # cp -r repo /var/www/html/ # cp <uuid_commit>.tar /var/www/html/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the HTTPd service:
systemctl enable --now httpd systemctl status httpd.service
# systemctl enable --now httpd # systemctl status httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the firewall to enable HTTP traffic:
firewall-cmd --permanent --add-service=http firewall-cmd --reload
# firewall-cmd --permanent --add-service=http # firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow The server is now set up and ready to start the RHEL Installer by using the
commit.tarrepository and the Kickstart file.The files are accessible at the following locations:
http://_<your_server_ip>_/kickstart.ks http://_<your_server_ip>_/repo/ http://_<your_server_ip>_/_<uuid_commit>_.tar
http://_<your_server_ip>_/kickstart.ks
http://_<your_server_ip>_/repo/
http://_<your_server_ip>_/_<uuid_commit>_.tar
6.3. Performing an attended installation to an edge device by using Kickstart Copier lienLien copié sur presse-papiers!
For an attended installation in a network-based environment, you can install the RHEL for Edge image to a device by using the RHEL Installer ISO, a Kickstart file, and a web server. The web server serves the RHEL for Edge Commit and the Kickstart file to boot the RHEL Installer ISO image.
Prerequisites
- You have made the RHEL for Edge Commit available by running a web server. See Setting up a web server to install RHEL for Edge images.
-
You have created a
.qcow2disk image to be used as the target of the attended installation. See Creating a virtual disk image by using qemu-img.
Procedure
Create a Kickstart file. The following is an example in which the
ostreesetupdirective instructs the Anaconda Installer to fetch and deploy the commit. Additionally, it creates a user and a password.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the RHEL Anaconda Installer by using the
libvirt virt-installutility to create a virtual machine (VM) with a RHEL operating system. Use the.qcow2disk image as the target disk in the attended installation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the installation screen:
Figure 6.1. Red Hat Enterprise Linux boot menu
Press the key to add an additional kernel parameter:
inst.ks=http://web-server_device_ip:port/kickstart.ks
inst.ks=http://web-server_device_ip:port/kickstart.ksCopy to Clipboard Copied! Toggle word wrap Toggle overflow The kernel parameter specifies that you want to install RHEL by using the Kickstart file and not the RHEL image contained in the RHEL Installer.
After adding the kernel parameters, press Ctrl+X to boot the RHEL installation by using the Kickstart file.
The RHEL Installer starts, fetches the Kickstart file from the server (HTTP) endpoint and executes the commands, including the command to install the RHEL for Edge image commit from the HTTP endpoint. After the installation completes, the RHEL Installer prompts you for login details.
Verification
- On the Login screen, enter your user account credentials and click .
Verify whether the RHEL for Edge image is successfully installed.
rpm-ostree status
$ rpm-ostree statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command output provides the image commit ID and shows that the installation is successful.
Following is a sample output:
State: idle Deployments: * ostree://edge:rhel/8/x86_64/edge Timestamp: 2020-09-18T20:06:54Z Commit: 836e637095554e0b634a0a48ea05c75280519dd6576a392635e6fa7d4d5e96
State: idle Deployments: * ostree://edge:rhel/8/x86_64/edge Timestamp: 2020-09-18T20:06:54Z Commit: 836e637095554e0b634a0a48ea05c75280519dd6576a392635e6fa7d4d5e96Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Performing an unattended installation to an edge device by using Kickstart Copier lienLien copié sur presse-papiers!
For an unattended installation in a network-based environment, you can install the RHEL for Edge image to an Edge device by using a Kickstart file and a web server. The web server serves the RHEL for Edge Commit and the Kickstart file, and both artifacts are used to start the RHEL Installer ISO image.
Prerequisites
-
You have the
qemu-imgutility installed on your host system. -
You have created a
.qcow2disk image to install the commit you created. See Creating a system image with RHEL image builder in the CLI. - You have a running web server. See Creating a RHEL for Edge Container image for non-network-based deployments.
Procedure
- Run a RHEL for Edge Container image to start a web server. The server fetches the commit in the RHEL for Edge Container image and becomes available and running.
Run the RHEL Anaconda Installer, passing the customized
.qcow2disk image, by usinglibvirt virt-install:Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the installation screen:
Figure 6.2. Red Hat Enterprise Linux boot menu
Press the key and add the Kickstart kernel argument:
inst.ks=http://web-server_device_ip:port/kickstart.ks
inst.ks=http://web-server_device_ip:port/kickstart.ksCopy to Clipboard Copied! Toggle word wrap Toggle overflow The kernel parameter specifies that you want to install RHEL by using the Kickstart file and not the RHEL image contained in the RHEL Installer.
After adding the kernel parameters, press Ctrl+X to boot the RHEL installation by using the Kickstart file.
The RHEL Installer starts, fetches the Kickstart file from the server (HTTP) endpoint, and executes the commands, including the command to install the RHEL for Edge image commit from the HTTP endpoint. After the installation completes, the RHEL Installer prompts you for login details.
Verification
- On the Login screen, enter your user account credentials and click .
Verify whether the RHEL for Edge image is successfully installed.
rpm-ostree status
$ rpm-ostree statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command output provides the image commit ID and shows that the installation is successful.
The following is a sample output:
State: idle Deployments: * ostree://edge:rhel/8/x86_64/edge Timestamp: 2020-09-18T20:06:54Z Commit: 836e637095554e0b634a0a48ea05c75280519dd6576a392635e6fa7d4d5e96
State: idle Deployments: * ostree://edge:rhel/8/x86_64/edge Timestamp: 2020-09-18T20:06:54Z Commit: 836e637095554e0b634a0a48ea05c75280519dd6576a392635e6fa7d4d5e96Copy to Clipboard Copied! Toggle word wrap Toggle overflow