cloud-init is always upgrading the kernel to latest
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subiquity (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Hi !
I've been using cloud-init to build Ubuntu 20.04 VM Images with Packer from a the ISO file https:/
When starting an Ubuntu Server using this ISO file directly, we can see that the Kernel version is the kernel of February, which makes sense since that's the date of the ISO build.
Last month, in July, a bug has been detected in the latest version of the Linux kernel, version 5.4.0-122.
Due to this kernel bug, I have been trying to build an Ubuntu Image that would not use the latest kernel. My goal was then to later upgrade the kernel up to the last known working kernel, which is version 5.4.0-121.
Sadly, it seems like cloud-init is ignoring the option 'refresh-installer' and the Image that is built is directly installing the latest version of the kernel, which is the one that contains the bug.
I tried the following approach to disable the automatic upgrade of the kernel:
Test 1:
#cloud-config
autoinstall:
refresh-
update: no
Test 2:
#cloud-config
autoinstall:
early-commands:
- apt-mark hold linux-generic linux-image-generic linux-header-
Test 3:
#cloud-config
autoinstall:
early-commands:
- echo "Unattended-
- echo "\"linux-
- echo "\"linux-
- echo "\"linux-
- echo "};" >> /target/
In Test 1 and 2, the kernel is anyway upgraded to version 5.4.0-122.
In test 3, the image fail to be built.
I believe there should be a way to avoid automatically upgrading the kernel to the latest version when building the image, but for some reason I have not been able to identify how to do that.
Any ideas ?
Thanks
Thomas
affects: | cloud-init (Ubuntu) → subiquity (Ubuntu) |
Changed in subiquity (Ubuntu): | |
importance: | Undecided → Medium |
Hello Lejeune,
The `autoinstall` schema is handed over from cloud-init to subiquity in the installer boot and it is subiquity which consumes it. Therefore, I think this ticket belongs to subiquity.
The `refresh-installer` configuration relates to the update of the installer system, see [1]. But, subiquity performs an unattended-upgrade of the target system regardless of this configuration, and there is not a built-in option to disable it.
Doing a search, I have found an answer exposing some "unofficial" ways to disable the upgrade, see [2].
[1] https:/ /ubuntu. com/server/ docs/install/ autoinstall- reference /askubuntu. com/questions/ 1410553/ how-to- disable- unattended- upgrades- during- autoinstall- user-data- cloud-config
[2] https:/