Switching between EUS & non-EUS Azure RHEL VM Repositories

Arunendra Chauhan
Globant
Published in
7 min readDec 3, 2020

About the Article

In this article you will learn about Azure RHEL VM — updating behaviour, associated repositories and switching repositories (EUS & non-EUS).

Following this article you will learn to:

  • Identify the associated repository to the RHEL VM images
  • Fix the RHEL VM image version issue by lock-unlock feature and update the server
  • Switch between repositories as and when required

While working with Linux servers, one needs to update the server several times using the sudo yum update command. Whether you need to install any new software package or update an existing one, it is always recommended to update the server pre-installation or post-installation. The below are the two scenarios related to update process on RHEL:

  • Using the yum update command to update the server, it also updates the RHEL Image version which the end user does not want to.
  • While installing / updating any software package / application, it halts with following message:

This Server is not connected to the Red Hat Subscription manager or satellite server

This article mainly tends to give a glimpse to understand the above issues and solutions to fix it.

This will cover the following topics:

  • Brief introduction on Azure Red Hat Update Infrastructure (RHUI)
  • Think Before selecting RHEL image type
  • RHEL Image update behavior
  • Repository types and identification
    — Non-EUS repos
    — EUS repos
  • RHEL EUS — RHEL VM Version Lock
  • Why do we need version lock & unlock?
  • Switching
    — Switch a RHEL VM to EUS repos
    — Switch a RHEL VM back to non-EUS repos

Brief introduction on Azure RHUI

Red Hat Update Infrastructure (RHUI) is pre-configured with Pay As You Go (PAYG) images in Azure cloud. It means, using Azure PAYG images does not require any additional configuration to get latest updates from RHUI repositories.

For other custom and golden images (known as BYOS — Bring Your Own Subscription) it needs to be connected to Red Hat Subscription Manager (RHSM) or satellite server to receive updates.

RHEL PAYG VMs created in Azure are supported by RHUI to mirror Red-Hat hosted repository content, to create custom repositories having Azure-specific content.

If you provision RHEL PAYG image in Azure cloud, it comes preconfigured to access azure RHUI. Also it does not require any additional configuration. Once your RHEL VM instance is provisioned, simply run sudo yum update command to get the latest updates. The charges for using this service are included in RHEL PAYG software fees.

Azure provides a vast range of RHEL PAYG VM series on the basis of capabilities, storage, performance and workloads. The pricing and availability of VMs can vary depending on the selected region and OS/Software.

Refer below link for pricing details:

https://azure.microsoft.com/en-us/pricing/details/virtual-machines/red-hat/

Think before selecting RHEL image type

RHEL PAYG VMs provisioned in Azure are preconfigured to access RHUI. Though, it does not restrict you from registering this VM with Subscription Manager (RHSM) or Satellite or any other sources. But, if you do register PAYG VM with another source of update, it will result in double billing indirectly.

Let’s understand this with below details:

Charges to access Azure-hosted RHUI is inclusive in the RHEL PAYG image price. Registering the same VM with another source of updates might incur you double billing. Firstly, you will be charged for Azure RHEL software fee and, second time for Red Hat subscription.

If you unregister RHEL PAYG VM from Azure hosted RHUI, it will not convert your VM into BYOL (Bring your Own License) type VM. Instead you need to provision another VM of BYOL type.

If your requirement is to consistently use other sources to get updates, provision VM with RHEL BYOS image.

RHEL Image update behavior

When you run sudo yum update to get the latest RHEL image update, its behavior varies based on the RHEL image from which you provisioned. This is because different images are coped with different repositories.

Azure offers two types of RHEL images and those are associated with either:

  • Extended Update Support (EUS)
  • Regular non-EUS repositories

In Azure, available RHEL images can be listed using below Azure CLI command:

az vm image list –publisher redhat -all

Output:

Alternatively, using PowerShell cmdlets-

# e.g. Below cmdlets let you get the info on RedHat offerings for the given RHEL sku available in the given region$locName=”West US”#To get the list of publishers, use-#Get-AzVMImagePublisher -Location $locName | Select PublisherName$pubName=”RedHat”#To get the list of available Offers for RedHat, use-#Get-AzVMImageOffer -Location $locName -PublisherName $pubName | Select Offer$offerName=”RHEL”#To get the list of available SKUs, use-#Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | Select Skus$skuName=”7.8"Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Sku $skuName

Output:

Repository types and identification

It is important to identify the repository type while selecting the RHEL image to provision as per the requirement for the update infrastructure.

RHEL image full name (URN) is a combination of four sections (Publisher:Offer:SKU:Version), which describes all the details about the image.

For example:

RedHat:RHEL:7-LVM:7.6.2019062414

This URN refers to a RHEL 7.6 LVM-partitioned image built on June 24,2019.

RedHat:RHEL:7.6:7.6.2019062116

Image published on June 21,2019 and connected to EUS

Let’s understand EUS and non-EUS connected RHEL images in detail.

Non-EUS Repositories

If you run a sudo yum update on RHEL VM provisioned from RHEL Image that is connected to non-EUS repositories, it will update the VM to the latest RHEL minor version.

To understand this, let’s take an example.

If you provision a RHEL VM 7.5 PAYG image on Azure and run a sudo yum update, this will upgrade to RHEL 7.7 VM along with updating other packages. RHEL 7.7 is the latest minor version in the RHEL7 family.

Below images are example of RHEL images connected to non-EUS:

In the below images’ SKU (3rd element, see bold-italic) does not contain a minor version. Image version (4th element of the URN) indicates the minor version.

RedHat:RHEL:7-LVM:7.4.2018010506RedHat:RHEL:7-RAW:7.4.2018010506

EUS Repositories

If you run a sudo yum update on RHEL VM which is connected to EUS repositories, it will not be upgraded to the latest RHEL minor version. It’s because the RHEL images connected to EUS repositories are version locked.

Example of RHEL images connected to EUS repositories:

RedHat:RHEL:7.4:7.4.2019062107RedHat:RHEL:7.5:7.5.2019062018RedHat:RHEL:7.6:7.6.2019062116

In the above images’ SKU (3rd element) contains a minor version.

RHEL EUS — RHEL VM version-Lock

Whenever you provision a RHEL VM on Azure, customers might ask to lock this VM to any specific RHEL minor version. It means customers do not want it to be upgraded on running sudo yum update command on the provisioned RHEL VM.

EUS repositories provide a service to lock the RHEL VM to a certain RHEL minor version after provision. It can also be reversed by this version-locking operation.

EUS support has ended for RHEL <= 7.5 from April 30,2020.

EUS will support RHEL 7.6 till May 31,2021

EUS will support RHEL 7.7 till Aug 30,2021

Why do we need version-lock-unlock?

If you have provisioned a RHEL VM connected to EUS repositories and you want to install a package which is available from RHEL extras, you won’t be able to do so. Because EUS does not support the RHEL extras channel.

To achieve this, you would need to switch this VM to non-EUS.

Switching

Switch a RHEL VM to EUS (Apply version-lock)

Please follow the below steps to lock your RHEL VM to current minor release or to a particular minor release version. All commands should be executed as root.

Disabling non-EUS repos:

yum –disablerepo=’*’ remove ‘rhui-azure-rhel7’

Adding EUS repos:

yum –config=’https://rhelimage.blob.core.windows.net/repositories/rhui-microsoft-azure-rhel7-eus.config’ install ‘rhui-azure-rhel7-eus’

Locking the releasever variable to current minor version

echo $(. /etc/os-release && echo $VERSION_ID) > /etc/yum/vars/releasever

Updating RHEL VM

sudo yum update

These steps will lock the RHEL minor version to the current minor version. Means post these steps running sudo yum update will not upgrade to RHEL latest minor version.

If you want to upgrade and lock your RHEL VM to a specific minor release version.

For example, Your RHEL VM current minor version is 7.2 and you want to upgrade it to 7.5 and lock.

Execute:

echo 7.5 > /etc/yum/vars/releasever

And run:

sudo yum update

This will first upgrade the current minor version to 7.5 and lock the version from further upgrade.

Switch a RHEL VM back to non-EUS (Remove version-lock)

If you need to connect your RHEL VM to non-EUS repositories for some operations to perform. For example, if you want to install a package from Red Hat extras.

First you would need to remove version-lock on RHEL VM.

Follow the below steps (run as root):

Remove the releasever file to remove version-lock:

rm /etc/yum/vars/releasever

Disabling EUS repos:

yum –disablerepo=’*’ remove ‘rhui-azure-rhel7-eus’

Adding non-EUS repos (configure RHEL VM):

yum –config=’https://rhelimage.blob.core.windows.net/repositories/rhui-microsoft-azure-rhel7.config’ install ‘rhui-azure-rhel7’

Updating RHEL VM:

sudo yum update

You can switch between EUS & non-EUS as and when required by following the above steps.

Conclusion

This article was meant to persuade you about RHEL image updating behavior, and to show you the right way to identify and choose the right RHEL image associated with the right repositories. It also included the right way to switch between repositories.

I hope this article will help you.

Thanks for reading. Cheers 😊

--

--