wetopi / docker-volume-rbd

Docker Engine managed plugin to manage RBD volumes.
MIT License
69 stars 18 forks source link

Got loops on rbd image mapping #22

Closed alirezarm78 closed 6 months ago

alirezarm78 commented 2 years ago

On my swarm cluster i can not delete my volume and when i run lsblk command i have too many rbd devices that mapped to host and not mounted to anywhere.

docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 9
  Running: 9
  Paused: 0
  Stopped: 0
 Images: 11
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: local
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: active
  NodeID: 8r00lf8usibdieger2gu9wnc1
  Is Manager: true
  ClusterID: unvcxdi9w9bawx2dyog9u3moz
  Managers: 1
  Nodes: 2
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-125-generic
 Operating System: Ubuntu 20.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.741GiB
 Name: master1
 ID: MXYO:I7OL:VQCI:R5BB:NGAG:JWHZ:6B6W:XRBR:YMIZ:SOUG:CYRX:NVGB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
sitamet commented 1 year ago

Try this test cycle:

# creating a volume:
docker volume create -d wetopi/rbd -o pool=ssd -o size=1024 rbd_test
docker run --rm --name=rbd_test --mount type=volume,source=rbd_test,destination=/test,volume-driver=wetopi/rbd busybox sh -c 'touch /test/foo00'

# this shoudn't exist:
ls -l /var/lib/docker/plugins/*/propagated-mount/rbd_test

# volume should contain our foo00 file:
docker run --rm --name=rbd_test --mount type=volume,source=rbd_test,destination=/test,volume-driver=wetopi/rbd busybox sh -c 'ls -l /test/ | grep foo'

# after removing the volume the image shouldn't exist:
docker volume rm rbd_test
rbd --pool ssd ls | grep rbd_test