Closed LeMyst closed 4 years ago
@LeMyst
We already have --force
in lvremove
I tried to reproduce this:
docker volume create -d lvm --opt size=1G foobar
[root@fedora32 docker-lvm-plugin]# docker volume ls
DRIVER VOLUME NAME
lvm foobar
Remove the underlying volume using lvremove
: lvremove -y vg1/foobar
docker volume rm foobar
[root@fedora32 docker-lvm-plugin]# docker volume rm foobar
Error: No such volume: foobar
The error is not coming from lvremove
but from here
When you do docker volume rm foobar
, docker first calls Get API
to get information on the volume. In the Get
call, getVolumeCreationDateTime
is called which relies on lvdisplay
lvdisplay
will fail because of the missing volume.
While I agree, the error message could be improved, this is not related to lvremove
.
Let me see if I can add some loggers (error message) to improve debugging.
Hello,
Du to some circumstances (manual deletion), my lvm volume is now missing and I can't remove it with "docker volume rm -f".
I can do a "sudo lvcreate -n mylvvolumedeleted -L 1 myvg" to recreate a temporary lvm volume, but a more comprehensive message than "Error response from daemon: remove mylvvolumedeleted: VolumeDriver.Remove: error removing volume" would be better, and maybe the force option remove the docker volume when the lv volume is missing (for my case).
https://github.com/containers/docker-lvm-plugin/blob/994a35e5405e50ec141300aec4645b23e8270865/utils.go#L23