Mention manual configuration for testing with loop devices in LXD #1665

Closed
axw opened this Issue Feb 15, 2017 · 1 comment

Comments

Projects
None yet
2 participants
Member

axw commented Feb 15, 2017

As of Juju 2.0, we no longer have a way to enable loop devices in the local provider, and we're not likely to bring it back soon (it's dangerous). Can we please get a small section added to replace the old docs that were removed with #1661.

To add loop devices to your container, you need to add devices to your container or profile.

...
devices:
  loop-control:
    major: "10"
    minor: "237"
    path: /dev/loop-control
    type: unix-char
  loop0:
    major: "7"
    minor: "0"
    path: /dev/loop0
    type: unix-block
  loop1:
    major: "7"
    minor: "1"
    path: /dev/loop1
    type: unix-block
...
  loop9:
    major: "7"
    minor: "9"
    path: /dev/loop9
    type: unix-block

The above is enough to expose the loop devices into the container, and for the container to acquire one of them using "losetup". It is not enough to enable the container to mount filesystems on the loop devices. For that, the simplest thing to do is to make the container privileged:

config:
  security.privileged: "true"

Each container uses the default profile, but also a model-specific profile with the name juju-. Editing a profile will affect all of the containers using it, so you can add loop devices to all LXD containers by editing the default profile, or you can scope it to a model.

Member

evilnick commented Feb 16, 2017

Cool. Thanks for explaining this, we will add it ASAP.

@degville degville closed this in #1675 Feb 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment