One more lxc-clone update

Clearly the lxc-lvm-clone was a quick hack to get the LVM-based clones working so that I could use them to get something (bug work) done yesterday. I’ve now removed the separate lxc-lvm-clone program and worked its functionality into lxc-clone. So now, if container ‘natty’s rootfs is on /dev/lxc/natty LVM volume, then I can

lxc-clone -o natty -n n1 -s

to create (by default) a 2G LVM snapshot in lvm volume group ‘lxc’ from canonical container ‘natty’ for temporary container ‘n1’. To clone a container which is not using lvm, I just do

lxc-clone -o lucid -n lucidclone1

The goal is to have lxc-clone become very flexible. Doing

lxc-clone -o natty -n n1

when nattys rootfs is a block device should create a new identical filesystem type for n1 as for natty, mount both, and rsync the contents (but does not yet). Similarly, doing

lxc-clone -o lucid -n lucidclone1 -s

when lucid’s rootfs is not a block device should eventually support snapshotting with btrfs, aufs, or union-mounts (but does not yet).

Advertisements
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

One Response to One more lxc-clone update

  1. molostoff says:

    This is a good script introduced clear and simple idea on how to maintain all these containers. I do so, keeping preconfigured master as an original lvm and making snapshots from it frequently.

    One thing is not obvious is how to use this script and what it is doing indeed. I had to look inside one to see what it does when test for snapshotability of source container. It should be more helpful to see several lines of ‘-h’ help message explaining how this script tests its arguments and how will use them (because of scary fear). Learning it inside is something similar to write it by hand. (But dont mind, it is just a meaningless complain)

    Seeing more closely there is an option for default volume group where container will be created. By some unclear reason it has ‘lxc’ name. I have nothing against this default value, but very interested is these volume groups (lxc and/or possibly athother) can they live together on same disk? I have tryed to create volume with ‘lxc’ name by just adding new volume with lvcreate (as a storage pool for new volume group, namely ‘lv-all-lxcs’) and then vgcreate (named ‘lxc’) onto it. Then I simply added new container on to lxc volume group. But I was unsuccessful to boot such configuration due to a long live bug in udev/md raid time-out awaiting software raid to ready with such complicated config.

    So the question is: Do you use another physical device (disk) for ‘lxc’ volume, or use the same device? If this so, could you please share this lv/vg/(md?) configuration to understand how they (two volume groups on the same device) can live together?
    Thanks.
    ps. If it is not much difficulty, please respond by email, thanks again.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s