enable-os-refresh-update and enable-os-upgrade config options are ignored
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
Juju version: 2.4.4-bionic-amd64 (snap/stable)
Description:
We're bootstrapping a controller to lxd and disabling the os refresh/upgrade because we're pre-caching the lxc image used by juju (apt update/upgrading, installing additional packages, etc). While updating this process, I noticed that the refresh/upgrade is still running, despite being disabled by config.
Expected behavior:
When Juju instantiates a new machine, apt-get update and apt-get upgrade will not be run.
Observed behavior:
apt-get update and apt-get upgrade are being run.
Steps to recreate:
$ juju bootstrap lxd devel --config enable-
$ juju model-config
[...]
enable-
enable-os-upgrade model false
[...]
$ juju add-machine
As soon as the machine is created by lxc, tail cloud-init, i.e.,
$ lxc exec juju-c4a855-0 -- tail -f /var/log/
Cloud-init v. 18.4-0ubuntu1~
Hit:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Fetched 247 kB in 1s (202 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
tmux is already the newest version (2.6-3).
curl is already the newest version (7.58.0-
[...]
Changed in juju: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Just a few notes on this bug:
1. Unless you have pre-cached images such as this user, "juju bootstrap lxd devel --config enable- os-refresh- update= false --config enable- os-upgrade= false" will fail because juju's attempt to install mongo packages fails with not found.
2. --config enable- os-refresh- update= false sets package_update to false in the user-data.txt for cloud-init. From the cloud init docs:
#cloud-config update: false
# Update apt database on first boot (run 'apt-get update').
# Note, if packages are given, or package_upgrade is true, then
# update will be done independent of this setting.
#
# Default: false
# Aliases: apt_update
package_
https:/ /cloudinit. readthedocs. io/en/latest/ topics/ examples. html?highlight= package_ update# update- apt-database- on-first- boot
Juju does include packages to be installed in cloud init, currently a user can add to the list of installed packages, but not remove. A caveat is that for bootstrap, juju does not include any packages to be installed on first boot, only starting non bootstrap instances.