[lxc-devel] lxd move specification
Stéphane Graber
stgraber at ubuntu.com
Thu Nov 6 14:43:51 UTC 2014
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?
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.
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.
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20141106/68c707b4/attachment.sig>
More information about the lxc-devel
mailing list