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).
## 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
# 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/*
## 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
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 cloud-init. log due to where they cloud/data/ tmpj6uweivq' -> '/var/lib/ cloud/data/ status. json'
Note, these will not get to /var/log/
get raised.
OSError: [Errno 116] Stale file handle: '/var/lib/
c.) reproduce with atomic_write.py (see attached) cloud/data/ status. json
sudo ./atomic_write.py /var/lib/
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 ms-libvirt -vv sync --source http:// cloud-images. ubuntu. com/daily 'release~yakkety'
uvt-simplestrea
## put the key in my.pubkey locally ubuntu. com
cat > my.pubkey <<"EOF"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.5
Comment: Hostname: keyserver.
mI0ETxf8lwEEAMA qtJVUnlCVzjTOso haE/M4mGHFl4Py1 cuE9ryOgmTWje+ 6BrNjtWLSfTQJ 1qkZoAz7VU5nDuB WDybCsolliUX4zz TYNiDnPS74fs4CD UWx9qpl5Sdb6 mFXubhJnTPR6Bq9 ptGmc0Ks6ttNs3W J/ABEBAAG0Ikxhd W5jaHBhZCBQUEEg Zm9y haW5lcnOIuAQTAQ IAIgUCTxf8lwIbA wYLCQgHAwIGFQgC CQoLBBYCAwEC eqZPujMU2zQP/ W9OCzaU7HvFrqEt 6nHGej2PEanIunx o7J8D5OR+ Yl578 UpdBnOFatDDFME7 ClN9qUrD1wDN1r9 ip2luaKiO2cZOW4 Uu5Z0n/ 3Qc6J 5GiAk+GXgF1m7ps 5lCnOCZK/ pXUEEUOS8AWnt3s M=
Kp1V6hViUoxPBck
7aygIid/
IE1hYVMgTWFpbnR
HgECF4AACgkQXP8
FpRkHRgvcdQnGuZ
eh9TNspyDMuHVVZ
=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. archive. ubuntu. com/ubuntu trusty-updates main" | sudo tee -a /etc/apt/ sources. list.d/ trusty. list lts-wily 4.2.0-42- generic /boot/vmlinuz- 4.4.0-36- generic
## This installs us a 4.2.0 kernel (currently 4.2.0-42-generic)
% echo "deb http://
% sudo apt-get update -q
% sudo eatmydata apt-get install -qy -t trusty-updates linux-virtual-
% ls /boot/vmlinuz*
/boot/vmlinuz-
## DEFAULT= .*,GRUB_ DEFAULT= saved,' /etc/default/grub /etc/default/ grub.d/ *
## make 'grub-reboot' work.
##
% sudo sed -i 's,^GRUB_
% grep -r GRUB_DEFAULT /etc/default/grub /etc/default/ grub.d/ * grub:GRUB_ DEFAULT= saved
/etc/default/
% 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 t.local. conf
#
# to turn off:
sudo overlayroot-chroot rm /etc/overlayroo
# to turn *on* tmpfs:recurse= 0 | sudo tee /etc/overlayroo t.local. conf
echo overlayroot=