Error in live migration

When trying to migrate a container live from one host to another in cluster getting error:
Error: Unable to perform container live migration. CRIU isn’t installed on the source server.

I checked CRIU is installed in the system, is there something missing. The command I am using for migration is:

lxc move test1 --target test8 (Here test8 is one of the sink node, source node is test10)

I can raise an issue on github with logs if necessary

You don’t need to install CRIU on your system to use it with the snap as it’s built into the snap itself. That being said, as it’s considered an experimental feature, you do need to enable it with:

snap set lxd criu.enable=true

The list of options for the snap is:

 Supported configuration options (snap set lxd [<key>=<value>...]):
   - criu.enable: Enable experimental live-migration support [default=false]
   - daemon.debug: Increases logging to debug level [default=false]
   - daemon.group: Group of users that can interact with LXD [default=lxd]
   - ceph.builtin: Use snap-specific ceph configuration [default=false]
   - openvswitch.builtin: Run a snap-specific OVS daemon [default=false]
   - waitready.timeout: How long to wait for LXD to be ready [default=600]

I get following error when I try to run it:

Error: Failed container creation: Error transferring container data: migration pre-dump failed
(00.150093) Warn (compel/arch/x86/src/lib/infect.c:273): Will restore 2442 with interrupted system call
(00.168751) Warn (compel/arch/x86/src/lib/infect.c:273): Will restore 2451 with interrupted system call
(00.178536) Warn (compel/arch/x86/src/lib/infect.c:273): Will restore 2469 with interrupted system call
(00.195897) Warn (compel/arch/x86/src/lib/infect.c:273): Will restore 2480 with interrupted system call
(00.204772) Warn (compel/arch/x86/src/lib/infect.c:273): Will restore 2498 with interrupted system call
(00.261906) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./run/systemd/unit-root is inaccessible
(00.261911) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.261923) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./ is inaccessible
(00.261927) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.261956) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./run/systemd/unit-root is inaccessible
(00.261959) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.261969) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./ is inaccessible
(00.261972) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.261996) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./ is inaccessible
(00.262000) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.262025) Error (criu/mount.c:1065): mnt: The file system 0x38 0x38 (0x32) btrfs ./ is inaccessible
(00.262030) Error (criu/fsnotify.c:215): fsnotify: Can’t open mount for s_dev 38, continue
(00.262032) Warn (criu/fsnotify.c:289): fsnotify: Handle 0x38:0x6bb7 cannot be opened
(00.273392) Error (criu/irmap.c:86): irmap: Can’t stat /no-such-path: No such file or directory
(00.273396) Error (criu/fsnotify.c:292): fsnotify: Can’t dump that handle
(00.273400) Error (criu/irmap.c:360): irmap: Failed to resolve 38:6bb7
(00.273423) Error (criu/cr-dump.c:1530): Pre-dumping FAILED.

Looks like a potential CRIU bug or missing feature. I’d recommend first trying with something extremely simple like a images:alpine/edge container which isn’t running anything and doesn’t have any active lxc exec sessions.

If that migrates properly, then go for more complicated.

I tried alpine edge following error in that case:

lxc move alpine alpine1 --target komerco10
Error: Failed container creation: Error transferring container data: migration restore failed
(00.000148) Error (criu/util.c:685): Can’t read link of fd -404: No such file or directory
(00.000151) Error (criu/protobuf.c:75): Unexpected EOF on (null)