Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Appendix C. Building Cloud Images for Red Hat Satellite
Use this section to build and register images to Red Hat Satellite.
You can use a preconfigured Red Hat Enterprise Linux KVM guest QCOW2 image:
			These images contain cloud-init. To function properly, they must use ec2-compatible metadata services for provisioning an SSH key.
		
For the KVM guest images:
- 
						The rootaccount in the image is disabled, butsudoaccess is granted to a special user namedcloud-user.
- 
						There is no rootpassword set for this image. Therootpassword is locked in/etc/shadowby placing!!in the second field.
If you want to create custom Red Hat Enterprise Linux images, see Composing a customized Red Hat Enterprise Linux 8 Image or Image Builder Guide for Red Hat Enterprise Linux 7
C.1. Creating Custom Red Hat Enterprise Linux Images
Prerequisites
- Use a Linux host machine to create an image. In this example, we use a Red Hat Enterprise Linux 7 Workstation.
- 
						Use virt-manageron your workstation to complete this procedure. If you create the image on a remote server, connect to the server from your workstation withvirt-manager.
- A Red Hat Enterprise Linux 7 or 6 ISO file (see Red Hat Enterprise Linux 7.4 Binary DVD or Red Hat Enterprise Linux 6.9 Binary DVD).
For more information about installing a Red Hat Enterprise Linux Workstation, see Red Hat Enterprise Linux 7 Installation Guide.
Before you can create custom images, install the following packages:
- Install - libvirt,- qemu-kvm, and graphical tools:- yum install virt-manager virt-viewer libvirt qemu-kvm - # yum install virt-manager virt-viewer libvirt qemu-kvm- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Install the following command line tools: - yum install virt-install libguestfs-tools-c - # yum install virt-install libguestfs-tools-c- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
					In the following procedures, enter all commands with the [root@host]# prompt on the workstation that hosts the libvirt environment.
				
C.2. Supported Clients in Registration
Satellite supports the following operating systems and architectures for registration.
- Supported Host Operating Systems
- The hosts can use the following operating systems: - Red Hat Enterprise Linux 9, 8, 7
- Red Hat Enterprise Linux 6 with the ELS Add-On
 
- Supported Host Architectures
- The hosts can use the following architectures: - i386
- x86_64
- s390x
- ppc_64
 
C.3. Configuring a Host for Registration
Configure your host for registration to Satellite Server or Capsule Server.
Prerequisites
- The host must be using a supported operating system. For more information, see Section C.2, “Supported Clients in Registration”.
Procedure
- Ensure that a time-synchronization tool is enabled and running on the host.
C.4. Registering a Host
You can register a host by using registration templates and set up various integration features and host tools during the registration process.
Prerequisites
- 
						Your user account has a role assigned that has the create_hostspermission.
- You must have root privileges on the host that you want to register.
- Satellite Server, any Capsule Servers, and all hosts must be synchronized with the same NTP server, and have a time synchronization tool enabled and running.
- An activation key must be available for the host. For more information, see Managing Activation Keys in Managing Content.
- If you want to use Capsule Servers instead of your Satellite Server, ensure that you have configured your Capsule Servers accordingly. For more information, see Configuring Capsule for Host Registration and Provisioning in Installing Capsule Server.
- If your Satellite Server or Capsule Server is behind an HTTP proxy, configure the Subscription Manager on your host to use the HTTP proxy for connection. For more information, see How to access Red Hat Subscription Manager (RHSM) through a firewall or proxy in the Red Hat Knowledgebase.
Procedure
- In the Satellite web UI, navigate to Hosts > Register Host.
- Optional: Select a different Organization.
- Optional: Select a different Location.
- Optional: From the Host Group list, select the host group to associate the hosts with. Fields that inherit value from Host group: Operating system, Activation Keys and Lifecycle environment.
- Optional: From the Operating system list, select the operating system of hosts that you want to register.
- Optional: From the Capsule list, select the Capsule to register hosts through.
- Optional: Select the Insecure option, if you want to make the first call insecure. During this first call, hosts download the CA file from Satellite. Hosts will use this CA file to connect to Satellite with all future calls making them secure. - Red Hat recommends that you avoid insecure calls. - If an attacker, located in the network between Satellite and a host, fetches the CA file from the first insecure call, the attacker will be able to access the content of the API calls to and from the registered host and the JSON Web Tokens (JWT). Therefore, if you have chosen to deploy SSH keys during registration, the attacker will be able to access the host using the SSH key. - Instead, you can manually copy and install the CA file on each host before registering the host. - To do this, find where Satellite stores the CA file by navigating to Administer > Settings > Authentication and locating the value of the SSL CA file setting. - Copy the CA file to the - /etc/pki/ca-trust/source/anchors/directory on hosts and enter the following commands:- update-ca-trust enable update-ca-trust - # update-ca-trust enable # update-ca-trust- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Then register the hosts with a secure - curlcommand, such as:- curl -sS https://satellite.example.com/register ... - # curl -sS https://satellite.example.com/register ...- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The following is an example of the - curlcommand with the- --insecureoption:- curl -sS --insecure https://satellite.example.com/register ... - # curl -sS --insecure https://satellite.example.com/register ...- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Select the Advanced tab.
- From the Setup REX list, select whether you want to deploy Satellite SSH keys to hosts or not. - If set to - Yes, public SSH keys will be installed on the registered host. The inherited value is based on the- host_registration_remote_executionparameter. It can be inherited, for example from a host group, an operating system, or an organization. When overridden, the selected value will be stored on host parameter level.
- From the Setup Insights list, select whether you want to install - insights-clientand register the hosts to Insights.- The Insights tool is available for Red Hat Enterprise Linux only. It has no effect on other operating systems. - You must enable the following repositories on a registered machine: - 
								RHEL 6: rhel-6-server-rpms
- 
								RHEL 7: rhel-7-server-rpms
- RHEL 8: - rhel-8-for-x86_64-appstream-rpms- The - insights-clientpackage is installed by default on RHEL 8 except in environments whereby RHEL 8 was deployed with "Minimal Install" option.
 
- 
								RHEL 6: 
- 
						Optional: In the Install packages field, list the packages (separated with spaces) that you want to install on the host upon registration. This can be set by the host_packagesparameter.
- 
						Optional: Select the Update packages option to update all packages on the host upon registration. This can be set by the host_update_packagesparameter.
- 
						Optional: In the Repository field, enter a repository to be added before the registration is performed. For example, it can be useful to make the subscription-managerpackage available for the purpose of the registration. For Red Hat family distributions, enter the URL of the repository, for examplehttp://rpm.example.com/.
- Optional: In the Repository GPG key URL field, specify the public key to verify the signatures of GPG-signed packages. It needs to be specified in the ASCII form with the GPG public key header.
- Optional: In the Token lifetime (hours) field, change the validity duration of the JSON Web Token (JWT) that Satellite uses for authentication. The duration of this token defines how long the generated - curlcommand works. You can set the duration to 0 – 999 999 hours or unlimited.- Note that Satellite applies the permissions of the user who generates the - curlcommand to authorization of hosts. If the user loses or gains additional permissions, the permissions of the JWT change too. Therefore, do not delete, block, or change permissions of the user during the token duration.- The scope of the JWTs is limited to the registration endpoints only and cannot be used anywhere else. 
- Optional: In the Remote Execution Interface field, enter the identifier of a network interface that hosts must use for the SSH connection. If you keep this field blank, Satellite uses the default network interface.
- In the Activation Keys field, enter one or more activation keys to assign to hosts.
- Optional: Select the Lifecycle environment.
- Optional: Select the Ignore errors option if you want to ignore subscription manager errors.
- 
						Optional: Select the Force option if you want to remove any katello-ca-consumerrpms before registration and runsubscription-managerwith the--forceargument.
- Click the Generate button.
- 
						Copy the generated curlcommand.
- 
						On the host that you want to register, run the curlcommand asroot.
C.5. Installing the Katello Agent
You can install the Katello agent to remotely update Satellite clients.
The Katello agent is deprecated and will be removed in a future Satellite version. Migrate your processes to use the remote execution feature to update clients remotely. For more information, see Migrating Hosts from Katello Agent to Remote Execution in Managing Hosts.
				The katello-agent package depends on the gofer package that provides the goferd service.
			
Prerequisites
- You have enabled the Satellite Client 6 repository on Satellite Server. For more information, see Enabling the Satellite Client 6 Repository in Installing Satellite Server in a Connected Network Environment.
- You have synchronized the Satellite Client 6 repository on Satellite Server. For more information, see Synchronizing the Satellite Client 6 Repository in Installing Satellite Server in a Connected Network Environment.
- You have enabled the Satellite Client 6 repository on the client.
Procedure
- Install the - katello-agentpackage:- yum install katello-agent - # yum install katello-agent- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Start the - goferdservice:- systemctl start goferd - # systemctl start goferd- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
C.6. Installing and Configuring Puppet Agent on a Host Manually
Install and configure the Puppet agent on a host manually.
Prerequisites
- The host must have a Puppet environment assigned to it.
- The Satellite Client 6 repository must be enabled and synchronized to Satellite Server, and enabled on the host. For more information, see Importing Content in Managing Content.
Procedure
- 
						Log in to the host as the rootuser.
- Install the Puppet agent package. - On hosts running Red Hat Enterprise Linux 8 and above: - dnf install puppet-agent - # dnf install puppet-agent- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- On hosts running Red Hat Enterprise Linux 7 and below: - yum install puppet-agent - # yum install puppet-agent- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Add the Puppet agent to - PATHin your current shell using the following script:- . /etc/profile.d/puppet-agent.sh - . /etc/profile.d/puppet-agent.sh- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Configure the Puppet agent. Set the - environmentparameter to the name of the Puppet environment to which the host belongs:- puppet config set server satellite.example.com --section agent puppet config set environment My_Puppet_Environment --section agent - # puppet config set server satellite.example.com --section agent # puppet config set environment My_Puppet_Environment --section agent- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Start the Puppet agent service: - puppet resource service puppet ensure=running enable=true - # puppet resource service puppet ensure=running enable=true- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a certificate for the host: - puppet ssl bootstrap - # puppet ssl bootstrap- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- In the Satellite web UI, navigate to Infrastructure > Capsules.
- From the list in the Actions column for the required Capsule Server, select Certificates.
- Click Sign to the right of the required host to sign the SSL certificate for the Puppet agent.
- On the host, run the Puppet agent again: - puppet ssl bootstrap - # puppet ssl bootstrap- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Additional Resources
- For more information about Puppet, see Managing Configurations Using Puppet Integration in Red Hat Satellite.
C.7. Completing the Red Hat Enterprise Linux 7 Image
Procedure
- Update the system: - {package-update}- # {package-update}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Install the - cloud-initpackages:- yum install cloud-utils-growpart cloud-init - # yum install cloud-utils-growpart cloud-init- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Open the - /etc/cloud/cloud.cfgconfiguration file:- vi /etc/cloud/cloud.cfg - # vi /etc/cloud/cloud.cfg- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Under the heading - cloud_init_modules, add:- - resolv-conf - - resolv-conf- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The - resolv-confoption automatically configures the- resolv.confwhen an instance boots for the first time. This file contains information related to the instance such as- nameservers,- domainand other options.
- Open the - /etc/sysconfig/networkfile:- vi /etc/sysconfig/network - # vi /etc/sysconfig/network- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Add the following line to avoid problems accessing the EC2 metadata service: - NOZEROCONF=yes - NOZEROCONF=yes- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Un-register the virtual machine so that the resulting image does not contain the same subscription details for every instance cloned based on it: - subscription-manager repos --disable=* subscription-manager unregister - # subscription-manager repos --disable=* # subscription-manager unregister- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Power off the instance: - poweroff - # poweroff- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- On your Red Hat Enterprise Linux Workstation, connect to the terminal as the root user and navigate to the - /var/lib/libvirt/images/directory:- cd /var/lib/libvirt/images/ - # cd /var/lib/libvirt/images/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Reset and clean the image using the - virt-sysprepcommand so it can be used to create instances without issues:- virt-sysprep -d rhel7 - # virt-sysprep -d rhel7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Reduce image size using the - virt-sparsifycommand. This command converts any free space within the disk image back to free space within the host:- virt-sparsify --compress rhel7.qcow2 rhel7-cloud.qcow2 - # virt-sparsify --compress rhel7.qcow2 rhel7-cloud.qcow2- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This creates a new - rhel7-cloud.qcow2file in the location where you enter the command.
C.8. Completing the Red Hat Enterprise Linux 6 Image
Procedure
- Update the system: - {package-update}- # {package-update}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Install the - cloud-initpackages:- yum install cloud-utils-growpart cloud-init - # yum install cloud-utils-growpart cloud-init- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Edit the - /etc/cloud/cloud.cfgconfiguration file and under- cloud_init_modulesadd:- - resolv-conf - - resolv-conf- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The - resolv-confoption automatically configures the- resolv.confconfiguration file when an instance boots for the first time. This file contains information related to the instance such as- nameservers,- domain, and other options.
- To prevent network issues, create the - /etc/udev/rules.d/75-persistent-net-generator.rulesfile as follows:- echo "#" > /etc/udev/rules.d/75-persistent-net-generator.rules - # echo "#" > /etc/udev/rules.d/75-persistent-net-generator.rules- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This prevents - /etc/udev/rules.d/70-persistent-net.rulesfile from being created. If- /etc/udev/rules.d/70-persistent-net.rulesis created, networking might not function properly when booting from snapshots (the network interface is created as "eth1" rather than "eth0" and IP address is not assigned).
- Add the following line to - /etc/sysconfig/networkto avoid problems accessing the EC2 metadata service:- NOZEROCONF=yes - NOZEROCONF=yes- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Un-register the virtual machine so that the resulting image does not contain the same subscription details for every instance cloned based on it: - subscription-manager repos --disable=* subscription-manager unregister yum clean all - # subscription-manager repos --disable=* # subscription-manager unregister # yum clean all- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Power off the instance: - poweroff - # poweroff- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- On your Red Hat Enterprise Linux Workstation, log in as root and reset and clean the image using the - virt-sysprepcommand so it can be used to create instances without issues:- virt-sysprep -d rhel6 - # virt-sysprep -d rhel6- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Reduce image size using the - virt-sparsifycommand. This command converts any free space within the disk image back to free space within the host:- virt-sparsify --compress rhel6.qcow2 rhel6-cloud.qcow2 - # virt-sparsify --compress rhel6.qcow2 rhel6-cloud.qcow2- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This creates a new - rhel6-cloud.qcow2file in the location where you enter the command.Note- You must manually resize the partitions of instances based on the image in accordance with the disk space in the flavor that is applied to the instance. 
C.8.1. Next steps
- Repeat the procedures for every image that you want to provision with Satellite.
- Move the image to the location where you want to store for future use.
C.9. Next Steps
- Repeat the procedures for every image that you want to provision with Satellite.
- Move the image to the location where you want to store for future use.