Want to start hating SUSE?
Try to automate SLES 16 installation!
Last week, I started testing the brand new SUSE Linux Enterprise Server 16. I might be disappointed by what SUSE does, but it is pretty standard for them. Last years they dropped their features and exchanged them with the features from Red Hat Enterprise Linux.
But this time! They have a new feature again! Wow! I am impressed and want to test the new brilliant installer from SUSE.
The manual installation worked pretty well last time. Of course, the web-based installation is not 100% production-ready, but it works. What do you want more?
OK, this is my wish list:
automated installation
multipath
some post-install scripts
Not the biggest list, isn’t it?
In my test environment, it is even shorter because I don’t have multipath.
SUSE is great! Together with SLES 16, they published a new set of documentation. One of the books (or articles?) is called “Automation Installation Using Agama”.
What can be easier? Take the book, take the examples from it, and do it!
IBM: Rescue Ranger
I know, many IBM-ers read the newsletter.
I was so surprised to find the article about SLES 16 automated installation on community.ibm.com.
My only thought was - wow! They did exactly what I wanted to do. IBM is the best again. I don’t have to do anything. I will take their profile, test it in my environment, and write to everyone - see, the community site of IBM really rocks!
JSON problems
The old AutoYast profile was XML. It was a long-lasting nightmare, but with many features.
The new Agama profile is JSON.
Have you ever worked with JSON?
It is nice.
As a system administrator, you must know exactly one thing about JSON - it does not support comments. Save all your comments in a README file.
No, I don’t need too many comments in my autoinstallation profile. That’s why I am OK with JSON.
But if you use JSON, you must write everything (or almost everything) in quotes.
This is a wrong JSON:
Do you know where it comes from?
Yes, from the above-mentioned IBM article. The entire profile published in the article is wrong. Or better to say, not JSON-compliant.
IBM, can you have quality control on the articles you publish?
Even if you correct the JSON file to be a real JSON file, you can’t install SUSE using the profile published in the article. There are some other mistakes in it.
I think the author of the article has never tested it with a real SLES 16 installation.
Do you think SUSE has quality control?
If you think so, there is an excerpt from the SUSE documentation:
The same mistake.
It seems that SUSE at least corrects its documentation. While writing this article, I found that some incorrect documentation was corrected during the week. But not everything.
As an example of the wrong documentation on the SUSE site:
This is the real output from SLES 16:
The correct command is:
Do you know how to find the correct documentation? It is to stop looking at SUSE documentation and start looking at the open-source Agama project documentation.
But please bear in mind that, at the time of writing, the latest Agama version is 19. The Agama version in SLES 16 is 17. You know, they implemented some new features that don’t work with SLES 16.
The best way to write an autoinstallation profile for SLES 16 is to forget the documentation.
Install SLES 16 somewhere - yes, manually!
Install the package
agama-cli.Change to the directory
/usr/share/agama-cli.Read the JSON files that you find there.
Yes, I know, it is hard to read JSON schema files. If you don’t have experience with it, it is tough. No, this is the only way to write the correct profile, and I will show you some other mistakes in the documentation below.
What you need to check Agama profiles
This is the part that is completely missed in the SUSE documentation.
To start the command agama config validate, you must first install two packages:
zypper in agama agama-cliThen you must start agama-web-server:
systemctl enable --now agama-web-server.serviceDon’t ask me, who was the most talented guy, who decided that we need a web server to check a profile.
Let’s start with the profile
You are a lucky guy if you read the article. You get the full working Agama profile to install SLES 16 on IBM Power.
The first thing to decide is what you want to install. We can install SUSE Linux Enterprise Server or SUSE Linux Enterprise Server for SAP.
If you look at the SUSE documentation, it should look like:
Can you imagine that it is wrong? It doesn’t work.
The correct ID must be either SLES or SLES_SAP. But you will learn it after your installation fails.
The correct “product” section looks like:
"product": {
"id": "SLES",
"registrationCode": "No, I will not let you know my registration code",
"registraionEmail": "somewhere@power-devops.com",
"addons": [
{
"id": "PackageHub"
}
]
}If you don’t want to attach PackageHub, you can remove the “addons” sections.
But if you want, SUSE has one more surprise for you. Of course, it is the wrong documentation.
It is almost correct. This is the correct version:
At least the numbers are correct. You can copy/paste them from the SUSE documentation.
Network configuration
It is the part where the documentation looks correct right now. But I remember it had the same JSON issues several days ago.
The only problem is to find the network interface name.
In my case, the virtual Ethernet adapter is in slot 3, that is why the interface is called env3.
Anyway, Agama didn’t use the transient hostname during the installation and registered the system as “localhost.localdomain”:
Users
In the test lab, I don’t want to create any users. I set a password for the root user, and that’s it.
Of course, the root user should get an SSH key.
Want to specify multiple SSH keys?
Wrong, you don’t want it. Because it is not supported.
Use the post-install script.
Localization
This is the part, where I didn’t have any problems.
As you know, I like English localization and use a German keyboard.
Software selection
This is also a quite easy topic, if you know what you want to install.
If you want to find a list of available patterns, install SLES 16 manually and issue:
zypper se -t patternI don’t write about how to find available packages because everyone who has used SUSE for a day or two knows how.
Storage
Now I have come to the most interesting topic.
I like to use LVM. I must create several partitions on my boot disk and a volume group.
SUSE documentation didn’t show any LVM configuration on the first sight.
Should I tell that the sample doesn’t work at all? It doesn’t even pass the validation.
IBM’s sample is better if you correct the JSON’s syntax problems:
But it is not LVM.
If you search in the SUSE documentation further, you will find the following sample:
It doesn’t pass the Agama validation either.
There is no type disk, or device, or wipe attributes in the JSON schema.
You must first define the drive where you want to install SLES. It is done in the object “drives”:
As you see, I defined two partitions:
prep, which is a standard IBM Power partition that must be on a bootable volume and corresponds to the AIX hd5.
LVM partition that takes all free space.
You can specify partition sizes as a hard-coded value (see the example of the prep partition) or as minimum and maximum values (see the example of the LVM partition). You can’t specify “use all free space” like you can with “grow” in the official documentation. That’s why I used 2 TiB as the maximum value.
Before going to the LVM configuration, we should also specify that the disk is bootable:
Now it is time for LVM. If you compare my working profile with the documentation (see above), you will see that the documentation is complete bullshit.
I don’t know where to start and where to finish describing mistakes in the SUSE documentation. It is wrong.
Take my profile, adapt it to your needs, and use it.
The SUSE documentation is not trustworthy in this case, and it took me many hours to find the correct way to describe my LVM configuration. Even if I can read JSON schema files.
One more important section
The section is listed in the documentation:
I understand it like the bootloader configuration after the system is installed.
I don’t know, maybe my English knowledge is limited. But if you set stopOnBootMenu to true, your system may not start at all. This is what IBM’s article says:
This is a good reason to keep the section simple:
Is there anything good in Agama?
Yes, I found the two sections are good - files and scripts.
The “files” section lets you specify which files you want on the target system. I think I miss a similar section in Red Hat’s Kickstart. Definitely, you can do it with post-install scripts, but the section looks better or better integrated. I don’t know how to express it.
In the scripts section, you can specify your pre, post, and init scripts.
One more time, if you read the documentation, it looks very pretty:
In the real life, if you use the syntax, you will get:
Unfortunately, you must write the whole script in one line, like:
Then it works:
Support the Power DevOps Newsletter!
If you like reading technical articles about IBM Power, AIX, and Linux on IBM Power, consider upgrading to the paid tier to show your support. As a paid subscriber, you not only get regular posts, but you will get additional posts with the full code and further explanations, access to the whole archive of the blog, and take part in our monthly calls where you can ask your questions and propose topics for future newsletters. Be an active member of our community!
Time to install!
Prepare your PXE or BOOTP servers, write the GRUB configuration file and start the installation.
This is my grub.cfg I tested the installation with:
You can notice some changes here if you compare it to the SLES 15 installation. But I think I will write about it next time.
After you start the system, you get … nothing:
It has started, but it seems to be doing nothing. If you log in to the system and run journalctl, you might see the installation in progress.
If you don’t see it, it means you have an error in your profile file, and you must search through journalctl logs to find the error. It can be challenging.
But we love challenges! Otherwise, we wouldn’t install SLES 16!
Have fun automating SLES 16 installation!
Andrey
Hi, I am Andrey Klyachkin, IBM Champion and IBM AIX Community Advocate. This means I don’t work for IBM. Over the last twenty years, I have worked with many different IBM Power customers all over the world, both on-premise and in the cloud. I specialize in automating IBM Power infrastructures, making them even more robust and agile. I co-authored several IBM Redbooks and IBM Power certifications. I am an active Red Hat Certified Engineer and Instructor.
Follow me on LinkedIn, Twitter and YouTube.
You can meet me at events like IBM TechXchange, the Common Europe Congress, and GSE Germany’s IBM Power Working Group sessions.


































