O Docker falha ao iniciar, se configurado para usar o mapeador de dispositivos com lvm direto

1

No Ubuntu 16.04 Docker falha ao iniciar a inicialização do sistema se o Docker foi configurado para usar devicemapper como driver de armazenamento com direct-lvm como pool de armazenamento. Os seguintes erros ocorrem

#$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Di 2016-07-12 16:22:33 CEST; 1min 30s ago
     Docs: https://docs.docker.com
  Process: 1880 ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 1880 (code=exited, status=1/FAILURE)

Jul 12 16:22:33 docker-lvm systemd[1]: Starting Docker Application Container Engine...  
Jul 12 16:22:33 docker-lvm docker[1880]: time="2016-07-12T16:22:33.304838820+02:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devicemapper: Non existing device ubuntu--vg-thinpool"  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE  
Jul 12 16:22:33 docker-lvm systemd[1]: Failed to start Docker Application Container Engine.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Unit entered failed state.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Failed with result 'exit-code'.  
Jul 12 16:22:33 docker-lvm systemd[1]: docker.service: Start request repeated too quickly.  
Jul 12 16:22:33 docker-lvm systemd[1]: Failed to start Docker Application Container Engine. 
    
por smoe 13.07.2016 / 10:13

1 resposta

2

As mensagens de status indicaram que meu thinpool não estava disponível. lvdisplay disse o mesmo:

#$ sudo lvdisplay ubuntu-vg/thinpool
  --- Logical volume ---
  LV Name                thinpool
  VG Name                ubuntu-vg
  LV UUID                Or2cLx-ENFq-sZqh-kxUw-0FEQ-rEzi-vXCi3C
  LV Write Access        read/write
  LV Creation host, time docker-lvm, 2016-07-12 15:57:06 +0200
  LV Pool metadata       thinpool_tmeta
  LV Pool data           thinpool_tdata
  LV Status              NOT available
  LV Size                14,07 GiB
  Current LE             3601
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

Nota:    LV Status NOT available

Tentando ativá-lo, disse:

#$ sudo lvchange -ay ubuntu-vg/thinpool
  /usr/sbin/thin_check: execvp failed: No such file or directory
  Check of pool ubuntu-vg/thinpool failed (status:2). Manual repair required!

As ferramentas para thinpools estão configuradas em /etc/lvm/lvm.conf e lá encontrei o seguinte parágrafo:

    # Configuration option global/thin_check_executable.
    # The full path to the thin_check command.
    # LVM uses this command to check that a thin metadata device is in a
    # usable state. When a thin pool is activated and after it is
    # deactivated, this command is run. Activation will only proceed if
    # the command has an exit status of 0. Set to "" to skip this check.
    # (Not recommended.) Also see thin_check_options.
    # (See package device-mapper-persistent-data or thin-provisioning-tools)
    # This configuration option has an automatic default value.
    # thin_check_executable = "/usr/sbin/thin_check"

Pesquisei os pacotes mencionados e descobri que o pacote thin-provisioning-tools está disponível, mas não está instalado.

#$ sudo apt-cache policy thin-provisioning-tools
thin-provisioning-tools:
  Installed: (none)
  Candidate: 0.5.6-1ubuntu1
  Version table:
     0.5.6-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

Após a instalação do pacote, os utilitários para thinpools estavam disponíveis. A ativação manual do docker-thinpool foi bem-sucedida e, também na inicialização do sistema, o volume foi ativado e a janela de encaixe foi iniciada com êxito.

    
por smoe 13.07.2016 / 10:13