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:
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.