I’m new to LXD and really loving it. I’m working on a backup script that will create images of containers, export them, and scp them to a different server. My testing was working fine and then trying to publish a snapshot to an image for a particular container failed, and I can’t get past it.
I’m using Ubuntu 18.04 with btrfs. I’m basically doing the following:
So I renamed the snapshot directory from ‘current.ro’ to current.ro_old’ and I’m now able to do everything I need to do. I’m new to both LXD and btrfs, so if anyone could shed a little like on the predicament I would really appreciate it.
I’ll try to establish some reproducible steps, but my testing has not been very methodical. One thing that I was trying to establish as a backup routine before my method of (1) snapshot, (2), publish snapshot to image, (3) export image, was using lxc copy initiated by a remote lxd host, pulling a copy of the most recent snapshot of each container on the production server. Because that method involved creating a snapshot (called ‘current’), it’s possible that that is where the read only problem was created.
I’m guessing that ‘current.ro’ directory would need to be in the path:
I may have figured out some aspect of the cause of the problem, although I can’t exactly reproduce it. I discovered that multiple instances of the script I was testing, which uses snapshot creation and lxc copy to grab a copy from the production server, were running on the backup (remote) server. And as part of my testing I was “canceling” (or so I thought) the script. In the process of cancellation I suspect I disrupted the completion of the ‘currrent.ro’ snapshot, so the volume stayed read only, and presented the problem I was having.
In short, I suspect I could only recreate the situation if I disrupted my script again, but I’m not too excited about doing that. But thank you for helping me through this. I suspect if I let the script run I won’t have problems. A little precarious.