How to do an unattended upgrade from SLES11 to SLES15
SLES 11 is still heavily in use today. Until now, there wasn’t an easy upgrade path for getting your servers to the latest and greatest without completely reinstalling them. But with the release of SLE15, it’s now of the one of the supported upgrade paths.
Check out the complete upgrade guide here.
I recently had a request from a customer to mass-upgrade (a lot) of virtual machines running SLES 11 SP4 to SLES 15. But since the supported upgrade path in this case must be done offline, that would mean a lot of manual labor interacting with the installer. AutoYaST to the rescue!
We already have this guide that deals specifically with automatic upgrades using AutoYaST. But things are a bit… different with SLE15. The repositories now follow a highly modular layout. That means that you no longer can rely on upgrading with just the main DVD media anymore.
SLE 15 has a base “Installer” media, that’s used to install all SUSE products. Even SLES, SLED, or SLES for SAP are now “modules” that can be added during the installation process. In fact, they are regular add-on products, and we can deal with that in AutoYaST.
So, in order to create an upgrade media, we will need to follow these steps.
First, we copy the contents of the Installer media ISO to a temporary directory:
# mount -o loop SLE-15-Installer-x86_64.iso /mnt
# cd tmp
# mkdir iso
# cp -dpRv /mnt .
# umount /mnt
Then, we need to copy the contents of the Packages media ISO to a sub-directory “packages” inside the temporary directory we created earlier:
# mount -o loop SLE-15-Packages-x86_64-GM-DVD1.iso /mnt
# cd tmp/iso
# mkdir packages
# cd packages
# cp -dpRv /mnt .
# umount /mnt
Then, we need a proper AutoYaST profile. This one was built specifically for SLES:
unattended-upgrade-sle15
Note that all URLs inside the AutoYaST profile use the “relurl://” scheme, so it should work from anywhere, including HTTP.
The autoinst.xml file must go to the root directory of the ISO.
I also altered isolinux.cfg, which is the configuration file for the startup menu on the ISO, so it automatically starts the upgrade process without manual interaction. This file goes into the boot/x86_64/loader directory.
Finally, we can create the upgrade ISO:
# cd ~/tmp/iso
# cp ~/autoinst.xml .
# cp ~/isolinux.cfg boot/x86_64/loader/
(optional for EFI support)
# mkdir -p /tmp/efi
# mount -o loop boot/x86_64/efi /tmp/efi
# cp ~/grub.cfg /tmp/efi/EFI/BOOT/
# umount /tmp/efi
# cd ..
# mkisofs -o sle15upgrade.iso -udf -f -r -gui -graft-points -b boot/x86_64/loader/isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -eltorito-platform 0xEF -eltorito-boot boot/x86_64/efi -no-emul-boot -V SLE15UPGRADE iso
Note that our mkisofs line has TWO boot entries. One points to the regular ISOLINUX binary, but the second one points to the “efi” image on the media. This is necessary in order to properly boot our media on UEFI-compliant machines.
IMPORTANT: the EFI support requires a newer mkisofs than the one available under SLE12! The “-eltorito-platform” parameter is responsible for defining the ID for a “partition” inside the ISO to be recognized as a valid EFI partition. Please use openSUSE Leap 15, SLE15 or other distribution with an updated mkisofs utility.
The resulting ISO may be a bit big (7.9GB), but it should cover 99% of the cases.
Related Articles
Jun 28th, 2023
SUSECON 2023 – It’s all about choice
Dec 12th, 2023
Comments
Did you also customize the EFI boot with the isolinux.cfg or how does the automatic start of the upgrade work on EFI systems?
Good catch. Even though I’m creating the ISO with the EFI boot as well, I did not change the grub.cfg with the correct parameters. I’ll change it and amend the article.
Thanks!
Replying to myself: added the grub.cfg file for the autoupgrade. If you have problems, contact me.
two problems:
– there is no boot/loader/x86_64/ in /tmp/iso only boot/x86_64/loader
– mkisofs (genisoimage) from cdrkit-cdrtools-compat version 1.1.11-24.15 in SLES12SP3 doesn’t support -eltorito-platform and some other options. ironically mkisofs from SLES15 does ….
Thanks. I fixed the wrong path. About mkisofs, indeed the version that ships with SLE12 does not support the -eltorito-platform parameter. It’s required for EFI support.
I’ll try to compile the newest cdrtools package on OBS and submit it to Backports:SLE-12.
Awesome – Thanks! 🙂
Unfortunately I cannot submit the cdrtools package to Backports:SLE-12, as it breaks one of the rules mandated by the Backports Packaging Policy (https://en.opensuse.org/openSUSE:Backports_Packaging_Policy): “no provides, obsoletes or conflicts”. It conflicts with the cdrkit-compat package. However, if you’d still want to use it, you may fetch it from my OBS directory: https://build.opensuse.org/package/show/home:emendonca/cdrtools
Would be handy if autoinst.xml would work if iso is dd’d to a usb flash drive. But the tag for each package must include the specific uuid for this one specific flash drive for it to work. Would be nice if this worked:
sle-module-containers
/Module-Containers
instead of needing this which works on only 1 flashdrive:
sle-module-containers
/Module-Containers
The post deleted the xml tags:
This doesn’t work in autoyast:
Got to use this which only works on 1 flash drive:
last try:
in the media_url tag:
usb:///
doesn’t work.have to use this with the exact uuid of the flashdrive:
hd:///packages?device=/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_408D5C1658F7B190394419A1-0:0-part1&filesystem=auto
You need to use relurl:
![CDATA[relurl://./packages]]
With this, AutoYaST always searches in the path relative to the install media.
What are the prerequisites of this sles 11 machine?
The SLES 11 system must be at the latest service pack (SP4). Doing this at earlier levels may have undesired effects.