Linux on Power

Enterprise Linux on Power

Enterprise Linux on Power delivers the foundation for your open source hybrid cloud infrastructure with industry-leading cloud-native deployment options.


#Power
#TechXchangeConferenceLab
#Power
 View Only

Automating SLES 16 Installation with Jsonnet and Agama

By PRIYA A posted 3 days ago

  

SUSE Linux Enterprise Server 16 (SLES 16) introduces several innovations in how systems are installed and managed. One major shift is the emergence of Agama, SUSE’s next-generation, web-based, and API-driven installer. Alongside traditional AutoYaST, Agama brings support for modern, programmable templating formats, such as Jsonnet, which enable powerful and flexible automation of installation processes.

The following table highlights the key differences between AutoYaST and Agama at a high level:

Feature AutoYaST Agama
Purpose Traditional automated installation tool for SUSE Next-generation installer, designed for cloud, automation, and modular workflows
Language/Format used XML-based configuration files YAML or JSON configuration (through API)
Extensible? Rigid and not easily pluggable Highly modular, built with extensibility
API-driven No (file-based only) Yes – provides REST API for control and orchestration
Maintenance Mature, stable Under active development and will replace parts of AutoYaST in future

Unlike XML-based AutoYaST, Jsonnet allows for:

  • Reusable code blocks
  • Conditional logic and loops
  • Environment-specific profiles (such as staging versus production)
  • Lightweight and readable configuration syntax

In this blog, we’ll walk through a complete automated installation setup using Jsonnet with SLES 16, breaking down the configuration section by section and showing you how to:

  1. Prepare a system for unattended installation.
  2. Use kernel boot parameters to trigger automation.
  3. Build a Jsonnet file for installation.

1. Prepare a system for unattended installation

You need to make sure that the following resources are in place:

  • Access to the SUSE ISO file from an internal repository or from the official SUSE download site: https://www.suse.com/download/sles
  • A system management console (for example, Hardware Management Console (HMC) for IBM PowerPC).
  • Static IP or DHCP configuration.
  • Optionally, PXE boot support for network installation.

Also, assuming the system has adequate resources: 40 GB RAM, 15 vCPUs, and network support via VLAN or a direct adapter.

2. Use kernel boot parameters to trigger automation

Unattended installations usually follow this sequence:

2.1 Download the netboot image

Download or sync the PXE-compatible netboot image from a server hosting the SUSE installation ISO.

2.2 Create a Jsonnet profile

Create a .jsonnet file that defines how the system should be configured. A .jsonnet file provides advantages, such as reusable blocks, parameterization, and better readability over static JSON/YAML files.

2.3 Configure GRUB

Modify the kernel parameters during boot using a command similar to the following:


Component Meaning
linux linux.sles16-GA Load the Linux kernel file
initrd initrd.sles16-GA Load the initrd image
agama.install_url= Points to installation repo
root=live: Mandatory - specify squashfs.img
live.password= Password for installer environment
inst.auto= Provide JSON/JSONNET installer profile
insmod tftp Enable TFTP in GRUB
insmod progress Show progress loading kernel

This instructs the installer to fetch the automation configuration file from your profile host.

3. Build a Jsonnet file for installation

3.1 Bootloader configuration

This prevents halting at GRUB menu, ensuring a direct boot.

3.2 User and root setup

For security reasons, always use hashed credentials. Generate a hashed password:

openssl passwd -6 'Sles16_StaysStronger123'

Example output:

$6$yDdMw4vcnz$NMPQkSCKD9UdSMAYk0U1/7CE69Tr5Ab5FMoJNmeytU8D5xxY9aYlE0E5kFecAGVknbiYI7eGk2Dhr7nkwE6Zc0

Use this hashed password in the Jsonnet section for user creation.

3.3 Software Patterns Setup

Specify required patterns such as base and kvm-server. An empty list installs minimal packages.

3.4 Product identifier

This ensures that the SUSE base product is selected.

3.5 Storage Configuration

3.5.1 Standard Partition

This storage definition targets a multipath device via its /dev/disk/by-id/dm-uuid-mpath-3600507681081839f1800000000000e251 identifier. All existing partitions are wiped, and Agama creates a new table with:

  • Root filesystem (/) – 10 GiB minimum
  • Swap – between 1 GiB and 4 GiB

3.5.2 LVM Layout

Before going to the LVM configuration, we should also specify that the disk is bootable:

LVM defines two partitions:

  • PReP partition – This first partition PReP (PowerPC Reference Platform) boot partition is required by the Power firmware and functions similarly to the AIX hd5 boot logical volume. It stores the GRUB2 bootloader and is the location from which the system firmware loads the initial boot code.
  • LVM PV – This second partition physical volume that consumes all remaining free space on the disk. This LVM PV becomes the foundation for the volume group (VG) and the logical volumes (LVs) used for filesystems such as root (/), swap, and any additional mount points. This design ensures a minimal, required Power boot partition, while providing flexible storage management through LVM for the rest of the system.

3.6 Network configuration

This network block defines a static IPv4 configuration for the interface labeled “Wired Connection” It disables IPv6, assigns a fixed IPv4 address with CIDR notation, sets the default gateway, and specifies the DNS resolver list. The parameters status: "up" and autoconnect: true ensure that the interface is brought online automatically during installation, while ignoreAutoDns: false instructs Agama to use the provided DNS servers instead of ignoring them.

3.7 Localization settings

Sets language, keyboard, and timezone preferences.

3.8 Pre-installation script

Example: Start multipathd daemon.

3.9 SSH enablement for root user

Create the file like /etc/ssh/sshd_config.d/permit-root-login with only one line - PermitRootLogin yes.

A sample Jsonnet file using standard partitioning on the boot disk

{
  "bootloader": {
    "stopOnBootMenu": false
  },
  "user": {
    "fullName": "abc",
    "userName": "abc",
    "password": "abc123",
    "hashedPassword": false,
    "autologin": false
  },
  "root": {
    "hashedPassword": false,
    "password": "Hello_Sles16Blog"
  },
  "software": {
    "patterns": []
  },
  "product": {
    "id": "SLES"
  },
  "storage": {
    "drives": [
      {
        "search": "/dev/disk/by-id/dm-uuid-mpath-3600507681081839f180000000000e251",
        "partitions": [
          {
            "search": "*",
            "delete": true
          },
          {
            "filesystem": {
              "path": "/"
            },
            "size": {
              "min": "10 GiB"
            }
          },
          {
            "filesystem": {
              "path": "swap"
            },
            "size": {
              "min": "1 GiB",
              "max": "4 GiB"
            }
          }
        ]
      }
    ]
  },
  "network": {
    "connections": [
      {
        "id": "Wired Connection",
        "method4": "manual",
        "gateway4": "xx.xx.xx.xx",
        "method6": "disabled",
        "addresses": [
          "xx.xx.xx.xx/xx"
        ],
        "ignoreAutoDns": false,
        "status": "up",
        "autoconnect": true
      }
    ]
  },
  "localization": {
    "language": "en_US.UTF-8",
    "keyboard": "us",
    "timezone": "Europe/Berlin"
  },
  "files": [
    {
      "destination": "/etc/ssh/sshd_config.d/50-permit-root",
      "content": "PermitRootLogin yes",
      "permissions": "0644",
      "user": "root",
      "group": "root"
    }
  ],
  "scripts": {
    "pre": [
      {
        "name": "activate-multipath",
        "content": "#!/usr/bin/bash\nsystemctl start multipathd.socket multipathd.service\n"
      }
    ]
  }
}

Tips to troubleshoot common pitfalls

  • Installer hangs at boot menu? Ensure stopOnBootMenu = false.
  • Networking not coming up? Verify IP/netmask and VLAN support.
  • SSH login not working? Recheck SSH configuration path.
  • Partitioning fails? Validate the by-id disk path or multipath config.

Conclusion

Agama with Jsonnet offers a modern, programmable, and cloud-friendly path for automated SLES 16 installations—ideal for scalable and repeatable deployments. Jsonnet enables logic, reuse, and cleaner profiles compared to static XML templates.

By breaking free from rigid static templates, admins can generate, maintain, and evolve installation profiles using the .jsonnet file’s logic and reuse capabilities.

I am grateful to Andrey Klyachkin for his thorough review and insightful suggestions, which greatly improved this workflow.

0 comments
5 views

Permalink