解决自定义镜像中的 lxc 启动问题

解决自定义镜像中的 lxc 启动问题

有一个从另一个系统导出的图像,大小约为 5GiB(压缩后),未压缩时估计为 13GiB。

root@cluster04:~# lxc launch testimg test-container --storage remote -d root,size=50GiB                                                                                                                                                
Creating test-container
Error: Failed creating instance from image: Unpack failed: Failed to run: tar --restrict --force-local -C /var/snap/lxd/common/lxd/storage-pools/remote/images/ce3abc55bed7691008701546adcf4e74820561b030c68ad89d04fafb92c81d14 --num
eric-owner --xattrs-include=* -zxf -: exit status 2 (tar: rootfs/var/log/journal/136406c4d5434cdbb98e99da413b40a3/system@9ea27ff38c7c4d80a55509c72336317b-000000000002df79-0005e71ab9d69c82.journal: Wrote only 2560 of 10240 bytes  
tar: rootfs/var/log/journal/136406c4d5434cdbb98e99da413b40a3/system@9ea27ff38c7c4d80a55509c72336317b-0000000000046ced-0005e72bb8bfd822.journal: Cannot write: No space left on device                                                
tar: rootfs/var/log/journal/136406c4d5434cdbb98e99da413b40a3/system@9ea27ff38c7c4d80a55509c72336317b-0000000000060392-0005e7387bbd67f9.journal: Cannot write: No space left on device                             
(...)
tar: Exiting with failure status due to previous errors)

“远程”存储有足够的可用空间:

info:
  description: ""
  driver: ceph
  name: remote
  space used: 3.95TiB
  total space: 6.17TiB
used by:
  images:
  - 8b3a9a81a3f25b5fb2454f8e777ed5427a83a1b1fcd6f1bf7acb7b38437525ec
  instances:
  - dns01
  - dns02
  - man01
  - monitoring01
  - nfs01
  profiles:
  - default

默认配置文件不限制根文件系统的大小:

lxc profile show default
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    network: lxdfan0
    type: nic
  root:
    path: /
    pool: remote
    type: disk
name: default
used_by:
- /1.0/instances/dns01
- /1.0/instances/dns02
- /1.0/instances/nfs01
- /1.0/instances/monitoring01
- /1.0/instances/man01

我正在尝试找出如何解决此问题。该命令开始打印以下内容:

Retrieving image: Unpack: 23% (85.62MB/s)

并且,一旦达到 100%,它就会打印一堆 tar 错误。

我可以创建其他容器,例如这个成功了:

lxc launch ubuntu:22.04 test-ub2204 --storage remote -d root,size=50GiB

有任何想法吗?

谢谢!

相关内容