[lxc-users] Cannot remove a volume that has snapshots

Kees Bakker keesb at ghs.com
Mon May 11 07:13:49 UTC 2020


On 09-05-2020 20:31, gunnar.wagner wrote:
>
>> I was unfortunate to choose my containers name such that LXD thinks one is a snapshot of the
>> other.
> hm. Not sure whether this is the explanation. The volume of a snapshot of test04 would be named *test04/second* and not *test04-second*. (at least it is that scheme I get with 'lxc storage volume list pool2'(and also is the naming scheme you use to delete snapshots)

The problem is that the underlying LVM names are such that a hyphen is used as a separator. And any hyphen
in the container (or snapshot) name is "escaped" by doubling it. So in my case the LVM volume is named test04--second.
In hindsight that was a bad choice, IMHO.
>
> So, if that naming has some sort of relevance as you suspect It smells more like a bug then a feature.
The bug is that the algorithm to find snapshots in the list of LVM volumes is wrong. When it searches for
snapshots for test04 it was looking for anything that starts with test04- and that would incorrectly find
test04-second. BTW, see https://github.com/lxc/lxd/issues/7335
>
>> And what interesting is that you can only use a hyphen as a separator, not
>> an underscore.
> can't confirm that neither. My snapshots all have names like 'pre-some_string' and have never seen any problem with that.
I was talking about the name of the container, not the snapshot. You cannot have a container named test04_second.
-- 
Kees
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20200511/11e8c264/attachment.htm>


More information about the lxc-users mailing list