File truncated after lxc snapshot restore
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm having a persistent problem with a container based app breaking after restore from snapshot, specifically several lines are truncated from the end of a file within the container.
I can stop/start the container, copy and copy it back to the same name and everything is fine. Taking snapshots works fine, but on restore from a snapshot the damage has occurred in the container. Even deleting and recreating the container leads to the same problem.
Snapshot restore was working but started breaking about 2-3 weeks ago. Apologies for not having paid more attention when this bug started occurring but I was dealing with bugs in the app and it wasn't immediately clear this was a problem with lxd.
Taking a snapshot in a vbox vm with the same software installed works perfectly, the problem seems specific to restore of an lxc container
I upgraded the host system from 16.04 to 16.10 in the (mistaken) hope it would fix this issue. So currently the host is/has:
Ubuntu 16.10, Linux 4.8.0-28-generic #30-Ubuntu SMP
lxd:
Installed: 2.4.1-0ubuntu1
Candidate: 2.4.1-0ubuntu1
Version table:
*** 2.4.1-0ubuntu1 500
500 http://
100 /var/lib/
The host is an HP N40L microserver with an AMD Turion II Neo N40L CPU. The zpool is on a spinning HD with no hardware or software RAID.
zfs utils show no apparent problems with the zpool:
sudo zpool status -v
pool: lxdfs
state: ONLINE
scan: scrub repaired 0 in 0h2m with 0 errors on Sun Oct 9 00:26:06 2016
config:
NAME STATE READ WRITE CKSUM
lxdfs ONLINE 0 0 0
/var/
errors: No known data errors
## What I do
- lxd is setup to use bridged networking allowing containers to obtain an ip via dhcp on my router
- The guest container is created and the app installed with:
lxc launch ubuntu:14.04 fix -c security.
lxc file push ~/.ssh/id_rsa.pub ods/home/
- Then log into the container:
ssh ubuntu@ods
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo shutdown -r now
- Take a snapshot on the host:
lxc snapshot ods upgraded
- Log into the guest and install the web app stack:
ssh ubuntu@ods
wget https:/
sudo -H bash install.sh --server-
- Once install is complete log into the web app set admin password etc.
- Take another snapshot on the host
lxc snapshot ods devshop-installed
- Restore last snapshot:
lxc restore ods devshop-installed
- Previously working app now throws an error, on investigation it turns out one particular config file is now missing about 4 lines.
More details to come.
Actually I cant now recreate this problem - lxd/c now requests criu is installed for restore (live migration). But installing criu and trying to restore throws a criu error.
I think this repot can be closed for now. Sorry for the noise.