目前在腾讯云中使用的镜像是公共镜像中的CoreOS,版本是CoreOS 1745.5.0 64位。重装完第一次登录没有问题,reboot重启后,登录,就可以看到提示:

Last login: Tue Apr 14 09:50:00 CST 2020 from xxx.xxx.xxx.xxx on pts/0
Container Linux by CoreOS stable (1745.5.0)
Update Strategy: No Reboots
Failed Units: 1
  systemd-modules-load.service

发现systemd-modules-load服务启动失败,这就会导致不能开机自动运行设置的docker服务。

接下来运行命令:systemctl status systemd

VM_166_117_coreos ~ # systemctl status systemd-modules-load
● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-04-14 09:50:30 CST; 11min ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 509 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 509 (code=exited, status=1/FAILURE)

Apr 14 09:50:30 VM_166_117_coreos systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Apr 14 09:50:30 VM_166_117_coreos systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Apr 14 09:50:30 VM_166_117_coreos systemd[1]: Failed to start Load Kernel Modules.

发现是在加载内核模块时失败了,导致的systemd-modules-load服务启动失败。再执行命令:journalctl -xe,查看详细的错误信息:

VM_166_117_coreos ~ # journalctl -xe
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist cdc-acm'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist usb-common'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist usbcore'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ehci-hcd'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ehci-pci'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ehci-platform'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ohci-hcd'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ohci-pci'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ohci-platform'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ssb-hcd'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist uhci-hcd'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist xhci-hcd'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist xhci-pci'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist cp210x'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist ftdi_sio'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist pl2303'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist usbserial'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist uas'
Apr 14 10:03:48 VM_166_117_coreos systemd-modules-load[3069]: Failed to find module 'blacklist usb-storage'
Apr 14 10:03:48 VM_166_117_coreos systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Apr 14 10:03:48 VM_166_117_coreos systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Apr 14 10:03:48 VM_166_117_coreos systemd[1]: Failed to start Load Kernel Modules.
-- Subject: Unit systemd-modules-load.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-modules-load.service has failed.
-- 
-- The result is RESULT.

发现有很多模块都找不到。查找systemd-module-load服务的配置文件,发现了一个配置文件:/etc/modules-load.d/usb-blacklist.conf,里面配置的模块就是错误信息里面提示找不到的模块,内容如下:

VM_166_117_coreos ~ # cat /etc/modules-load.d/usb-blacklist.conf 
blacklist cdc-acm
blacklist usb-common
blacklist usbcore
blacklist ehci-hcd
blacklist ehci-pci
blacklist ehci-platform
blacklist ohci-hcd
blacklist ohci-pci
blacklist ohci-platform
blacklist ssb-hcd
blacklist uhci-hcd
blacklist xhci-hcd
blacklist xhci-pci
blacklist cp210x
blacklist ftdi_sio
blacklist pl2303
blacklist usbserial
blacklist uas
blacklist usb-storage

删除这个配置文件,重启,问题解决。