[lxc-devel] lxd move specification

Tycho Andersen tycho.andersen at canonical.com
Tue Nov 11 23:51:29 UTC 2014


On Thu, Nov 06, 2014 at 09:43:51AM -0500, Stéphane Graber wrote:
> On Thu, Nov 06, 2014 at 03:56:05AM -0600, Tycho Andersen wrote:
> > Hi all,
> > 
> > I have a couple questions about exactly how `lxd move` [1] would be
> > implemented.
> > 
> > First, is the --stateful argument necessary? Can we just drop it and
> > make it implied if the container is running?
> > 
> > Second, are we sure we want to support changing the hostname of a
> > running container (lxc move c1 c2)? That seems to me to look inside
> > the container a bit too much (plus it has the added complication of
> > changing the hostname of a container when applications might not be
> > expecting it).
> > 
> > Tycho
> > 
> > [1]: https://github.com/lxc/lxd/blob/master/specs/command-line-user-experience.md#move
> 
> Hi Tycho,
> 
> Since you can't do a stateful migration with a stopped container and
> can't do a stateless migration with a running container, I agree that
> --stateful doesn't make sense and can be dropped.
> Can you send a branch for that?

Yes, I will send a branch tomorrow.

> Now as for the hostname, that's a trickier one. LXC currently does that
> kind of change on clone and rename and I think it's useful to have to
> provide a good user experience.
> 
> But I also agree that we should keep detailed knowledge about the inside
> of the container as far away from lxd as possible.
> 
> 
> So how about this:
> 
> Define a lxd specific hook, say "lxd.hook.name_changed" which if it's
> set in the config will be run against the container on initial container
> creation and whenever the container name changes.
> 
> The hook would be passed the old hostname and the new one as argument
> (or NONE if called at container creation) and would then be able to sed
> all the relevant files.
> 
> This would allow us to keep detailed knowledge of the rootfs structure
> within the image.

This sounds fine, to me. However, didn't at some point we talk about
having a /dev/lxd that we passed containers events about what was
happening on the outside? This seems like a prime candidate for some
type of event like that.

> 
> 
> As for changing the hostname under the feet of the running applications,
> I'm not too concerned about this since plenty of distros already do so
> whenever your DHCP server sends you a different hostname. So it's
> already a common thing in the real world and something that applications
> should cope with.

Fair enough. I was just thinking that if we don't actually call
sethostname maybe things would get confused.

Tycho

> 
> -- 
> Stéphane Graber
> Ubuntu developer
> http://www.ubuntu.com



> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel



More information about the lxc-devel mailing list