创建自己的 lxc 模板时 - proxmox 拒绝基于它创建新的虚拟机,抛出以下内容:
Using default stripesize 64.00 KiB.
Logical volume "vm-100-disk-1" created.
mke2fs 1.44.3 (10-July-2018)
Discardindone
Creating filesystem with 2097152 4k blocks and 524288 inodes
Filesystem UUID: 5d45a865-bfc5-4368-8b88-710a39856a3d
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tabdone
Writing inode tabdone
Creating journal (16384 blocks): done
Multiple mount protection is enabled with update interval 5 seconds.
Writing superblocks and filesystem accounting informatdone
extracting archive '/var/lib/vz/template/cache/snap-test-03-2018-08-04.tar.gz'
Total bytes read: 407459840 (389MiB, 86MiB/s)
Architecture detection failed: open '/bin/sh' failed: No such file or directory
Falling back to amd64.
Use `pct set VMID --arch ARCH` to change.
Logical volume "vm-100-disk-1" successfully removed
TASK ERROR: unable to detect OS distribution
当使用来自https://linuxcontainers.org/的模板时- 一切都很好。
问题是互联网上的错误建议(无论如何都与 proxmox 相关)。
dash提供/bin/sh/var/lib/lxc/<имя контейнера>。我们必须打包/var/lib/lxc/<имя контейнера>/rootfs。通过创建的结果存档tar -czvf不应包含文件夹rootfs和config. 只有根。用于打包的示例(但有效)脚本: