-
Notifications
You must be signed in to change notification settings - Fork 181
Use LVM to create container #359
Comments
Before I dig into this, would you mind trying to reproduce that from within one of the VBox VMs available from https://github.com/fgrehm/vagrant-lxc-vbox-hosts? |
Yes, i'll give a try on my machine. |
So, same behavior, same message on a Debian 7 (not upgraded). Do you want me to test on the latest and oldest Ubuntu you provide? |
I think I remember this issue (I set up lxc + lvm about a year ago with a patched version of vagrant-lxc). The bug is here: https://github.com/fgrehm/vagrant-lxc/blob/master/lib/vagrant-lxc/driver.rb#L94-L101 In order to support shared folders on separate block devices, I think that check would have to be done via lxc-attach on a running container. |
My hacky fix to stop shared folders from being created was this: ccope@045918b Edit: You can't check for 'none' here, because mainline vagrant-lxc went with specifying "best" as the default. You could check for 'best' instead, and manually override your backingstore to be lvm, so you could then effectively disable shared folders. Edit2: You can probably disregard my hacky fix. I had to preserve shared folders in my old setup for... reasons. This would probably be a non-issue if you just disabled all shared folders (including the default vagrant one). If you actually need them, the changes in my previous comment need to be made. |
The real problem is rootfs storing the LV block device's path. This hack is ok for workaround but definitely not the solution. Anyway, thanks for that, i'll use a local patched version of this plugin so I can build containers on LVM, but this issue should stay open until the solution for rootfs is found. I may have time this -long- week end to watch for it. |
cant wait to watch for Well, seems like the lxc-template script is not setting the correct rootfs, maybe because "--rootfs" option is not passed to it. The LXC Vagrant driver get the rootfs from the LXC configuration file so… If i hard-code the correct LXC_ROOTFS path in the template, the container creates correctly, and shared folder too. |
Sorry but I'm not familiar with LVM to better understand this :-/ |
In fact, LVM setup works like a charm as it is handled by the I identified two problems, which are running that order:
Here are my proposals: The lxc-template given by you should be called with
|
Correction to what I said with rootfs: I've created an LXC container with lxc-1.0.x and rootfs is Hum. We need here something like If fact, the driver needs to be fully aware of the storage mode of the container. I believe it's the same for btrfs, isn't it? |
I brought this issue up in the past: #235 (comment) @leryan, try adding this line to your Vagrantfile inside the config block to work around the issue for the time being: Your Vagrantfile works for me when I add that. Except there's now a failure in vagrant halt where it tries to rm data in the tmp directory, thinking it is in /dev/linux/lxc_testvagrant/tmp/. @fgrehm when using LVM (and presumably btrfs), the rootfs is not mounted in the host's mount namespace. The 'roofts' is a block device, such as /dev/lxc/container_name. Thus, trying to manipulate the container's filesystem from the host will fail. It looks like we can fix it for real now by replacing the existing shared folder mountpoint creation logic with a mount option: lxc/lxc#78 (comment) I'll make a PR for the shared folder bit tomorrow. Filed #360 for the halt bug. |
Hi,
I encounter a problem while using LVM to store containers.
Here is the Vagrantfile:
Here is the most important message :
Also, I dont know if it can be possible to bypass LVM asking to wipe old filesystem metadata, for the moment i workarounded it by disable detection.
But, well, I can't figure out why the rootfs is the LVM device path… maybe a bug while handling lvm backingstore?
The full debug trace:
The text was updated successfully, but these errors were encountered: