[lxc-users] live migration using lxd 0.4

Tycho Andersen tycho.andersen at canonical.com
Tue Mar 24 14:34:36 UTC 2015


Hi,

On Tue, Mar 24, 2015 at 04:35:42PM +0900, KATOH Yasufumi wrote:
> Hi,
> 
> I try to live migration using LXD, but not working.
> 
> * OS: Ubuntu Trusty x 2
>     * source host: lxd01
>     * destination host: lxd02
> * LXD: Install from daily PPA
>   $ dpkg-query --show lxd
>   lxd    0.4-0ubuntu1~ppa1~trusty
> 
> I ran as follows. Is there something wrong or something mistake?
> 
> 1. Change /etc/init/lxd.conf on both hosts
>   exec /usr/bin/lxd --group lxd --tcp (address of each host):8443 --debug >> /var/log/lxd.log 2>&1
> 2. Get and import image on lxd01
>   lxd-images import lxc ubuntu trusty amd64 --alias ubuntu
> 3. set password on both hosts
>   lxc config set password hogehoge
> 4. add remotes on lxd01
>   lxc remote add lxd01 lxd01:8443
>   lxc remote add lxd02 lxd02:8443
> 5. edit profile on both hosts
>   lxc config profile edit default
>   name: default
>   config:
>     raw.lxc: |-
>       lxc.tty=0
>       lxc.console=none
>       lxc.cgroup.devices.deny=c 5:1 rwm
>   devices:
>     eth0:
>       nictype: bridged
>       parent: lxcbr0
>       type: nic
> 6. Launch container on lxd01
>   lxc launch ubuntu ubuntu01
>   lxc list
>   +----------+---------+-----------+------+
>   |   NAME   |  STATE  |   IPV4    | IPV6 |
>   +----------+---------+-----------+------+
>   | ubuntu01 | RUNNING | 10.0.3.68 |      |
>   +----------+---------+-----------+------+
> 7. move the container, then error
>   lxc move lxd01:ubuntu01 lxd02:ubuntu02
>   error: Get https://10.200.200.212:8443/1.0/operations/21334af8-9b9b-40f3-bd87-e53309cee7da/wait: EOF
> 
> lxd on destination host (lxd02) output the log:
>   https://gist.github.com/tenforward/3ebccf5c18cf8f2486ea

Sorry about that. This was a bug that I inadvertently introduce just
before 0.4 was released. It is fixed by
141734d852b9ffb34eca10366e96d57c93ff23e8, which went in shortly after
0.4 was tagged, and will be in 0.5 due to be released today.

You'll also find that you need some other stuff to do live migration
(not documented anywhere, unfortunately):

1. you can't use lxcfs (or any other fuse fs)
2. only non-uidmapped containers work (you can do this in lxd by just
   setting the uidmap for lxd to be 0-65536, or by setting the uidmap
   in the container's raw.lxc config)
3. you can't be using systemd on the host
4. probably some others that I've forgotten about at the moment :)

Thanks for trying the code though! I'll hopefully be sending out fixes
for some of this stuff in the coming weeks. Let me know if you have
any problems and I can try and give you workarounds.

Tycho

> Thanks,
> KATOH Yasufumi
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list