Issues with copying some containers across hosts, "Invalid devices"

Hello container folks,

I have had good success with copying containers in between different hosts, but recently ran into an issue. Both hosts run LXD version 3.0.3 with a ZFS storage backend.

despens@my-host:~$ lxc copy other-host:my-container my-container
Error: Failed container creation:
 - https://1.2.3.4:8443: Error transferring container data: Unable to connect to: 1.2.3.4:8443
 - https://1.2.3.4:8443: Error transferring container data: Create LXC container: Invalid devices: Detect root disk device: No root device could be found

The first error, “Unable to connect” is definitely incorrect, as I am able to manage conainers on that host remotely and had several successful copy operations before.

I do not understand what the second error means.

The container to be copied was created in a standard way, starting out with a default image. It features 5 snapshots.

despens@my-host:~$ lxc info other-host:my-container
Name: my-container
Remote: https://1.2.3.4:8443
Architecture: x86_64
Created: 2019/01/13 19:25 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 31045
Ips:
  eth0:	inet	x.x.x.x	veth78A0MA
  eth0:	inet6	x::x:x:x:x	veth78A0MA
  lo:	inet	127.0.0.1
  lo:	inet6	::1
Resources:
  Processes: 45
  Disk usage:
    root: 5.68GB
  CPU usage:
    CPU usage (in seconds): 16
  Memory usage:
    Memory (current): 165.35MB
    Memory (peak): 166.22MB
  Network usage:
    eth0:
      Bytes received: 199.20kB
      Bytes sent: 1.28MB
      Packets received: 1454
      Packets sent: 1016
    lo:
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0
Snapshots:
      snap-1
      snap-2
      snap-3
      snap-4
      snap-5

Any idea what’s the case here?

Try passing -s default or whatever your storage pool is called on the target server.

This flag doesn’t seem to be available with the copy operation:

$ lxc copy remote-host:my-container my-container -s default
Error: unknown shorthand flag: 's' in -s
$ lxc storage ls
+---------+-------------+--------+------------------------+---------+
|  NAME   | DESCRIPTION | DRIVER |         SOURCE         | USED BY |
+---------+-------------+--------+------------------------+---------+
| default |             | zfs    | lxc-backup/lxc-storage | 2       |
+---------+-------------+--------+------------------------+---------+

Should LXD 3.0.3 support it?

Ah yeah, that’s only in more recent versions of LXD.

Does your default profile have a root disk? The error makes it sound like it may not.

lxc profile show default

Oops yes, the devices section is empty!

$ lxc profile show default
config: {}
description: Default LXD profile
devices: {}
name: default
used_by:
- /1.0/containers/some-container

Thanks for helping out with that! I have added the required information and now can happily copy containers around.

$ lxc profile show default
[...]
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  root:
    path: /
    pool: default
    type: disk
[...]

:+1: