Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it required to setup a volume group before deploying the nova-volume Juju charm? I am trying to install Openstack locally on my Ubuntu VM running in local (lxc) mode and get an error that either the physical volume does not exist or loopback is not found. Looking at the hooks I cannot see if it tries to create the loopback volume group.

The loopback error message from the juju debug log is shown here:

2012-05-24 11:30:53,876 unit:nova-volume/4: hook.output INFO: Processing triggers for initramfs-tools ...
2012-05-24 11:30:56,306 unit:nova-volume/4: hook.output ERROR: losetup: Could not find any loop device. Maybe this kernel does not know
       about the loop device? (If so, recompile or `modprobe loop'.)
2012-05-24 11:30:56,307 unit:nova-volume/4: hook.output ERROR: 
2012-05-24 11:30:56,311 unit:nova-volume/4: hook.output ERROR: failed to setup loop device for /var/lib/nova-volumes/my-vol.img
2012-05-24 11:30:56,524 unit:nova-volume/4: unit.hook.api INFO: ERROR: failed to get device for /var/lib/nova-volumes/my-vol.img|2G
2012-05-24 11:30:56,526 unit:nova-volume/4: hook.output INFO: {}
2012-05-24 11:30:56,547 unit:nova-volume/4: hook.output DEBUG: hook install exited, exit code Traceback (most recent call last):
Failure: juju.errors.CharmInvocationError: Error processing '/var/lib/juju/units/nova-volume-4/charm/hooks/install': exit code 1.
.
2012-05-24 11:30:56,548 unit:nova-volume/4: hook.executor DEBUG: Hook error: /var/lib/juju/units/nova-volume-4/charm/hooks/install Error processing '/var/lib/juju/units/nova-volume-4/charm/hooks/install': exit code 1.
2012-05-24 11:30:56,552 unit:nova-volume/4: statemachine DEBUG: unitworkflowstate:  executing error transition error_install, Error processing '/var/lib/juju/units/nova-volume-4/charm/hooks/install': exit code 1.
2012-05-24 11:30:56,577 unit:nova-volume/4: statemachine DEBUG: unitworkflowstate: transition error_install (None -> install_error) {}
2012-05-24 11:30:56,587 unit:nova-volume/4: statemachine DEBUG: unitworkflowstate: transition complete error_install (state install_error) {}
2012-05-24 11:30:56,605 unit:nova-volume/4: juju.agents.unit DEBUG: Configuration Changed
2012-05-24 11:30:56,606 unit:nova-volume/4: juju.agents.unit DEBUG: Configuration updated on service in a non-started state
2012-05-24 11:30:56,611 unit:nova-volume/4: juju.agents.unit INFO: No upgrade flag set.
share|improve this question
add comment

1 Answer 1

Getting this going in LXC is a bit tricky. First, you need to make sure the host supports loopback and LVM, and has the appropriate modules loaded. Then, some manual steps need to be completed:

First, Grant container access to the various device nodes losetup and LVM need, specifically /dev/loop[0-9], /dev/loop-control, and /dev/mapper/control.

In /usr/share/pyshared/juju/lib/lxc/data/lxc.conf, add the following:

lxc.cgroup.devices.allow = c 10:236 rwm
lxc.cgroup.devices.allow = c 10:237 rwm
lxc.cgroup.devices.allow = b 7:* rwm

Then you'll also need to manually create the loop-control device node somehow within the container. If you've already deployed a unit, and Juju has a template for the environment, you can do this within the /dev directory of that template, eg:

sudo mknod /var/lib/lxc/adam-sample-0-template/rootfs/dev/loop-control c 10 237

The /dev/mapper/controller device node will be created when LVM gets installed.

Alternatively, you can modify the nova-volume charm to do this for you automatically during its install hook. Unfortunately, I do not know a way for Juju or LXC to pre-authorize and populate the /dev directory of new containers with devices required by the charm. Until those kinds of features land, the nova-volume charm (and probably nova-compute, too) will likely require awkward work arounds like this to ensure they work correctly in LXC containers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.