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

Kees Bakker keesb at ghs.com
Mon May 11 07:01:36 UTC 2020



On 09-05-2020 23:53, Andrey Repin wrote:
> Greetings, Kees Bakker!
>
>> Ah, I found out what is causing this. I was unfortunate to choose
>> my containers name such that LXD thinks one is a snapshot of the
>> other.
>> Simple test
>> root at rapper:~# lxc init images:ubuntu/bionic/amd64 -p pool2 test04-second
>> Creating test04-second
>> root at rapper:~# lxc init images:ubuntu/bionic/amd64 -p pool2 test04
>> Creating test04
>> root at rapper:~# lxc delete test04
>> Error: Error deleting storage volume: Cannot remove a volume that has snapshots
>> Also renaming (moving) doesn't work for this one.
>> root at rapper:~# lxc move test04 test04-first
>> Error: Rename instance: Failed to run: lvrename
>> /dev/rapper-vg2/containers_test04---second
>> /dev/rapper-vg2/containers_test04--first---second: Existing logical volume
>> "containers_test04---second" not found in volume group "rapper-vg2"
>> And what interesting is that you can only use a hyphen as a separator, not
>> an underscore.
>> root at rapper:~# lxc init images:ubuntu/bionic/amd64 -p pool2 test04_first
>> Creating test04_first
>> Error: Failed instance creation: Invalid instance name: Name can only
>> contain alphanumeric and hyphen characters
>> Now I have to find a trick to mislead LXD so that the containers
>> can be deleted.
> Try renaming "test04-second" first.
>

Yes, I did exactly that. That works.
-- 
Kees


More information about the lxc-users mailing list