New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage lxc-clone / BTRFS #99

Open
fgrehm opened this Issue Jun 20, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@fgrehm
Owner

fgrehm commented Jun 20, 2013

No description provided.

@codec

This comment has been minimized.

Show comment
Hide comment
@codec

codec Feb 12, 2014

I have a rough sketch for lxc-clone support, see codec/vagrant-lxc@fgrehm:next...feature/lxc_clone_next
(I need to clean that up ⚠️)

This still implies a few things to get it working:

  • The patches require a backing store that supports snapshots (i.e. ZFS, btrfs, LVM).
  • The basebox, except for its name, isn't used at all. You need to provide an existing container named after the basebox (i.e. precise64). I've modified the build scripts to keep the build container and name it properly.
  • LXC 1.0.0 is required (1.0.0~alpha1 works fine on saucy) as prior releases lack backingstore support in lxc-clone.

Obviously this is more of a proof-of-concept, but do you think it's worth to pursue this any further?

codec commented Feb 12, 2014

I have a rough sketch for lxc-clone support, see codec/vagrant-lxc@fgrehm:next...feature/lxc_clone_next
(I need to clean that up ⚠️)

This still implies a few things to get it working:

  • The patches require a backing store that supports snapshots (i.e. ZFS, btrfs, LVM).
  • The basebox, except for its name, isn't used at all. You need to provide an existing container named after the basebox (i.e. precise64). I've modified the build scripts to keep the build container and name it properly.
  • LXC 1.0.0 is required (1.0.0~alpha1 works fine on saucy) as prior releases lack backingstore support in lxc-clone.

Obviously this is more of a proof-of-concept, but do you think it's worth to pursue this any further?

@ccope

This comment has been minimized.

Show comment
Hide comment
@ccope

ccope Feb 18, 2014

Collaborator

I have something pretty similar to @codec's branch that I've been using internally for a test pipeline, but it also needs cleanup. Here's a quick WIP: ccope/vagrant-lxc@fgrehm:next...clone_public (I've been using this on Ubuntu 12.04, LXC 0.7.5, with LVM)

The major problem I've run into is that shared folders don't work with LVM (or probably anything else that isn't a plain directory or overlay). The root volume isn't mounted in a place which is accessible by the host when the guest boots, so the current method of mkdir'ing it doesn't work. The mountpoint directories have to be created either when the tarball gets unpacked or via ssh once the vm boots up (the latter is more flexible).

Collaborator

ccope commented Feb 18, 2014

I have something pretty similar to @codec's branch that I've been using internally for a test pipeline, but it also needs cleanup. Here's a quick WIP: ccope/vagrant-lxc@fgrehm:next...clone_public (I've been using this on Ubuntu 12.04, LXC 0.7.5, with LVM)

The major problem I've run into is that shared folders don't work with LVM (or probably anything else that isn't a plain directory or overlay). The root volume isn't mounted in a place which is accessible by the host when the guest boots, so the current method of mkdir'ing it doesn't work. The mountpoint directories have to be created either when the tarball gets unpacked or via ssh once the vm boots up (the latter is more flexible).

@fgrehm

This comment has been minimized.

Show comment
Hide comment
@fgrehm

fgrehm Feb 20, 2014

Owner

I'm up for having this in place and I actually had some notes around it, I'll try to find them and will get back to you guys :-)

Owner

fgrehm commented Feb 20, 2014

I'm up for having this in place and I actually had some notes around it, I'll try to find them and will get back to you guys :-)

@ccope

This comment has been minimized.

Show comment
Hide comment
@ccope

ccope Feb 23, 2014

Collaborator

So, I've found a couple of ways to interact with a running container's filesystem from the host. One, if you're running a new enough kernel, is to just use lxc-attach --name foo -- foo_cmd
Another is to make folders in the following path:
/proc/$(sudo lxc-info -n NAME -p | awk '{print $2}')/
(I'm using awk instead of lxc-info -H because that option doesn't exist in lxc <1.0)
Source: https://www.stgraber.org/2013/12/21/lxc-1-0-advanced-container-usage/

I'm going to implement the latter option in my branch for now, because it has better backwards compatibility, but lxc-attach seems much less hacky.

Collaborator

ccope commented Feb 23, 2014

So, I've found a couple of ways to interact with a running container's filesystem from the host. One, if you're running a new enough kernel, is to just use lxc-attach --name foo -- foo_cmd
Another is to make folders in the following path:
/proc/$(sudo lxc-info -n NAME -p | awk '{print $2}')/
(I'm using awk instead of lxc-info -H because that option doesn't exist in lxc <1.0)
Source: https://www.stgraber.org/2013/12/21/lxc-1-0-advanced-container-usage/

I'm going to implement the latter option in my branch for now, because it has better backwards compatibility, but lxc-attach seems much less hacky.

@fgrehm

This comment has been minimized.

Show comment
Hide comment
@fgrehm

fgrehm Feb 26, 2014

Owner

Unfortunately I wasn't able to find my notes =/

@ccope @codec I don't have plans to work on this on the short term, so feel free to open up a "WIP pull request" so that we can discuss the implementation itself :-)

Owner

fgrehm commented Feb 26, 2014

Unfortunately I wasn't able to find my notes =/

@ccope @codec I don't have plans to work on this on the short term, so feel free to open up a "WIP pull request" so that we can discuss the implementation itself :-)

@fgrehm fgrehm modified the milestones: v1.0.0, Nice to have Mar 19, 2014

@fgrehm fgrehm removed this from the v1.0.0 milestone Sep 23, 2014

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