5. Import AlmaLinux distribution and create a default profile

Systems managed by cobbler use profiles to be configured for installation. Profiles allow you to configure groups of systems in a common way. E.g. you can have a profile for compute nodes, a profile for login nodes, etc. Cobbler even allows profiles to be related to each other. A profile can inherit settings from a parent profile.

A typical usage is to have a generic AlmaLinux profile and then customized ones for each hardware configuration or use case.

Profiles use a distribution as installation source. To create a system managed by cobbler, we therefore first have to create both a distribution and profile that uses it.

We do this by importing the AlmaLinux Distribution from our ISO file. This will create a distribution and profile within cobbler.

  1. Mount ISO

    Mount the ISO as loopback device into a folder, e.g. /mnt/iso.

    # mount ISO image
    [root@master ~]# mkdir -p /mnt/iso
    [root@master ~]# mount AlmaLinux-8.10-x86_64-dvd.iso /mnt/iso
    
  2. Import AlmaLinux distribution into cobbler

    Run the following command to import a distribution from /mnt/iso into cobbler. It will copy all necessary files for booting and all other files needed for installation. (this can take some time). You essentially did the same during exercise 2 manually.

    [root@master ~]# cobbler import --name=almalinux8 --arch=x86_64 --path=/mnt/iso
    task started: 2025-05-27_051459_import
    task started (id=Media import, time=Tue May 27 05:14:59 2025)
    running python triggers from /var/lib/cobbler/triggers/task/import/pre/*
    running shell triggers from /var/lib/cobbler/triggers/task/import/pre/*
    shell triggers finished successfully
    Found a candidate signature: breed=redhat, version=rhel8
    Found a matching signature: breed=redhat, version=rhel8
    Adding distros from path /var/www/cobbler/distro_mirror/almalinux8-x86_64:
    creating new distro: almalinux8-x86_64
    trying symlink: /var/www/cobbler/distro_mirror/almalinux8-x86_64 -> /var/www/cobbler/links/almalinux8-x86_64
    creating new profile: almalinux8-x86_64
    associating repos
    checking for rsync repo(s)
    checking for rhn repo(s)
    checking for yum repo(s)
    starting descent into /var/www/cobbler/distro_mirror/almalinux8-x86_64 for almalinux8-x86_64
    processing repo at : /var/www/cobbler/distro_mirror/almalinux8-x86_64/AppStream
    need to process repo/comps: /var/www/cobbler/distro_mirror/almalinux8-x86_64/AppStream
    looking for /var/www/cobbler/distro_mirror/almalinux8-x86_64/AppStream/repodata/*comps*.xml
    Keeping repodata as-is :/var/www/cobbler/distro_mirror/almalinux8-x86_64/AppStream/repodata
    processing repo at : /var/www/cobbler/distro_mirror/almalinux8-x86_64/BaseOS
    need to process repo/comps: /var/www/cobbler/distro_mirror/almalinux8-x86_64/BaseOS
    looking for /var/www/cobbler/distro_mirror/almalinux8-x86_64/BaseOS/repodata/*comps*.xml
    Keeping repodata as-is :/var/www/cobbler/distro_mirror/almalinux8-x86_64/BaseOS/repodata
    *** TASK COMPLETE ***
    

    After completion your imported distribution will be listed when you run cobbler distro list.

    [root@master ~]# cobbler distro list
       almalinux8-x86_64
    

    You can see all available cobbler distro commands by just entering

    [root@master ~]# cobbler distro
    usage
    =====
    cobbler distro add
    cobbler distro copy
    cobbler distro edit
    cobbler distro find
    cobbler distro list
    cobbler distro remove
    cobbler distro rename
    cobbler distro report
    

    Inspect your imported distribution with the cobbler distro report command:

    [root@master ~]# cobbler distro report
    Name                           : almalinux8-x86_64
    Architecture                   : x86_64
    Automatic Installation Template Metadata : {'tree': 'http://@@http_server@@/cblr/links/almalinux8-x86_64'}
    TFTP Boot Files                : {}
    Boot loader                    : grub
    Breed                          : redhat
    Comment                        :
    Fetchable Files                : {}
    Initrd                         : /var/www/cobbler/distro_mirror/almalinux8-x86_64/images/pxeboot/initrd.img
    Kernel                         : /var/www/cobbler/distro_mirror/almalinux8-x86_64/images/pxeboot/vmlinuz
    Kernel Options                 : {}
    Kernel Options (Post Install)  : {}
    Management Classes             : []
    OS Version                     : rhel8
    Owners                         : ['admin']
    Redhat Management Key          :
    Remote Boot Initrd             : ~
    Remote Boot Kernel             : ~
    Template Files                 : {}
    

    Here, cobbler detected a RHEL8 distribution.

    During the import, cobbler also created a almalinux8-x86_64 profile for you, which uses the almalinux8-x86_64 distribution.

    [root@master ~]# cobbler profile list
       almalinux8-x86_64
    

    Similar to cobbler distro, all available sub-commands of cobbler profile can be seen by simply executing it:

    [root@master ~]# cobbler profile
    usage
    =====
    cobbler profile add
    cobbler profile copy
    cobbler profile dumpvars
    cobbler profile edit
    cobbler profile find
    cobbler profile getks
    cobbler profile list
    cobbler profile remove
    cobbler profile rename
    cobbler profile report
    

    Looking at a particular profile in detail is done using the cobbler profile report command:

    [root@master ~]# cobbler profile report --name=almalinux8-x86_64
    Name                           : almalinux8-x86_64
    Automatic Installation Template : sample.ks
    Automatic Installation Metadata : {}
    TFTP Boot Files                : {}
    Comment                        :
    DHCP Tag                       : default
    Distribution                   : almalinux8-x86_64
    Enable gPXE?                   : False
    Enable PXE Menu?               : True
    Fetchable Files                : {}
    DHCP Filename Override         : <<inherit>>
    Kernel Options                 : {}
    Kernel Options (Post Install)  : {}
    Management Classes             : []
    Management Parameters          : <<inherit>>
    Name Servers                   : []
    Name Servers Search Path       : []
    Next Server Override           : <<inherit>>
    Owners                         : ['admin']
    Parent Profile                 :
    Proxy                          :
    Red Hat Management Key         : <<inherit>>
    Repos                          : []
    Server Override                : <<inherit>>
    Template Files                 : {}
    Virt Auto Boot                 : True
    Virt Bridge                    : xenbr0
    Virt CPUs                      : 1
    Virt Disk Driver Type          : raw
    Virt File Size(GB)             : 5
    Virt Path                      :
    Virt RAM (MB)                  : 512
    Virt Type                      : kvm
    
  3. Unmount ISO

    Finally unmount the ISO image.

    umount /mnt/iso