You are not logged in.

#1 2010-02-12 01:24:39

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

[announce] vps-lxc; comprehensive tool for working with LXC containers

available...

http://aur.archlinux.org/packages.php?ID=34507

this is going to be brief, more later.  for some time i have been developing a comprehensive solution for working with LXC based VPS containers on my Arch servers.  it is about 95% complete, and ready for testing by others.

this system will allow you to build template containers for _any_ distribution if it has bootstrap type utilities (i have only implemented Arch based containers, Ubuntu and Debian will be done soon, with Fedora, maybe Opensuse, maybe others can create these?).  once the templates are created, they can be "forked" into usable domains, and the LXC config (for the lxc-* user tools) can bee 100% generated from command line options to "vps-lxc mkdom".

the code is very consistent and clean, and can easily be extended by writing/implementing your own subcommand files.  there is a command.proto file to get you started, and the "vps-lxc proto" command will show you the example command.

there is proper bash completion for most subcommands, mktpl and mkdom the exceptions for now (they have several options and i want the completion for those to be awesome).  BTRFS will be used for efficient template/domain creation if available.

see here for more details:

http://www.mail-archive.com/lxc-users@l … 00148.html

try it out if your interested in LXC, i'm using it now and its working pretty nice.  ls, init, and edit subcommands will be up soon.

here is an example of output, and do this to get started.  the system is well commented, and the usage/exception strings should guide you:

cr@ph1 ~ $ vps-lxc help
Usage: vps-lxc COMMAND [help|OPTION]...
Create, destroy, interact with, and manage LXC based Virtual Private Server
(VPS/container) domains and templates.

Creation/destruction COMMANDs:
   mktpl    create a new template from scratch or based off an existing template
   mkdom    create a new domain based off a pre-created template
   rmtpl    remove a created template
   rmdom    remove a defined/created, STOPPED domain and it's configuration
Definition/edit COMMANDs:
   define   initialize a domain after editing it's configuration (once)
   edit     edit the persistent configuration of a VPS (requires reboot)
Control/interaction COMMANDs:
   start    send a STOPPED domain a signal to start
   stop     send a RUNNING domain a signal to stop
   reboot   send a RUNNING domain a signal to reboot
   enter    enter a domain and interact via console (limited, config specific)
Query COMMANDs:
   help     what you are seeing right now
   tree     view the VPS system's directories/files in a tree
   ls       list each domain and/or template and their status
cr@ph1 ~ $ vps-lxc mktpl help
Usage: vps-lxc mktpl (-b BASE | -d DISTRO -a ARCH)
       [-p PROFILE] [-m MIRROR] TARGET
Generate a VPS template using bootstrap utilities to build it from scratch, or
base it off an existing template and add/modify packages/configuration

Options:
   -b   specifies the template used as a base for this one;
        arch and distribution will be ignored if provided
   -d   the distribution to build
   -a   target architecture
   -p   distribution specific profile; default if not provided
   -m   the mirror to use for download; overrides internal
Arguments:
   BASE      name of an existing template
   DISTRO    an existing folder in include/mktpl
   ARCH      either 32 or 64
   PROFILE   an existing folder in include/mktpl/DISTRO
   MIRROR    distribution specific mirror to use in the
             form http://...
Parameters:
   TARGET   the name of the template to be created

Options not defined can/may be set by the selected profile
cr@ph1 ~ $ vps-lxc mkdom help                          
Usage: vps-lxc mkdom -b BASE [-p PROFILE] [-h HOSTNAME] [-t TTY] [-s DEVPTS]
       [-n type=TYPE,flags=FLAGS,link=LINK,name=NAME,hwaddr=HWADDR,ipv4=IPV4,ipv6=IPV6]...
       [-c subsys.param=VALUE]... TARGET                                                  
Generate a VPS domain using an existing template as a base.  The resultant domain         
configuration is altered according to the selected profile and any options passed         

Options:
   -b   specifies the template used as a base for this domain
   -p   the profile to use; default if not provided
   -h   the hostname assigned to this domain; defaults to NAME
        if not provided
   -t   number of ttys to allocate to this domain
   -s   use a private devpts instance if possible, and restrict
        ptys to this number; not implemented upstream
   -n   append a network interface to this domain in addition
        to any defined by the profile
   -c   append cgroup subsystem values to this domain in
        addition to any defined by the profile
Arguments:
   BASE       name of an existing template
   PROFILE    an existing folder in include/mkdom
   HOSTNAME   a valid hostname; default TARGET
   TTY        positive integer; default 2
   DEVPTS     positive integer; default 1024
   TYPE       empty, veth, macvlan, or phys
   FLAGS      up; or do not specify
   LINK       an existing interface on the host
   NAME       the interface name assigned internally
              to the container
   HWADDR     a valid MAC address; do not specify
              for dynamic
   IPV4       a valid IPV4 address in the form
              x.y.z.t/m, eg. 192.168.1.123/24
   IPV6       a valid IPV6 address in the form x::y/m,
              eg. 2003:db8:1:0:214:1234:fe0b:3596/64
   VALUE      set VALUE to the specified cgroup subsystem
              parameter, e.g devices.deny=a; if VALUE has
              spaces, quotes are needed
Parameters:
   TARGET   the name of the domain to be created

Options not defined can/may be set by the selected profile

Last edited by extofme (2010-02-20 00:50:48)


what am i but an extension of you?

Offline

#2 2010-02-12 05:17:13

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

updated the PKGBUILD, everything should be rocking now.

also, i prob should have posted this in community contrib, move if need be

thanks


what am i but an extension of you?

Offline

#3 2010-02-12 06:31:20

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

Wow. This looks nice. I haven't used LXC yet but have used OpenVZ in the past. Will give this a look.

Offline

#4 2010-02-12 16:17:58

dschauer
Member
Registered: 2008-02-28
Posts: 95

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

Thanks extofme! I definitely need to try it out.

Offline

#5 2010-02-18 13:21:15

theslainman
Member
Registered: 2008-11-07
Posts: 8

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

Dependancy is lxc-git. How stable is git version of lxc?

Offline

#6 2010-02-20 00:50:30

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

well the other one in AUR is too old, plus git version will soon fix a prob i was having, see here:

http://www.mail-archive.com/lxc-users@l … 00153.html

for details.  basically for now you need to edit the conf file after a "vps-lxc mkdom", or write your own mkdom profile.  i will have some better archlinux profiles up soon, along with other improvements.  i hope to have an ubuntu profile done soon as well (i have it working manually but i haven't written the profile yet)

it is definitely usable as-is (this/lxc-git), you just may need to intervene a little more.  relatively soon i will add the logic needed to autobuild a bridge/DHCP/NAT interface for containers (this too is done manually smile but i need to write the subcommand still), and i intend to drop the mkarchroot requirement for pacman only solution (so other distros can build arch containers)


what am i but an extension of you?

Offline

#7 2010-08-19 09:17:44

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

Hello extofme, have you done any more work on your scripts? Is there any later information available than what is in this thread?

I'm interested in setting up an Arch host with Arch/Ubuntu LXC containers.

I am moving away from a hardy host with openvz hardy containers.

Cheers.

Last edited by starfry (2010-08-19 09:18:22)

Offline

#8 2010-08-19 17:39:14

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: [announce] vps-lxc; comprehensive tool for working with LXC containers

starfry wrote:

Hello extofme, have you done any more work on your scripts? Is there any later information available than what is in this thread?

I'm interested in setting up an Arch host with Arch/Ubuntu LXC containers.

I am moving away from a hardy host with openvz hardy containers.

Cheers.

unfortunately i have not done much work on these for several months, as i have since moved myself and my clients to the google appengine.  however, i do follow the lxc list and devel, and they should still work ok (possibly some minor tweaking).

the scripts are very easy to work with, and are modular; you can extend what you need.  they provide stacktraces and basic exception handling.

i do intend to work with lxc soon, and will pick vps-lxc back up then.  feel free to run with it; send me patches if you find problems.  if you have issues w/vps-lxc or lxc itself just report here and i will guide you.  i was hoping others would find it useful and share some of the workload, meh :-)

C Anthony


what am i but an extension of you?

Offline

Board footer

Powered by FluxBB