Unattended Upgrades in Google Cloud fill up disk

1

I created a micro instance in the Google Cloud Engine with a 10GB boot disk, using the Google-provided Ubuntu 14.04 image. The server hosted a small nginx/php/mysql app.

A few months later, the app stopped working because the disk was completely filled up. Most of the space was taken up by newer kernels, which seem to have been installed by unattended-upgrades. The instance was never rebooted (neither manually nor automatically).

Is that normal behaviour for Ubuntu 14.04? Do I need to perform some tasks after creating the instance to make sure this doesn't happen? If so, what are those and why is Google providing me such "broken" Ubuntu images, considering the defaults for all other things seem sensible.

(Thankfully, in this case I was still able to SSH-in, do apt-get autoremove and reboot, which freed up most of the disk space. But I still would like to avoid this in the future.)

xrstf

Posted 2016-03-09T19:16:56.803

Reputation: 113

Answers

1

Ubuntu images automatically upgrade to keep your system up-to-date and protect you from security vulnerabilities. This is independent of Google Compute Engine, it's a standard Ubuntu feature.

If you want to disable auto-updates, you can follow the documentation from Ubuntu for how to do this, but it's not recommended. Instead, please see how you can keep the automatic updates.

You should create a disk for your VM that's (a) large enough to enable updates and (b) ensure automatic cleanup; per the docs, the setting is located in /etc/apt/apt.conf.d/10periodic and should be similar to:

APT::Periodic::AutocleanInterval "7";

Misha Brukman

Posted 2016-03-09T19:16:56.803

Reputation: 371