Managing RHEL Atomic Hosts

In this article, I will explain you, how to register RHEL atomic host with Red hat Network and how to update atomic host using Red hat subscription manager.

Note: Before Starting, please make sure you must have a valid Red Hat Network username and password to an account with an available Red Hat Enterprise Linux Atomic Host entitlement to download and update atomic hosts.

Importaint:
The RHEL Atomic Host server must have network connectivity to both subscription.rhn.redhat.com:443 and cdn.redhat.com:443

Register RHEL Atomic Host with RHN:

Step 1:

Open terminal and login with root user.

Enter below command to register with RHN.

bash-4.2# subscription-manager register
Username: rhn-username
Password: rhn-password
The system has been registered with ID: af27f5ed-4f79-46ba-bf37-2e478b83e45b

After successful registration, execute below command to check available list of product for your account.

bash-4.2# subscription-manager list

+——————————————-+
Installed Product Status
+——————————————-+
Product Name: Red Hat Enterprise Linux Atomic Host
Product ID: 271
Version: 7
Arch: x86_64
Status: Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:
Ends:

Step 2:

Execute below command to check available subscription pool and identify pool id for RHEL Atomic Host product.

bash-4.2# subscription-manager list –available | less
…Output omitted…
Subscription Name: Red Hat Employee Subscription
Provides: Red Hat Enterprise Linux Atomic Host
Red Hat Enterprise Linux Atomic Host Beta
Red Hat Enterprise Linux Atomic Host HTB
…Output omitted…
Pool ID: 1234f9843e3d687a013e3ddd3a66ffff

Step 3:

Copy pool id, which we got in previous command output and attach pool to subscribe for update.

bash-4.2# subscription-manager attach –pool=1234f9843e3d687a013e3ddd3a66ffff
Successfully attached a subscription for: Red Hat Employee Subscription

Step 4: Ensure Status of subscription Manager.

bash-4.2# subscription-manager list

+——————————————-+
Installed Product Status
+——————————————-+
Product Name: Red Hat Enterprise Linux Atomic Host
Product ID: 271
Version: 7
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 04/23/2017
Ends: 12/31/2021

Once a RHEL Atomic Host is installed, registered, and subscribed with Red Hat Network, it is a good practice to upgrade the RHEL Atomic bits to run the latest OSTree available. RHEL Atomic uses atomic host command to manage file system OSTrees that are downloaded from cdn.redhat.com. The atomic host command is the utility that downloads and manages these file system OSTrees.The atomic host command invokes the rpm-ostree command in background.

Step 5: Check the atomic host status with atomic host and rpm-ostree commands

bash-4.2# atomic host status
TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC
* 2015-02-05 14:52:09 7.1.0 9d04d17969 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

bash-4.2# rpm-ostree status -p
============================================================
* DEFAULT ON BOOT
—————————————-
version 7.1.0
timestamp 2015-02-05 14:52:09
id 9d04d179695a81a0764916360fc35f64f0de04ffee80bbf9bca66af038541cd4.0
osname rhel-atomic-host
refspec rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
============================================================

The id value in the output of atomic host status and rpm-ostree status is an abbreviated version of the value provided in the output of rpm-ostree status -p. The unabbreviated id value can be used to identify the directory that contains the actual files in the OSTree.

-bash-4.2# ls /ostree/deploy/rhel-atomic-host/deploy/9d04d179695a81a0764916360fc35f64f0de04ffee80bbf9bca66af038541cd4.0
bin dev home lib64 mnt ostree root sbin sys tmp var
boot etc lib media opt proc run srv sysroot usr

Upgradation of RHEL Atomic Host:

Step 1:
Assuming the RHEL Atomic Host is properly registered and subscribed to Red Hat Network, upgrading is accomplished by running the atomic host upgrade command.

bash-4.2# atomic host upgrade
Updating from: rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

613 metadata, 3173 content objects fetched; 122756 KiB transferred in 338 seconds
Copying /etc changes: 10 modified, 4 removed, 36 added
Transaction complete; bootconfig swap: yes deployment count change: 1
Changed:
NetworkManager-1:0.9.9.1-29.git20140326.4dba720.el7_0.x86_64
NetworkManager-glib-1:0.9.9.1-29.git20140326.4dba720.el7_0.x86_64
docker-1.3.2-4.el7.x86_64
dracut-033-161.el7_0.173.x86_64
gnutls-3.1.18-10.el7_0.x86_64
kernel-3.10.0-123.13.1.el7.x86_64
kubernetes-0.6-4.0.git993ef88.el7.x86_64
…Output omitted…

After the atomic host upgrade command successfully runs, a new OSTree should be available for use.

Step 2: Check the host status.

bash-4.2# atomic host status
TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC
2015-02-06 14:52:09 7.1.1 8d04d17868 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
* 2015-02-05 14:52:09 7.1.0 9d04d17969 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

Star in front of output showing cureent selected older version of RHEL Atomic Host software i.e 7.1.0 , Reboot the system to boot with new updated RHEL Atomic Host.

Step 3:
bash-4.2# systemctl reboot

Check the host status

bash-4.2# atomic host status
TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC
* 2015-02-06 14:52:09 7.1.1 8d04d17868 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
2015-02-05 14:52:09 7.1.0 dcf0c846ff rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

So here we upgraded our RHEL Atomic Host using Red hat Network.

Step 4:

In case you need to revert back up gradation use below command, this will rollback to your older version of RHEL Atomic Host i.e 7.1.0

bash-4.2# atomic host rollback
Moving ‘dcf0c846ff87f251d48439f6c90948f1183654a9b9d46b28c3f5e0f42c1ddf8e.0’ to be first deployment
Transaction complete; bootconfig swap: yes deployment count change: 0
…Output omitted…
Successfully reset deployment order; run “systemctl reboot” to start a reboot
bash-4.2# atomic host status
TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC
2015-02-05 14:52:09 7.1.0 dcf0c846ff rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
* 2015-02-06 14:52:09 7.1.1 8d04d17868 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

Note:
The yum and rpm commands cannot be used to upgrade software on a RHEL Atomic Host. yum is not installed. rpm should only be used for queries since the only writable directories in RHEL Atomic Host are /etc and /var.

In this way, you can manage your RHEL Atomic Host using RHN.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s