Re: [lxc-users] Convert virtual machine to LXC container
Sorry, my mistake. I meant "lxc-console". And I just rechecked, apparently there's the equivalent "lxc console" command as well. Ignore my comment about "lxc-attach" earlier. You should be able to use lxd rootfs for lxc as long as: - you have the correct uid mapping (it's simpler if you just use privileged container. Otherwise just setup uid map on lxc config file manually) - you have a suitable lxc config file (the easiest way is probably to create a new lxc container, then replace the original rootfs with the one from rsync/lxd-p2c) -- Fajar On Thu, Aug 9, 2018 at 10:59 AM, Saint Michael wrote: > LXD does not support lxc-attach? > I thought that LXD was a superset of LXC, that added on top of it. > Maybe somebody care to explain how LXC and LXD compare. > > > On Wed, Aug 8, 2018 at 11:21 PM Fajar A. Nugraha wrote: > >> I've converted (manually) some lxc containers to lxd and back in the >> past. IIRC the biggest difference was that lxd does not need to output >> anything to console, while lxc needs it (e.g. for lxc-attach). Depending on >> what container distro and version you use, it might not matter (e.g. it >> should "just work" for newer ubuntu), and you can use the same container >> rootfs for both. >> >> If you use anything else and simple 'rsync --numeric-ids)' doesn't work, >> take a look at the customizations done by lxc-template to find out what >> else need to be adjusted, e.g. https://github.com/lxc/ >> lxc-templates/blob/master/templates/lxc-debian.in#L67 for old debian >> system that still use sysvinit. >> >> -- >> Fajar >> >> On Thu, Aug 9, 2018 at 9:18 AM, Saint Michael wrote: >> >>> The question is how can I use that for plan LXC. >>> I can install a box with LXD, bring the computer in, but then I want a >>> plain LXC container. >>> Is it doable? >>> >>> On Wed, Aug 8, 2018 at 7:17 PM David Favor wrote: >>> wrote: > Has anybody invented a procedure, a script, etc., to convert a running > machine to a LXC container? I was thinking to create a container of the > same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? Use the fabulous lxd-p2c script. ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users >>> >>> >>> ___ >>> lxc-users mailing list >>> lxc-users@lists.linuxcontainers.org >>> http://lists.linuxcontainers.org/listinfo/lxc-users >>> >> >> ___ >> lxc-users mailing list >> lxc-users@lists.linuxcontainers.org >> http://lists.linuxcontainers.org/listinfo/lxc-users > > > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users > ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Convert virtual machine to LXC container
LXD does not support lxc-attach? I thought that LXD was a superset of LXC, that added on top of it. Maybe somebody care to explain how LXC and LXD compare. On Wed, Aug 8, 2018 at 11:21 PM Fajar A. Nugraha wrote: > I've converted (manually) some lxc containers to lxd and back in the past. > IIRC the biggest difference was that lxd does not need to output anything > to console, while lxc needs it (e.g. for lxc-attach). Depending on what > container distro and version you use, it might not matter (e.g. it should > "just work" for newer ubuntu), and you can use the same container rootfs > for both. > > If you use anything else and simple 'rsync --numeric-ids)' doesn't work, > take a look at the customizations done by lxc-template to find out what > else need to be adjusted, e.g. > https://github.com/lxc/lxc-templates/blob/master/templates/lxc-debian.in#L67 > for old debian system that still use sysvinit. > > -- > Fajar > > On Thu, Aug 9, 2018 at 9:18 AM, Saint Michael wrote: > >> The question is how can I use that for plan LXC. >> I can install a box with LXD, bring the computer in, but then I want a >> plain LXC container. >> Is it doable? >> >> On Wed, Aug 8, 2018 at 7:17 PM David Favor wrote: >> >>> wrote: >>> > Has anybody invented a procedure, a script, etc., to convert a running >>> > machine to a LXC container? I was thinking to create a container of >>> the >>> > same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any >>> ideas? >>> >>> Use the fabulous lxd-p2c script. >>> ___ >>> lxc-users mailing list >>> lxc-users@lists.linuxcontainers.org >>> http://lists.linuxcontainers.org/listinfo/lxc-users >> >> >> ___ >> lxc-users mailing list >> lxc-users@lists.linuxcontainers.org >> http://lists.linuxcontainers.org/listinfo/lxc-users >> > > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Convert virtual machine to LXC container
I've converted (manually) some lxc containers to lxd and back in the past. IIRC the biggest difference was that lxd does not need to output anything to console, while lxc needs it (e.g. for lxc-attach). Depending on what container distro and version you use, it might not matter (e.g. it should "just work" for newer ubuntu), and you can use the same container rootfs for both. If you use anything else and simple 'rsync --numeric-ids)' doesn't work, take a look at the customizations done by lxc-template to find out what else need to be adjusted, e.g. https://github.com/lxc/lxc-templates/blob/master/templates/lxc-debian.in#L67 for old debian system that still use sysvinit. -- Fajar On Thu, Aug 9, 2018 at 9:18 AM, Saint Michael wrote: > The question is how can I use that for plan LXC. > I can install a box with LXD, bring the computer in, but then I want a > plain LXC container. > Is it doable? > > On Wed, Aug 8, 2018 at 7:17 PM David Favor wrote: > >> wrote: >> > Has anybody invented a procedure, a script, etc., to convert a running >> > machine to a LXC container? I was thinking to create a container of the >> > same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? >> >> Use the fabulous lxd-p2c script. >> ___ >> lxc-users mailing list >> lxc-users@lists.linuxcontainers.org >> http://lists.linuxcontainers.org/listinfo/lxc-users > > > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users > ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Convert virtual machine to LXC container
The question is how can I use that for plan LXC. I can install a box with LXD, bring the computer in, but then I want a plain LXC container. Is it doable? On Wed, Aug 8, 2018 at 7:17 PM David Favor wrote: > wrote: > > Has anybody invented a procedure, a script, etc., to convert a running > > machine to a LXC container? I was thinking to create a container of the > > same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? > > Use the fabulous lxd-p2c script. > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Convert virtual machine to LXC container
wrote: Has anybody invented a procedure, a script, etc., to convert a running machine to a LXC container? I was thinking to create a container of the same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? Use the fabulous lxd-p2c script. ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Convert virtual machine to LXC container
On Wed, Aug 08, 2018 at 07:04:31PM -0400, Saint Michael wrote: > Has anybody invented a procedure, a script, etc., to convert a running > machine to a LXC container? I was thinking to create a container of the > same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? We have that for LXD, it's lxd-p2c and does pretty much exactly what you describe but uses the LXD migration API as the rsync target effectively (so rsync over custom websocket over https). -- Stéphane Graber Ubuntu developer http://www.ubuntu.com signature.asc Description: PGP signature ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] Convert virtual machine to LXC container
Has anybody invented a procedure, a script, etc., to convert a running machine to a LXC container? I was thinking to create a container of the same OS, and then use rsync, excluding /proc /tmp/ /sys etc. Any ideas? ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] "error: LXD still not running after 5 minutes" - failed lxd.migrate - how to recover?
On Wed, Aug 08, 2018 at 11:26:10PM +0200, Tomasz Chmielewski wrote: > On 2018-08-08 22:26, Stéphane Graber wrote: > > > > Not sure how to recover now? The containers seem intact in > > > /var/lib/lxd/ > > > > What do you get if you do "journalctl -u snap.lxd.daemon -n 300" and > > -- Logs begin at Thu 2018-07-12 06:07:13 UTC, end at Wed 2018-08-08 21:07:13 > UTC. -- > Aug 08 18:21:12 b1 systemd[1]: Started Service for snap application > lxd.daemon. > Aug 08 18:21:12 b1 lxd.daemon[12581]: => Preparing the system > Aug 08 18:21:12 b1 lxd.daemon[12581]: ==> Creating missing snap > configuration > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Loading snap configuration > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up mntns symlink > (mnt:[4026532794]) > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up kmod wrapper > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing /boot > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing a clean copy of /run > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing a clean copy of /etc > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up ceph configuration > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up LVM configuration > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Rotating logs > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up ZFS (0.7) > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Escaping the systemd cgroups > Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Escaping the systemd process > resource limits > Aug 08 18:21:41 b1 systemd[1]: Stopping Service for snap application > lxd.daemon... > Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stop reason is: host shutdown > Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stopping LXD (with container > shutdown) > Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stopping LXCFS > Aug 08 18:21:43 b1 systemd[1]: Stopped Service for snap application > lxd.daemon. > Aug 08 18:21:44 b1 systemd[1]: Started Service for snap application > lxd.daemon. > Aug 08 18:21:44 b1 lxd.daemon[13676]: => Preparing the system > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Loading snap configuration > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up mntns symlink > (mnt:[4026532794]) > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up kmod wrapper > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing /boot > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing a clean copy of /run > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing a clean copy of /etc > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up ceph configuration > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up LVM configuration > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Rotating logs > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up ZFS (0.7) > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Escaping the systemd cgroups > Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Escaping the systemd process > resource limits > Aug 08 18:21:44 b1 lxd.daemon[13676]: => Starting LXCFS > Aug 08 18:21:44 b1 lxd.daemon[13676]: => Starting LXD > Aug 08 18:21:44 b1 lxd.daemon[13676]: lvl=warn msg="AppArmor support has > been disabled because of lack of kernel support" t=2018-08-08T18:21:44+ > Aug 08 18:21:44 b1 lxd.daemon[13676]: lvl=warn msg="CGroup memory swap > accounting is disabled, swap limits will be ignored." > t=2018-08-08T18:21:44+ > Aug 08 18:21:44 b1 lxd.daemon[13676]: mount namespace: 5 > Aug 08 18:21:44 b1 lxd.daemon[13676]: hierarchies: > Aug 08 18:21:44 b1 lxd.daemon[13676]: 0: fd: 6: hugetlb > Aug 08 18:21:44 b1 lxd.daemon[13676]: 1: fd: 7: pids > Aug 08 18:21:44 b1 lxd.daemon[13676]: 2: fd: 8: cpuset > Aug 08 18:21:44 b1 lxd.daemon[13676]: 3: fd: 9: perf_event > Aug 08 18:21:44 b1 lxd.daemon[13676]: 4: fd: 10: freezer > Aug 08 18:21:44 b1 lxd.daemon[13676]: 5: fd: 11: memory > Aug 08 18:21:44 b1 lxd.daemon[13676]: 6: fd: 12: devices > Aug 08 18:21:44 b1 lxd.daemon[13676]: 7: fd: 13: blkio > Aug 08 18:21:44 b1 lxd.daemon[13676]: 8: fd: 14: cpu,cpuacct > Aug 08 18:21:44 b1 lxd.daemon[13676]: 9: fd: 15: net_cls,net_prio > Aug 08 18:21:44 b1 lxd.daemon[13676]: 10: fd: 16: rdma > Aug 08 18:21:44 b1 lxd.daemon[13676]: 11: fd: 17: name=systemd > Aug 08 18:21:44 b1 lxd.daemon[13676]: 12: fd: 18: unified > Aug 08 18:28:07 b1 systemd[1]: Stopping Service for snap application > lxd.daemon... > Aug 08 18:28:07 b1 lxd.daemon[18773]: => Stop reason is: host shutdown > Aug 08 18:28:07 b1 lxd.daemon[18773]: => Stopping LXD (with container > shutdown) > Aug 08 18:37:24 b1 lxd.daemon[18773]: => Stopping LXCFS > Aug 08 18:37:25 b1 systemd[1]: Stopped Service for snap application > lxd.daemon. > -- Reboot -- > Aug 08 18:38:55 b1 systemd[1]: Started Service for snap application > lxd.daemon. > Aug 08 18:38:57 b1 lxd.daemon[2345]: => Preparing the system > Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Loading snap configuration > Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Setting up mntns symlink > (mnt:[4026532463]) > Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Setting up km
Re: [lxc-users] "error: LXD still not running after 5 minutes" - failed lxd.migrate - how to recover?
On 2018-08-08 22:26, Stéphane Graber wrote: Not sure how to recover now? The containers seem intact in /var/lib/lxd/ What do you get if you do "journalctl -u snap.lxd.daemon -n 300" and -- Logs begin at Thu 2018-07-12 06:07:13 UTC, end at Wed 2018-08-08 21:07:13 UTC. -- Aug 08 18:21:12 b1 systemd[1]: Started Service for snap application lxd.daemon. Aug 08 18:21:12 b1 lxd.daemon[12581]: => Preparing the system Aug 08 18:21:12 b1 lxd.daemon[12581]: ==> Creating missing snap configuration Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Loading snap configuration Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up mntns symlink (mnt:[4026532794]) Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up kmod wrapper Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing /boot Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing a clean copy of /run Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Preparing a clean copy of /etc Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up ceph configuration Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up LVM configuration Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Rotating logs Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Setting up ZFS (0.7) Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Escaping the systemd cgroups Aug 08 18:21:13 b1 lxd.daemon[12581]: ==> Escaping the systemd process resource limits Aug 08 18:21:41 b1 systemd[1]: Stopping Service for snap application lxd.daemon... Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stop reason is: host shutdown Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stopping LXD (with container shutdown) Aug 08 18:21:42 b1 lxd.daemon[13595]: => Stopping LXCFS Aug 08 18:21:43 b1 systemd[1]: Stopped Service for snap application lxd.daemon. Aug 08 18:21:44 b1 systemd[1]: Started Service for snap application lxd.daemon. Aug 08 18:21:44 b1 lxd.daemon[13676]: => Preparing the system Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Loading snap configuration Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up mntns symlink (mnt:[4026532794]) Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up kmod wrapper Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing /boot Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing a clean copy of /run Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Preparing a clean copy of /etc Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up ceph configuration Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up LVM configuration Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Rotating logs Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Setting up ZFS (0.7) Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Escaping the systemd cgroups Aug 08 18:21:44 b1 lxd.daemon[13676]: ==> Escaping the systemd process resource limits Aug 08 18:21:44 b1 lxd.daemon[13676]: => Starting LXCFS Aug 08 18:21:44 b1 lxd.daemon[13676]: => Starting LXD Aug 08 18:21:44 b1 lxd.daemon[13676]: lvl=warn msg="AppArmor support has been disabled because of lack of kernel support" t=2018-08-08T18:21:44+ Aug 08 18:21:44 b1 lxd.daemon[13676]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-08-08T18:21:44+ Aug 08 18:21:44 b1 lxd.daemon[13676]: mount namespace: 5 Aug 08 18:21:44 b1 lxd.daemon[13676]: hierarchies: Aug 08 18:21:44 b1 lxd.daemon[13676]: 0: fd: 6: hugetlb Aug 08 18:21:44 b1 lxd.daemon[13676]: 1: fd: 7: pids Aug 08 18:21:44 b1 lxd.daemon[13676]: 2: fd: 8: cpuset Aug 08 18:21:44 b1 lxd.daemon[13676]: 3: fd: 9: perf_event Aug 08 18:21:44 b1 lxd.daemon[13676]: 4: fd: 10: freezer Aug 08 18:21:44 b1 lxd.daemon[13676]: 5: fd: 11: memory Aug 08 18:21:44 b1 lxd.daemon[13676]: 6: fd: 12: devices Aug 08 18:21:44 b1 lxd.daemon[13676]: 7: fd: 13: blkio Aug 08 18:21:44 b1 lxd.daemon[13676]: 8: fd: 14: cpu,cpuacct Aug 08 18:21:44 b1 lxd.daemon[13676]: 9: fd: 15: net_cls,net_prio Aug 08 18:21:44 b1 lxd.daemon[13676]: 10: fd: 16: rdma Aug 08 18:21:44 b1 lxd.daemon[13676]: 11: fd: 17: name=systemd Aug 08 18:21:44 b1 lxd.daemon[13676]: 12: fd: 18: unified Aug 08 18:28:07 b1 systemd[1]: Stopping Service for snap application lxd.daemon... Aug 08 18:28:07 b1 lxd.daemon[18773]: => Stop reason is: host shutdown Aug 08 18:28:07 b1 lxd.daemon[18773]: => Stopping LXD (with container shutdown) Aug 08 18:37:24 b1 lxd.daemon[18773]: => Stopping LXCFS Aug 08 18:37:25 b1 systemd[1]: Stopped Service for snap application lxd.daemon. -- Reboot -- Aug 08 18:38:55 b1 systemd[1]: Started Service for snap application lxd.daemon. Aug 08 18:38:57 b1 lxd.daemon[2345]: => Preparing the system Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Loading snap configuration Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Setting up mntns symlink (mnt:[4026532463]) Aug 08 18:38:57 b1 lxd.daemon[2345]: ==> Setting up kmod wrapper Aug 08 18:38:58 b1 lxd.daemon[2345]: ==> Preparing /boot Aug 08 18:38:58 b1 lxd.daemon[2345]: ==> Preparing a clean copy of /run Aug 08 18:38:58 b1 lxd.daemon[2345]: ==> Preparing a clean copy of /etc Aug 08 18:38
Re: [lxc-users] "error: LXD still not running after 5 minutes" - failed lxd.migrate - how to recover?
On Wed, Aug 08, 2018 at 09:06:40PM +0200, Tomasz Chmielewski wrote: > I've tried to migrate from deb to snap on Ubuntu 18.04. > > Unfortunately, lxd.migrate failed with "error: LXD still not running after 5 > minutes": > > root@b1 ~ # lxd.migrate > => Connecting to source server > => Connecting to destination server > => Running sanity checks > > === Source server > LXD version: 3.0.1 > LXD PID: 2656 > Resources: > Containers: 6 > Images: 4 > Networks: 1 > Storage pools: 1 > > === Destination server > LXD version: 3.3 > LXD PID: 12791 > Resources: > Containers: 0 > Images: 0 > Networks: 0 > Storage pools: 0 > > The migration process will shut down all your containers then move your data > to the destination LXD. > Once the data is moved, the destination LXD will start and apply any needed > updates. > And finally your containers will be brought back to their previous state, > completing the migration. > > WARNING: /var/lib/lxd is a mountpoint. You will need to update that mount > location after the migration. > > Are you ready to proceed (yes/no) [default=no]? yes > => Shutting down the source LXD > => Stopping the source LXD units > => Stopping the destination LXD unit > => Unmounting source LXD paths > => Unmounting destination LXD paths > => Wiping destination LXD clean > => Backing up the database > => Moving the /var/lib/lxd mountpoint > => Updating the storage backends > => Starting the destination LXD > => Waiting for LXD to come online > > error: LXD still not running after 5 minutes. > > > > root@b1 ~ # lxd.migrate > => Connecting to source server > error: Unable to connect to the source LXD: Get http://unix.socket/1.0: dial > unix /var/lib/lxd/unix.socket: connect: no such file or directory > > > > root@b1 ~ # lxc list > Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: > connect: no such file or directory > > > > Not sure how to recover now? The containers seem intact in /var/lib/lxd/ What do you get if you do "journalctl -u snap.lxd.daemon -n 300" and anything useful looking in /var/snap/lxd/common/lxd/logs/lxd.log? It's expected that "systemctl start lxd" won't work anymore since the data was moved over to the snap which then likely caused your database to be upgraded, making it unreadable for your older deb version of LXD. I'd recommend you do: - systemctl stop lxd lxd.socket - systemctl mask lxd lxd.socket To prevent any accidental startup of your old LXD until the snap migration is done and it can be safely removed. -- Stéphane Graber Ubuntu developer http://www.ubuntu.com signature.asc Description: PGP signature ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] "error: LXD still not running after 5 minutes" - failed lxd.migrate - how to recover?
On 2018-08-08 21:06, Tomasz Chmielewski wrote: I've tried to migrate from deb to snap on Ubuntu 18.04. Unfortunately, lxd.migrate failed with "error: LXD still not running after 5 minutes": (...) Not sure how to recover now? The containers seem intact in /var/lib/lxd/ It seems it's partially migrated with no clear info on how to continue. Attempting to do "systemctl start lxd" produces: Error: failed to open cluster database: failed to ensure schema: schema version '9' is more recent than expected '7' Attempting to start lxd from the snap results in: # /snap/bin/lxc list Error: Both native and snap packages are installed on this system Run "lxd.migrate" to complete your migration to the snap package # systemctl status lxd ● lxd.service - LXD - main daemon Loaded: loaded (/lib/systemd/system/lxd.service; indirect; vendor preset: enabled) Active: activating (start-post) (Result: exit-code) since Wed 2018-08-08 19:28:57 UTC; 9s ago Docs: man:lxd(1) Process: 6829 ExecStart=/usr/bin/lxd --group lxd --logfile=/var/log/lxd/lxd.log (code=exited, status=1/FAILURE) Process: 6824 ExecStartPre=/usr/lib/x86_64-linux-gnu/lxc/lxc-apparmor-load (code=exited, status=0/SUCCESS) Main PID: 6829 (code=exited, status=1/FAILURE); Control PID: 6831 (lxd) Tasks: 8 CGroup: /system.slice/lxd.service └─6831 /usr/lib/lxd/lxd waitready --timeout=600 Aug 08 19:28:57 b1 systemd[1]: Starting LXD - main daemon... Aug 08 19:28:57 b1 lxd[6829]: lvl=warn msg="AppArmor support has been disabled because of lack of kernel support" t=2018-08-08T19:28:57+ Aug 08 19:28:57 b1 lxd[6829]: lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored." t=2018-08-08T19:28:57+ Aug 08 19:28:58 b1 lxd[6829]: lvl=eror msg="Failed to start the daemon: failed to open cluster database: failed to ensure schema: schema version '9' is more recent than expected '7'" t=2018-08-08T19:28:58+ Aug 08 19:28:58 b1 lxd[6829]: Error: failed to open cluster database: failed to ensure schema: schema version '9' is more recent than expected '7' Aug 08 19:28:58 b1 systemd[1]: lxd.service: Main process exited, code=exited, status=1/FAILURE # lxd.migrate => Connecting to source server error: Unable to connect to the source LXD: Get http://unix.socket/1.0: EOF # dpkg -l|grep lxd ii lxd 3.0.1-0ubuntu1~18.04.1 amd64Container hypervisor based on LXC - daemon ii lxd-client3.0.1-0ubuntu1~18.04.1 amd64Container hypervisor based on LXC - client # snap list Name VersionRev Tracking Publisher Notes core 16-2.34.3 5145 stablecanonical core lxd 3.38011 stablecanonical - -- Tomasz Chmielewski https://lxadm.com ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] "error: LXD still not running after 5 minutes" - failed lxd.migrate - how to recover?
I've tried to migrate from deb to snap on Ubuntu 18.04. Unfortunately, lxd.migrate failed with "error: LXD still not running after 5 minutes": root@b1 ~ # lxd.migrate => Connecting to source server => Connecting to destination server => Running sanity checks === Source server LXD version: 3.0.1 LXD PID: 2656 Resources: Containers: 6 Images: 4 Networks: 1 Storage pools: 1 === Destination server LXD version: 3.3 LXD PID: 12791 Resources: Containers: 0 Images: 0 Networks: 0 Storage pools: 0 The migration process will shut down all your containers then move your data to the destination LXD. Once the data is moved, the destination LXD will start and apply any needed updates. And finally your containers will be brought back to their previous state, completing the migration. WARNING: /var/lib/lxd is a mountpoint. You will need to update that mount location after the migration. Are you ready to proceed (yes/no) [default=no]? yes => Shutting down the source LXD => Stopping the source LXD units => Stopping the destination LXD unit => Unmounting source LXD paths => Unmounting destination LXD paths => Wiping destination LXD clean => Backing up the database => Moving the /var/lib/lxd mountpoint => Updating the storage backends => Starting the destination LXD => Waiting for LXD to come online error: LXD still not running after 5 minutes. root@b1 ~ # lxd.migrate => Connecting to source server error: Unable to connect to the source LXD: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory root@b1 ~ # lxc list Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory Not sure how to recover now? The containers seem intact in /var/lib/lxd/ Tomasz Chmielewski https://lxadm.com ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXC container and Systemd
I log into Arch Linux OS. Form there I attach to the container # lxc-attach -n monitor The container itself is hosting Arch Linux too. 2018-08-08 13:28 GMT+02:00 Andrey Repin : > Greetings, Goran! > >> # cat /proc/self/uid >> cat: /proc/self/uid: No such file or directory > >> I do not log into the container but attach to it. > > How do you attach? > > > -- > With best regards, > Andrey Repin > Wednesday, August 8, 2018 14:28:13 > > Sorry for my terrible english... > > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXC container and Systemd
Greetings, Goran! > # cat /proc/self/uid > cat: /proc/self/uid: No such file or directory > I do not log into the container but attach to it. How do you attach? -- With best regards, Andrey Repin Wednesday, August 8, 2018 14:28:13 Sorry for my terrible english... ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users