Chapter 5. Upgrading and Downgrading
5.1. Setting up an Atomic Compose Server リンクのコピーリンクがクリップボードにコピーされました!
This procedure explains how to set up an Atomic Compose server. It is possible to use an Atomic Compose server to create atomic update trees. The procedure here explains how to set up an Atomic Compose server that creates a local mirror of the upstream OSTree repository.
Log into a shell on the host, and run the Atomic Tools container.
atomic run rhel7/rhel-tools
# atomic run rhel7/rhel-toolsCopy to Clipboard Copied! Toggle word wrap Toggle overflow From inside the tools container, create an unprivileged user.
adduser container
# adduser containerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Acquire the entitlement certificates and use
chownto make them owned by the unprivileged container user.cd ~container # cp /host/etc/pki/entitlement/*.pem . chown container: *.pem runuser -u container bash
# cd ~container # cp /host/etc/pki/entitlement/*.pem . # chown container: *.pem # runuser -u container bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log out of the root account.
exit
# exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWe use /host/var/tmp/repo so the data is outside of the container. This could be a remote mount point to Ceph/etc.
Put the entitlement certificates inside the repo directory.
cd /host/var/tmp mkdir repo && ostree --repo=repo init --mode=archive-z2 mv ~/*.pem repo/
$ cd /host/var/tmp $ mkdir repo && ostree --repo=repo init --mode=archive-z2 $ mv ~/*.pem repo/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the remote configuration from the host into the repository:
cat /host/etc/ostree/remotes.d/redhat.conf >> repo/config
$ cat /host/etc/ostree/remotes.d/redhat.conf >> repo/configCopy to Clipboard Copied! Toggle word wrap Toggle overflow Change variables
Edit repo/config and change the tls-client-* variables to look like the ones below. This tells the command where to find the client certificates that are necessary to access the CDN.
tls-client-cert-path = ./repo/123451234512345.pem tls-client-key-path = ./repo/123451234512345-key.pem
tls-client-cert-path = ./repo/123451234512345.pem tls-client-key-path = ./repo/123451234512345-key.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Final steps
Everything is now set up. The following command will incrementally mirror all of the content. It is possible to run the command from a cron job or systemd timer.
ostree --repo=repo pull --mirror rhel-atomic-host-ostree
$ ostree --repo=repo pull --mirror rhel-atomic-host-ostreeCopy to Clipboard Copied! Toggle word wrap Toggle overflow For client machines, change /etc/ostree/remotes.d/redhat.conf to point to a static web server that is exporting the repo directory.
5.2. Upgrading to a New Version リンクのコピーリンクがクリップボードにコピーされました!
Unlike Red Hat Enterprise Linux 7 which uses Yum and has a traditional package management model, RHEL Atomic Host uses OSTree and is upgraded by preparing a new operating system root, and making it the default for the next boot.
To perform an upgrade, execute the following commands:
atomic host upgrade systemctl reboot
# atomic host upgrade
# systemctl reboot
The OSTrees are downloaded securely. However, if you want, you can manually verify the provenance of the OSTree to which you are upgrading. See Manually Verifying OS Trees.
If you are using a system that requires an HTTP proxy, the proxy is configured with an environment variable. To configure the environment variable, use a command similar to the following one:
env http_proxy=http://proxy.example.com:port/ atomic host upgrade
# env http_proxy=http://proxy.example.com:port/ atomic host upgrade
5.3. Rolling Back to a Previous Version リンクのコピーリンクがクリップボードにコピーされました!
To revert to a previous installation of Red Hat Enterprise Linux Atomic Host, execute the following commands:
atomic host rollback systemctl reboot
# atomic host rollback
# systemctl reboot
Two versions of Red Hat Enterprise Linux Atomic Host are available on the system after the initial upgrade. One is the currently running version. The other is either a new version recently installed from an upgrade or the version that was in place prior to the last upgrade.
Configuration is preserved across updates, but is only forward-preserved. This means that if you make a configuration change and then later roll back to a previous version, the configuration change you made is reverted.
Running the atomic host upgrade command will replace the non-running version of Red Hat Enterprise Linux Atomic Host. This version will also be configured to be used during the next boot.
To determine which version of the operating system is running, execute the following command:
atomic host status
# atomic host status
The output that includes the hash name of the directory in the /ostree/deploy/rhel-atomic-host/ directory looks like this:
This fictional sample output shows that version 7.3 will be booted into on the next restart. The version to be booted on the next restart is printed first.
This fictional sample also shows that version 7.2.7 is the currently running version. The currently running version is marked with an asterisk (*).
This output was created just after the atomic host upgrade command was executed, and that means that a new version has been staged to be applied at the next restart.
5.4. Generating the initramfs Image on the Client リンクのコピーリンクがクリップボードにコピーされました!
By default, Atomic Host uses a generic initramfs image built on the server side. This is distinct from the yum-based Red Hat Enterprise Linux, where initramfs is generated per installation. However, in some situations, additional configuration or content may need to be added, which requires generating initramfs on the client side.
To make an Atomic Host client machine generate initramfs on every upgrade, run:
rpm-ostree initramfs --enable
$ rpm-ostree initramfs --enable
After this, on every upgrade, the client runs the dracut program, which builds the new initramfs.
To disable generating initramfs on the client, run:
rpm-ostree initramfs --disable
$ rpm-ostree initramfs --disable