distrobuilder icon indicating copy to clipboard operation
distrobuilder copied to clipboard

RHEL?

Open glzavert opened this issue 6 years ago • 6 comments

Can this be used to create a RHEL 7.x image that can be used on Ubuntu running the latest version of LXD?

glzavert avatar Oct 24 '19 15:10 glzavert

RHEL is a bit tricky because as I understand it, there still aren't publicly available repositories and minimal ISO images which would be needed for distrobuilder to generate RHEL images.

Someone with access to RHEL isos and repositories could probably write a source similar to the centos one and allow distrobuilder to build RHEL images.

We certainly wouldn't be allowed to generate those for the public image server, but someone could use that yaml, put in their credentials and then have it build the image for them.

stgraber avatar Oct 24 '19 16:10 stgraber

I do have license and access to the iso's and a satellite repository for updates and need to create a RHEL 7.3+ image for installation of specific software that is limited to RHEL installs only. All this is for internal use and not subject to public consumption but having a base RHEL image that I can maintain for internal use is a necessity. Any guidance on creating the base OS image for use in LXD would be greatly appreciated.

glzavert avatar Oct 24 '19 16:10 glzavert

I suspect you're going to want to start off https://github.com/lxc/distrobuilder/blob/master/sources/centos-http.go and introduce either a rhel-http.go or rhel-file.go source which similarly to centos will unpack the ISO and get enough of a RHEL system to bootstrap a clean one.

We'd probably want to take a look at what ISOs are available these days. With CentOS we need to jump through quite a few hoops which maybe we don't need to for RHEL if they have more reasonable minimal images.

@monstermunchkin may be able to help here. I believe development use of RHEL is easier these days so maybe we can easily get our hands on such base ISOs to look around at least.

stgraber avatar Oct 24 '19 23:10 stgraber

here's redhat coreos

NAME="Red Hat Enterprise Linux CoreOS"
VERSION="47.83.202102090044-0"
VERSION_ID="4.7"
OPENSHIFT_VERSION="4.7"
RHEL_VERSION="8.3"
PRETTY_NAME="Red Hat Enterprise Linux CoreOS 47.83.202102090044-0 (Ootpa)"
ID="rhcos"
ID_LIKE="rhel fedora"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::coreos"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform"
REDHAT_BUGZILLA_PRODUCT_VERSION="4.7"
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform"
REDHAT_SUPPORT_PRODUCT_VERSION="4.7"
OSTREE_VERSION='47.83.202102090044-0'
Red Hat Enterprise Linux CoreOS release 4.7
Red Hat Enterprise Linux CoreOS release 4.7

https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/latest/

after unpacking the baremetal zip to a .raw and mounting the .raw with qemu-nbd, partition1 is bios, partition2 is EFI, partition3 is rootfs:

p3/ostree/deploy/rhcos/deploy/646a9832dd0dc9fe174a2fc005863a9582186518a5476522a0e9bdccc0e5252a.0
 # ls                                                                                                    
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  ostree  proc  root  run  sbin  srv  sys  sysroot  tmp  usr  var

after putting the rootfs to a .tar.gz and making a fake metadata.yaml:

 # cat metadata.yaml                                                                                         
architecture: x86_64
creation_date: 1458040200
expiry_date: 0
properties:
  architecture: x86_64
  description: Red Hat Enterprise Linux CoreOS
  name: coreos-47-x86_64-baremetal
  os: rhcos
  release: "47"
  variant: default
 lxc image import metadata.yaml.tar.gz /rhcos.tar.gz --alias coreos                                              
Transferring image: 100% (450.20kB/s)
[root@coreos1 ~]# systemctl start crio
[root@coreos1 ~]# crictl pods
POD ID              CREATED             STATE               NAME                NAMESPACE           ATTEMPT             RUNTIME
[root@coreos1 ~]# crictl images
IMAGE               TAG                 IMAGE ID            SIZE
[root@coreos1 ~]# uname -a
Linux coreos1 5.4.101-1-pve #1 SMP PVE 5.4.101-1 (Fri, 26 Feb 2021 13:13:09 +0100) x86_64 x86_64 x86_64 GNU/Linux
[root@coreos1 ~]# cat /etc/*release
NAME="Red Hat Enterprise Linux CoreOS"
VERSION="47.83.202102090044-0"
VERSION_ID="4.7"
OPENSHIFT_VERSION="4.7"
RHEL_VERSION="8.3"
PRETTY_NAME="Red Hat Enterprise Linux CoreOS 47.83.202102090044-0 (Ootpa)"
ID="rhcos"
ID_LIKE="rhel fedora"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::coreos"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform"
REDHAT_BUGZILLA_PRODUCT_VERSION="4.7"
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform"
REDHAT_SUPPORT_PRODUCT_VERSION="4.7"
OSTREE_VERSION='47.83.202102090044-0'
Red Hat Enterprise Linux CoreOS release 4.7

gattytto avatar Mar 30 '21 18:03 gattytto

rpm-ostree is used instead of yum so this may be needed

[root@coreos1 ~]# rpm-ostree status
error: This system was not booted via libostree; cannot operate

gattytto avatar Mar 31 '21 19:03 gattytto

It looks like the Oracle 7 image is RHEL 7.9 and the Oracle 8 image is RHEL 8.4.

Pascal666 avatar Jun 22 '21 19:06 Pascal666

Closing this due to inactivity. Feel free to send a PR which allows creating RHEL images. In the meantime you can use the derivatives we support (Alma, Oracle, Rocky, etc.)

monstermunchkin avatar Jun 13 '23 12:06 monstermunchkin