Saya mencoba mengatur server MaaS di dalam wadah LXC.
Ketika saya mengimpor file PXE, itu harus dapat me-mount perangkat loop.
Saya telah menetapkan opsi berikut dalam file konfigurasi wadah untuk memungkinkan pemasangan loop, tapi saya kehilangan sesuatu.
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = c 10:237 rwm
Saya mendapatkan kesalahan berikut karena skrip tidak dapat mengulang mount file:
mount: cannot mount block device /dev/loop0 read-only
Wed, 13 Nov 2013 07:26:41 +0000: failed to mount /var/lib/maas/ephemeral/precise/ephemeral/i386/20131010/disk.img
Traceback (most recent call last):
File "/usr/sbin/maas-import-ephemerals", line 26, in <module>
main(args)
File "/usr/lib/python2.7/dist-packages/provisioningserver/import_images/ephemerals_script.py", line 428, in main
target.sync(source, args.path)
File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 85, in sync
return self.sync_index(reader, path, data, content)
File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 237, in sync_index
self.sync(reader, path=epath)
File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 83, in sync
return self.sync_products(reader, path, data, content)
File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 315, in sync_products
self.insert_item(item, src, target, pgree, ipath_cs)
File "/usr/lib/python2.7/dist-packages/provisioningserver/import_images/ephemerals_script.py", line 251, in insert_item
self.extract_item(path, flat)
File "/usr/lib/python2.7/dist-packages/provisioningserver/import_images/ephemerals_script.py", line 295, in extract_item
tarball, target_dir, temp_location=self._simplestreams_path())
File "/usr/lib/python2.7/dist-packages/provisioningserver/import_images/ephemerals_script.py", line 124, in extract_image_tarball
call_uec2roottar(image, os.path.join(target_dir, 'dist-root.tar.gz'))
File "/usr/lib/python2.7/dist-packages/provisioningserver/import_images/ephemerals_script.py", line 97, in call_uec2roottar
subprocess.check_call(["uec2roottar"] + list(args))
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'uec2roottar', u'/var/lib/maas/ephemeral/precise/ephemeral/i386/20131010/disk.img', u'/var/lib/maas/ephemeral/precise/ephemeral/i386/20131010/dist-root.tar.gz']' returned non-zero exit status 1
root@maaslxc2:~# mount /dev/loop0 /mnt
mount: block device /dev/loop0 is write-protected, mounting read-only
mount: cannot mount block device /dev/loop0 read-only
Jadi, apa yang harus saya ubah dalam konfigurasi penampung agar dapat memasang perangkat loop? Tampaknya ini bukan hanya masalah MaaS, tetapi batasan yang akan menyebabkan masalah untuk apa pun (bukan hanya MaaS) yang perlu di-loop mount file dalam wadah LXC.