stateful snapshot not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
lxc snapshot --stateful fails with
"Error: Migration is disabled when VirtFS export path '/var/lib/
Reproducer:
$ lxc profile show default
config:
limits.memory: 4096MiB
migration.
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
size.state: 4096MiB
type: disk
name: default
used_by: []
$ lxc launch ubuntu:focal f-vm --vm
$ lxc snapshot --stateful f-vm
Error: Migration is disabled when VirtFS export path '/var/lib/
Versions affected: 4.24, 5.0, latest upstream (at commit 837d8228b45010b
Some initial analysis I've done.
The error "Error: Migration is disabled when VirtFS export path '/var/lib/ lxd/devices/ f-vm/config. mount' is mounted in the guest using mount_tag 'config'" comes from qemu. /gitlab. com/qemu- project/ qemu/-/ commit/ e9a0152ba182c5c e9929ee60f83a37 b61a1d5195 ).
IIUC qemu returns this error because 9p driver is in use
(see https:/
In lxd logs I can see : 2022-05- 25T17:14: 46Z] Unable to use virtio-fs for config drive, using 9p as a fallback err="Stateful migration unsupported" instance=f-vm instanceType= virtual- machine project=default".
"WARNING[
This warning comes from [1] because DiskVMVirtiofsd Start returns error [2]. Start returns error because stateful.migration is set to true and according to [3],
IIUC DiskVMVirtiofsd
"To allow for this, the VM must have migration.stateful set to true and size.state set on its root disk device to allow
for additional space to store the runtime state. In this mode, PCI passthrough will be disabled as will be virtiofs."
However, when falling back to 9p also does not support stateful migration.
[1] https:/ /github. com/lxc/ lxd/blob/ master/ lxd/instance/ drivers/ driver_ qemu.go# L1198 /github. com/lxc/ lxd/blob/ 837d8228b45010b cbeecf581720e2c e7f17f04dc/ lxd/device/ device_ utils_disk. go#L447 /discuss. linuxcontainers .org/t/ lxd-4-12- has-been- released/ 10424#stateful- stop-and- stateful- snapshots- for-virtual- machines- 4
[2] https:/
[3] https:/