launch and suscribe RHEL 8/9 instances in AWS

15 Oct 2023

Simple, no RedHat Cloud integration

Go to EC2 and launch either RHEL8 or RHEL9 instances:

RHEL8: AWS Marketplace: Red Hat Enterprise Linux 8

Ami Id: ami-0b324207d4bcaec61

RHEL9: AWS Marketplace: Red Hat Enterprise Linux 9

Ami Id: ami-026ebd4cfe2c043b2

Ensure the AWS instance includes a RHEL suscription

$ curl http://169.254.169.254/latest/dynamic/instance-identity/document 2>/dev/null | grep billingProducts
"billingProducts" : [ "bp-6fa54006" ] #ID will change depending the RHEL version and must be != NULL

If the above command success, execute:

$ sudo vi  /etc/yum/pluginconf.d/subscription-manager.conf
enabled=0

Enable additional repositories

RHEL8

$ sudo yum repolist all
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms rhel-8-supplementary-rhui-rpms 

RHEL9

$ sudo yum repolist all
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-rhui-rpms rhel-9-supplementary-rhui-rpms

Profit!

With Redhat Cloud and Insights integration

RedHat

AWS

Go to EC2 and launch either RHEL8 or RHEL9 instances:

RHEL8: AWS Marketplace: Red Hat Enterprise Linux 8

Ami Id: ami-0b324207d4bcaec61

RHEL9: AWS Marketplace: Red Hat Enterprise Linux 9

Ami Id: ami-026ebd4cfe2c043b2

Once setup, login and suscribe using the RedHat Credentials

$ sudo subscription-manager register --username <username>
$ sudo insights-client

Enable additional repositories

RHEL8

$ sudo yum repolist all
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms rhel-8-supplementary-rhui-rpms 

RHEL9

$ sudo yum repolist all
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-rhui-rpms rhel-9-supplementary-rhui-rpms

Profit!

References