Docker run运行容器报错Error ruuning deviceCreate(createSnapDevice) dm_task_run failed

问题背景

重启k8s集群中的某主机(CentOS7),调度到该主机上的kubernetes的Pod一直处于ContainerCreating状态。通过 kubectl describe pod $PodName和使用docker run运行容器的方式均发现如下报错信息:
    Error ruuning deviceCreate(createSnapDevice) dm_task_run failed

解决方式

    systemctl stop docker.service
    thin_check /dev/centos/metadata
    thin_check --clear-needs-check-flag /dev/centos/metadata

其中,thin_check执行成功会提示如下:

    examining superblock
    examining devices tree
    examining mapping tree
    checking space map counts

原因分析

猜测可能是由于重启主机导致docker中devicemapper的metadata异常

注意

1、以上命令/dev/centos/metadata取自docker info中Metadata file的值

    [root@zxg ~]$ docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 18
    Server Version: 1.12.6
    Storage Driver: devicemapper
     Pool Name: docker-253:1-2024377-pool
     Pool Blocksize: 65.54 kB
     Base Device Size: 10.74 GB
     Backing Filesystem: xfs
     Data file: /dev/centos/data
     Metadata file: /dev/centos/metadata

你可能感兴趣的:(Docker)