Minimum requirement for lxd-p2c


(Markus Heckmann) #1

lxd-p2c is there any snap or apt-get ppa for this migration script. (@stgraber - really like your FOSDEM demo. Thanks


#2

UPDATE: the following is wrong: The tool lxd-p2c is available with the LXD 3.0 snap package as lxd-p2c. My lxd-p2c was actually from ~/GO/bin/ (was compiled from Go).

You can compile it (assuming you have set up the Go language on your computer) with the following:

$ cd /tmp
$ go build github.com/lxc/lxd/lxd-p2c
$ ls lxd-p2c
lxd-p2c
$ ./lxd-p2c --version
3.0.0.beta7

(Stéphane Graber) #3

Actually, it’s not in the snap, on purpose.

As the tool is meant to be run on the source machine and such a source machine is very unlikely to be running a modern Linux distribution, the expected way to interact with lxd-p2c is to build it statically with go get github.com/lxc/lxd/lxd-p2c then transfer the resulting binary to the system you want to import into LXD.


(Markus Heckmann) #4

Thanks. I compiled the go. I am trying it with desitnation:

  driver: lxc
  driver_version: 2.0.8
  kernel: Linux
  kernel_architecture: x86_64
  kernel_version: 4.13.0-39-generic
  server: lxd
  server_pid: 4840
  server_version: 2.0.11

source

  driver: lxc
  driverversion: 2.0.7
  kernel: Linux
  kernelarchitecture: x86_64
  kernelversion: 4.4.0-119-generic
  server: lxd
  serverpid: 1432
  serverversion: 2.0.9

It fails with Error: not implemented.
any suggestions to fix.
Basically what are the minimum versions for source and destination. I like to stay with LTS if possible.


(Stéphane Graber) #5

Target should be 2.21 or higher, we haven’t tested with prior releases. I think the “not implemented” there refers to push migration which didn’t exist until a year or so ago.


(Markus Heckmann) #6

Thanks for the quick info. I installed backports… it is now transferring. Let you know how it goes later!
driver: lxc
driver_version: 2.0.8
kernel: Linux
kernel_architecture: x86_64
kernel_version: 4.13.0-39-generic
server: lxd
server_pid: 9484
server_version: "2.21"
storage: zfs
storage_version: 0.6.5.11-1ubuntu3.3


(Markus Heckmann) #7

One more question. Thelxd-p2c <target URL> <container name> <filesystem root> [<filesystem mounts>...] [flags]

Do I assume I need to give / and /home as 2 separate filesystem mounts in the above command.
Edit: Yes. https://youtu.be/JKztAWZOj9g?t=318


(Jair Bolivar) #8

Hello all and thank you for the great work!

Here is my issue:

I converted an ubuntu 18.04 LTS from vbox to lxc and I am having the following issue:http://paste.debian.net/1024609

Next when I enter the container > http://paste.debian.net/1024610

I tried to configure the “/etc/network/interfaces” but after restart the machine still does not not read the config…

I tried adding the ipv4 settings using “ip add blah blah” it takes the values it connects but if I restart it does not retain the settings

http://paste.debian.net/1024611/ < after this the connection works and I can interact with the container in the network but after restart all configuration is lost and I see only the ipv6 config

Little help will be greatly appreciated.

Sincerely,


(Stéphane Graber) #9

Ubuntu 18.04 uses netplan rather than ifupdown, so you’ll likely need to put network configuration in /etc/netplan/ if you want it to persist.


(Jair Bolivar) #10

@stgraber,

Works perfectly!

jair@budgie3:~$ cat /etc/netplan/01-network-manager-all.yaml

Let NetworkManager manage all devices on this system

network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.9/24]
gateway4: 192.168.0.1
nameservers:
addresses: [192.168.0.101,192.168.0.102,8.8.8.8]

&

root@server1:~# lxc list
±--------±--------±-------------------±---------------------------------------------±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±--------±--------±-------------------±---------------------------------------------±-----------±----------+
| budgie3 | RUNNING | 192.168.0.9 (eth0) | 2405:6580:2cc0:100:216:3eff:fe2e:a982 (eth0) | PERSISTENT | 0 |
±--------±--------±-------------------±---------------------------------------------±-----------±----------+
| c1 | STOPPED | | | PERSISTENT | 0 |
±--------±--------±-------------------±---------------------------------------------±-----------±----------+
| c2 | STOPPED | | | PERSISTENT | 0 |
±--------±--------±-------------------±---------------------------------------------±-----------±----------+
| debian1 | RUNNING | 192.168.0.4 (eth0) | 2405:6580:2cc0:100:216:3eff:fe16:2801 (eth0) | PERSISTENT | 0 |
±--------±--------±-------------------±---------------------------------------------±-----------±----------+

Thank you so much!

The only question I have now is: How do we maintain the TeamViewer or nomachine application working after the VM being converted to a container?

When I run the OS in VirtualBox works perfectly but as LXC I don’t get the window mamager to work or basically there is something missing for me to have the same functionality as in a VM.

Thank you in advance for your input in advance!


(Stéphane Graber) #11

I don’t know about teamviewer/nomachine. I suspect they may be tied to somehow having a display attached to the system where they can render, which would be missing in a container?

You may need to tweak some init scripts or configurations to have them start on a headless system.


(Jair Bolivar) #12

@stgraber,

I see. headless, that is the vocabulary I am looking for to investigate how to make them work. Of course, the majority of the containers I will be using will not be running a graphical window manager like GNOME or XFCE, but sometimes I would like to have that option.

I will investigate further. Thank you again!


(Markus Heckmann) #13

In ubuntu xenial compiling fails. Care to help? Thx

go get github.com/lxc/lxd/lxd-p2c
# golang.org/x/sys/unix
go/src/golang.org/x/sys/unix/ioctl.go:18: undefined: runtime.KeepAlive
go/src/golang.org/x/sys/unix/ioctl.go:28: undefined: runtime.KeepAlive

(VeFi_2018) #14

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)