eatmydata enabled by default results in apt packages not correctly installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Invalid
|
Medium
|
Unassigned |
Bug Description
I'm using LXD 5.0 (LTS) on Ubuntu 22.04 to launch containers and virtual machines. I am using cloud-init in LXD's user.user-data field to install some apt packages when the container or VM is launched. For example, I have the following cloud-config section:
package_update: true
packages:
- openssh-server
The server is launched as follows:
lxc launch images:
However, when the server is launched, the apt package is listed as successfully installed, but there are no files associated with it:
util.py[DEBUG]: apt-install [eatmydata apt-get --option=
handlers.py[DEBUG]: finish: modules-
Yet "dpkg -L openssh-server" shows:
Package 'openssh-server' does not contain any files (!)
This results in an unusable system. I don't know what "eatmydata" is or why it is enabled by default, but does indeed appear to be eating this data and resulting in an unusable server.
It looks like there's a sparsely documented option called apt_get_wrapper which seems to let you disable "eatmydata":
https:/
I configured this to disable "eatmydata" and sure enough, I am now able to successfully create a virtual machine. Is it possible to better document the use of eatmydata in cloud-init, and moreover maybe consider disabling it by default so you have to opt-in to get the performance benefits it provide (while accepting the risk of possible data corruption)?
Thanks!
Hi Andrew,
Thanks for filing this bug.
It sounds like there is a bug here, but since this seemed reproducible for you (which is surprising given the nature of eatmydata) I'd like to reproduce. I don't think we've had previous errors related to eatmydata, so closer inspection is required before making behavior changes.
Since these images do not have cloud-init installed, some post-boot steps must be required after pulling the image. Could you please share the steps you took to reproduce? We attempted to reproduce, and have not been able to this far.
As for docs, yes this should probably be better documented.