Here is some information on how to reproduce this. I use uvt-kvm, just as an easy way to get a remote system to work with. I assume that any boot of xenial or yakkety will reproduce the problem.
The failure shows itself in a couple different ways: a.) original report: apt-key add my.pubkey This show error messages and exit non-zero. b.) console error logs with cloud-init failing renames Note, these will not get to /var/log/cloud-init.log due to where they get raised. OSError: [Errno 116] Stale file handle: '/var/lib/cloud/data/tmpj6uweivq' -> '/var/lib/cloud/data/status.json' c.) reproduce with atomic_write.py (see attached) sudo ./atomic_write.py /var/lib/cloud/data/status.json Very interestingly most file paths do not fail, but that one does. 4.2 (linux-virtual-lts-wily) passes, 4.4 fails (yakkety or xenial). ## Sync yakkety images to your uvt uvt-simplestreams-libvirt -vv sync --source http://cloud-images.ubuntu.com/daily 'release~yakkety' ## put the key in my.pubkey locally cat > my.pubkey <<"EOF" -----BEGIN PGP PUBLIC KEY BLOCK----- Version: SKS 1.1.5 Comment: Hostname: keyserver.ubuntu.com mI0ETxf8lwEEAMAqtJVUnlCVzjTOsohaE/M4mGHFl4Py1cuE9ryOgmTWje+6BrNjtWLSfTQJ Kp1V6hViUoxPBck1qkZoAz7VU5nDuBWDybCsolliUX4zzTYNiDnPS74fs4CDUWx9qpl5Sdb6 7aygIid/mFXubhJnTPR6Bq9ptGmc0Ks6ttNs3WJ/ABEBAAG0IkxhdW5jaHBhZCBQUEEgZm9y IE1hYVMgTWFpbnRhaW5lcnOIuAQTAQIAIgUCTxf8lwIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC HgECF4AACgkQXP8eqZPujMU2zQP/W9OCzaU7HvFrqEt6nHGej2PEanIunxo7J8D5OR+Yl578 FpRkHRgvcdQnGuZUpdBnOFatDDFME7ClN9qUrD1wDN1r9ip2luaKiO2cZOW4Uu5Z0n/3Qc6J eh9TNspyDMuHVVZ5GiAk+GXgF1m7ps5lCnOCZK/pXUEEUOS8AWnt3sM= =1RpZ -----END PGP PUBLIC KEY BLOCK----- EOF # launch a guest name="sm-y1" uvt-kvm create "$name" # wait for it to come up uvt-kvm wait --insecure "$name" # add the key file for easy use there. uvt-kvm ssh --insecure "$name" "cat > my.pubkey" <<my.pubkey # ssh in uvt-kvm ssh --insecure "$name" ## add trusty and get wily kernel where this is not an issue. ## This installs us a 4.2.0 kernel (currently 4.2.0-42-generic) % echo "deb http://archive.ubuntu.com/ubuntu trusty-updates main" | sudo tee -a /etc/apt/sources.list.d/trusty.list % sudo apt-get update -q % sudo eatmydata apt-get install -qy -t trusty-updates linux-virtual-lts-wily % ls /boot/vmlinuz* /boot/vmlinuz-4.2.0-42-generic /boot/vmlinuz-4.4.0-36-generic ## ## make 'grub-reboot' work. ## % sudo sed -i 's,^GRUB_DEFAULT=.*,GRUB_DEFAULT=saved,' /etc/default/grub /etc/default/grub.d/* % grep -r GRUB_DEFAULT /etc/default/grub /etc/default/grub.d/* /etc/default/grub:GRUB_DEFAULT=saved % sudo update-grub % sudo grub-set-default 0 ## Set grub to reboot into the kernel you want. # # Assuming you want kernel 4.4.0-36-generic, to boot into that do: sudo sh -c 'grub-reboot "$0"' "Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-36-generic" # if you're already in overlayfs, you need to modify the root # so you need overlayroot-chroot sudo overlayroot-chroot sh -c 'grub-reboot "$0"' "Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-36-generic" # then reboot ## Toggle overlayroot on or off # # to turn off: sudo overlayroot-chroot rm /etc/overlayroot.local.conf # to turn *on* echo overlayroot=tmpfs:recurse=0 | sudo tee /etc/overlayroot.local.conf -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1618572 Title: apt-key add fails in overlayfs To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1618572/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs