[lxc-devel] RFC: aliases

Jay Taylor jay at jaytaylor.com
Wed Aug 21 00:48:31 UTC 2013


On Tue, Aug 20, 2013 at 4:07 PM, Serge Hallyn <serge.hallyn at ubuntu.com>wrote:

> Quoting Jay Taylor (jay at jaytaylor.com):
> > Hey Serge,
> >
> >
> > On Tue, Aug 20, 2013 at 1:55 PM, Serge Hallyn <serge.hallyn at ubuntu.com
> >wrote:
> >
> > > Hi,
> > >
> > > one idea that has been brought up is to support 'aliases'.  So if
> you're
> > > locally building a daily pristine container, say at 'c-2013-08-20',
> > > you might want to then have a 'c-latest' alias or link pointing to the
> > > latest container, so you can always just
> > >
> > >         sudo lxc-clone -o c-latest -n test1 -s
> > >
> > > The most obvious idea would be to use a symbolic link.  However, while
> > > that mostly works, it's actually not perfect - lxc_container_new()
> > > will be called with the name you passed in (c-latest), not with the
> > > symlinked name.
> > >
> > > Another idea would be to support a $lxcpath/$lxcname/config consisting
> > > of only 'lxc.alias = c-2013-0820'.
> > >
> > > Do people have any other ideas?
> >
> >
> > > I'm thinking symbolic link may be the simplest thing to support -
> > > lxc_container_new() could immediately readlink() to get the real
> > > container name.
> > >
> >
> > I like the idea of using a symlink - it'd make it simple and intuitive to
> > understand what's going on.
> >
> > What would happen when you run lxc-destroy on an alias?  Will it destroy
> > the symlink or the container being pointed to?
>
> Good question :)  The easier thing would be to make it destroy what is
> being pointed to.  But I'm not sure right now - is that behavior weird,
> or useful?
>

I'd prefer that it destroys the symlink - just like when when you do `rm
some_symlink` in a shell, it doesn't do anything to whatever is being
pointed at.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130820/60fb76f5/attachment.html>


More information about the lxc-devel mailing list