Estoy tratando de configurar un servidor MaaS dentro de un contenedor LXC.
Cuando importo los archivos PXE, debe poder montar dispositivos de bucle.
He configurado las siguientes opciones en el archivo de configuración del contenedor para permitir el montaje del bucle, pero me falta algo.
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = c 10:237 rwm
Recibo el siguiente error porque el script no puede montar en bucle un archivo:
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
Entonces, ¿qué necesito cambiar en la configuración del contenedor para permitirle montar dispositivos de bucle? Parece que esto no es solo un problema de MaaS, sino una restricción que podría causar problemas para cualquier cosa (no solo MaaS) que necesite montar en bucle un archivo en un contenedor LXC.