Dan Kegel
2016-05-23 15:36:38 UTC
Hi all!
I recently started trying to mount ephemeral lxc containers on tmpfs,
and fairly often, a script inside the container launched by
lxc-start-ephemeral will fail early with
rm: failed to get attributes of '/': Stale file handle
I tried reproducing the problem with the following script, but no luck so far,
the test script ran for a minute with no problems.
I'll post again if I come up with a working repro script.
Any suggestions for what to do on a stock ubuntu machine to
provide more clues?
uname -a says
Linux ubu16-bb-02 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
#!/bin/sh
set -e
set -x
# lxc-create -t ubuntu is kind of fragile, might need to retry on network error
lxc-create -t ubuntu -n orig -- -r xenial
# ok, now try to reproduce the problem
mkdir -p /data/tmpfs
mount -t tmpfs none /data/tmpfs
ln -sf /var/lib/lxc/orig /data/tmpfs/orig
# echo "Warning: to see the new container, you'll need to use the
--lxcpath /data/tmpfs option"
while lxc-start-ephemeral \
--orig orig \
--name foo \
--lxcpath /data/tmpfs \
--storage-type dir \
--union-type aufs \
-- \
rm -rf /foobar
do
sleep 1
done
I recently started trying to mount ephemeral lxc containers on tmpfs,
and fairly often, a script inside the container launched by
lxc-start-ephemeral will fail early with
rm: failed to get attributes of '/': Stale file handle
I tried reproducing the problem with the following script, but no luck so far,
the test script ran for a minute with no problems.
I'll post again if I come up with a working repro script.
Any suggestions for what to do on a stock ubuntu machine to
provide more clues?
uname -a says
Linux ubu16-bb-02 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
#!/bin/sh
set -e
set -x
# lxc-create -t ubuntu is kind of fragile, might need to retry on network error
lxc-create -t ubuntu -n orig -- -r xenial
# ok, now try to reproduce the problem
mkdir -p /data/tmpfs
mount -t tmpfs none /data/tmpfs
ln -sf /var/lib/lxc/orig /data/tmpfs/orig
# echo "Warning: to see the new container, you'll need to use the
--lxcpath /data/tmpfs option"
while lxc-start-ephemeral \
--orig orig \
--name foo \
--lxcpath /data/tmpfs \
--storage-type dir \
--union-type aufs \
-- \
rm -rf /foobar
do
sleep 1
done