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

(Dragan Espenschied) #1

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:
 - Error transferring container data: Unable to connect to:
 - 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
Architecture: x86_64
Created: 2019/01/13 19:25 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 31045
  eth0:	inet	x.x.x.x	veth78A0MA
  eth0:	inet6	x::x:x:x:x	veth78A0MA
  lo:	inet
  lo:	inet6	::1
  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:
      Bytes received: 199.20kB
      Bytes sent: 1.28MB
      Packets received: 1454
      Packets sent: 1016
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0

Any idea what’s the case here?

(Stéphane Graber) #2

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

(Dragan Espenschied) #3

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?

(Stéphane Graber) #4

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

(Dragan Espenschied) #5

Oops yes, the devices section is empty!

$ lxc profile show default
config: {}
description: Default LXD profile
devices: {}
name: default
- /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
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
    path: /
    pool: default
    type: disk