我使用所有默认的lxc设置,并以ZFS作为后台存储。
这意味着,我有一个lxc zpool,并使用lxc-create -B zfs -n ubuntu-base -t ubuntu创建了容器。
现在,根fs耗尽了空间,因为我正在用ZFS测试lxc,以及从文件中创建的zpool。
我将一个虚拟驱动器附加到VM /dev/sdb,导出了退出的lxc zpool,并使用/dev/sdb创建了一个新的lxc zpool。
然后,将旧的lxc zpool作为lxc-old导入,然后使用zfs send从lxc-old到lxc的所有数据集,销毁lxc-old。
现在,lxc-ls -f不再显示任何现有容器,但是zfs显示了数据集。
root@lxc:~# lxc-ls -f root@lxc:~#
root@lxc:~# zfs list NAME USED AVAIL REFER MOUNTPOINT lxc 5.40G 45.1G 19K /lxc lxc/clamav 679M 45.1G 870M /var/lib/lxc/clamav/rootfs lxc/hadoop 541M 45.1G 710M /var/lib/lxc/hadoop/rootfs lxc/hulk 1.11G 45.1G 1.26G /var/lib/lxc/hulk/rootfs lxc/mongodb 1.03G 45.1G 1.16G /var/lib/lxc/mongodb/rootfs lxc/mongodb2 1.03G 45.1G 1.16G /var/lib/lxc/mongodb/rootfs lxc/python 48.2M 45.1G 185M /var/lib/lxc/python/rootfs lxc/slamdata 427M 45.1G 576M /var/lib/lxc/slamdata/rootfs lxc/splunk 172M 45.1G 324M /var/lib/lxc/splunk/rootfs lxc/ubuntu-base 229M 45.1G 210M /var/lib/lxc/ubuntu-base/rootfs lxc/ubuntu-base@python 1K - 151M - lxc/ubuntu-base@mongodb 1K - 151M - lxc/ubuntu-base@slamdata 1K - 151M - lxc/ubuntu-base@hulk 1K - 151M - lxc/ubuntu-base@splunk 1K - 151M - lxc/ubuntu-base@hadoop 17.0M - 187M - lxc/ubuntu-base@new 1K - 210M - lxc/ubuntu-base@clamav 1K - 210M -
我不太确定如何让lxc查看新lxc zpool中现有的容器
发布于 2016-04-19 00:36:35
我在黑暗中做了一些尝试,但是尝试以下几个。我注意到在您的zfs list中有以下内容:
NAME USED AVAIL REFER MOUNTPOINT
lxc 5.40G 45.1G 19K /lxc
...也许您的新lxc数据集需要挂载到/var/lib/lxc。
zfs set mountpoint=/var/lib/lxc lxchttps://askubuntu.com/questions/752075
复制相似问题